How to impose NOT NULL constraint on non-primary/non-composite keys

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to impose NOT NULL constraint on non-primary/non-composite keys

Debmalya Jash

Hello All,

 

In OFBiz frame work, fieldtypeoracle.xml some field types which seems to be
useful for applying NOT NULL constraint

 

<field-type-def type="id-ne" sql-type="VARCHAR2(20)"
java-type="String"><validate method="isNotEmpty" /></field-type-def>

<field-type-def type="id-long-ne" sql-type="VARCHAR2(60)"
java-type="String"><validate method="isNotEmpty" /></field-type-def>

<field-type-def type="id-vlong-ne" sql-type="VARCHAR2(255)"
java-type="String"><validate method="isNotEmpty" /></field-type-def>

 

 

But while using them for non-primary key/non-composite key, NOT NULL
constraint is not at all effective.

 

<entity entity-name="BesDispatcher"

 
package-name="org.ofbiz.order"

 
title="BES_DISPATCHER">

                                                            <field
name="dispatcherId"                     type="id-ne"></field>

                                                            <field
name="dispatcherName"               type="id-vlong-ne"></field>

                                                            <field
name="lastUpdatedStamp"            type="date-time"></field>

                                                            <field
name="lastUpdatedTxStamp"         type="date-time"></field>

                                                            <field
name="createdStamp"                   type="date-time"></field>

                                                            <field
name="createdTxStamp"               type="date-time"></field>

                                                           

                                                            <prim-key
field="dispatcherId"/>

 

                                                            <index name="UK_
BES_DISPATCHER" unique="true">

 
<index-field name="dispatcherName"/>

                                                            </index>

                        </entity>

 

I like to apply NOT NULL constraint for dispatcherName. But it is not
possible by using id-vlon-ne.

 

Please suggest?

 

-thanks & best regards,

Debmalya Jash

 



============================================================================================================================

Tech Mahindra, formerly Mahindra-British Telecom.
 

Disclaimer:


The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of Tech Mahindra and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Tech Mahindra.


This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and Tech Mahindra is not responsible for any loss or damage arising in any way from its use.

============================================================================================================================