atom feed19 messages in org.apache.ofbiz.userDifference between "id" and "id-ne" f...
FromSent OnAttachments
Aditya SharmaApr 30, 2017 10:07 am 
Taher AlkhateebMay 1, 2017 12:03 am 
Scott GrayMay 1, 2017 11:41 am 
Aditya SharmaMay 2, 2017 10:33 pm 
Aditya SharmaMay 2, 2017 10:42 pm 
William CunninghamMay 3, 2017 4:25 am 
Jacques Le RouxMay 3, 2017 4:35 am 
Scott GrayMay 3, 2017 5:09 pm 
Taher AlkhateebMay 3, 2017 8:32 pm 
Scott GrayMay 3, 2017 9:20 pm 
Jacques Le RouxMay 6, 2017 7:15 am 
Aditya SharmaMay 7, 2017 11:32 pm 
Jacques Le RouxMay 8, 2017 12:15 am 
Deepak DixitMay 8, 2017 12:52 am 
Taher AlkhateebMay 8, 2017 1:14 am 
Jacques Le RouxMay 8, 2017 1:25 am 
Aditya SharmaMay 8, 2017 2:49 am 
Jacques Le RouxMay 8, 2017 5:45 am 
Aditya SharmaMay 8, 2017 6:04 am 
Subject:Difference between "id" and "id-ne" field type
From:Aditya Sharma (adit@hotwaxsystems.com)
Date:Apr 30, 2017 10:07:13 am
List:org.apache.ofbiz.user

Hi,

While creating an entity I was in ambiguity whether to go for "*id*" or " *id-ne*" field type. When I googled it I came across this very enriching discussion.

http://ofbiz.135035.n4.nabble.com/EntityEngine-field-types-td2251546.html

As stated, an "id-ne" field can only have a *non-empty* value.

I was very curious to know how it is implemented in OFBiz. I found that almost all the *fieldtype*.xml* files have *same* *sql-type* and *java-type* for these 2 field types but I couldn't get any trace of how that not-empty constraint is levied upon "id-ne" fields.

I even looked at table structure for those fields having "id-ne" field type but there was no "not-null" constraint at even the database level.

When dug into it further I can across this commit where validate elements were removed from fieldtype*.xml files.

http://markmail.org/message/otec62xiwkpjttkq

http://svn.apache.org/viewvc?view=revision&revision=959708

But I can't get why it was removed and when it was removed whether there was some implementation that took its place for those validations.

To further check if it even works I found an OOTB entity having a non-primary key "id-ne" field. I found that "*Picklist*" entity has a field *shipmentMethodTypeId* as "id- ne" type. When we *create a picklist* for an order from Facility Manager, *shipmentMethodTypeId* can be *empty*.

If my explorations are correct currently there is no difference between "id" and "id-ne" at the implementation level and there should be a Jira for it.

If I missed out something, can someone please enlighten me with that and help me understanding it well.