Implemented: Replace fields with "id-ne", "id-long-ne" and "id-vlong-ne"

with "id", "id-long" and "id-vlong" respectively which are primary keys
(OFBIZ-9354)

As discussed in http://markmail.org/message/d2tpovewhtotukwa the "not empty" 
field types  ("id-ne", "id-long-ne" and  "id-vlong-ne") were initially added 
to implement validations on data. But, because the validations where only 
implemented in some place like webtools, it contradicts the distinction to be 
upheld on various layers. So it is better to remove these field types. 
So we will remove all those field types and will create sub tickets to replace 
them in entity definitions by corresponding "id" types.

When replacing the "not empty" field types in entity definitions by 
corresponding "id" types we will add a *not-null="true"* attribute to "makes 
the field NOT NULL on the database (like primary key fields)" as explained in 
"not-null" documentation in fieldtypemodel.xsd.  
We will finally clean the documentation of the "not-null" in fieldtypemodel.xsd.

Deepak: If field is define as primary key field so by default is will be set as 
not-null=true, so we can replace all the primary key field type from id-ne to id
 in one shot. 

Thanks: Deepak and Aditya

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1794743 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2017-05-10 18:40:24 +00:00
parent 35bf788ff0
commit ff4e16e98e
2 changed files with 23 additions and 23 deletions
+12 -12
View File
@@ -48,7 +48,7 @@ under the License.
<entity entity-name="Testing"
package-name="org.apache.ofbiz.entity.test"
title="Testing Entity">
<field name="testingId" type="id-ne"/>
<field name="testingId" type="id"/>
<field name="testingTypeId" type="id-ne"/>
<field name="testingName" type="name" enable-audit-log="true"/>
<field name="description" type="description"/>
@@ -66,7 +66,7 @@ under the License.
<entity entity-name="TestingType"
package-name="org.apache.ofbiz.entity.test"
title="Testing Entity Type">
<field name="testingTypeId" type="id-ne"/>
<field name="testingTypeId" type="id"/>
<field name="description" type="description"/>
<prim-key field="testingTypeId"/>
</entity>
@@ -75,7 +75,7 @@ under the License.
This simulates the Party->PartyGroup and Party->Person entity relationships.
========================================================= -->
<entity entity-name="TestingSubtype" package-name="org.apache.ofbiz.entity.test" title="Testing Subtype Entity">
<field name="testingTypeId" type="id-ne" />
<field name="testingTypeId" type="id" />
<field name="subtypeDescription" type="description" />
<prim-key field="testingTypeId" />
</entity>
@@ -98,7 +98,7 @@ under the License.
package-name="org.apache.ofbiz.entity.test"
title="Entity for testing EntityStatus concept">
<description>An entity for testing EntityStatus concept</description>
<field name="testingStatusId" type="id-ne"/>
<field name="testingStatusId" type="id"/>
<field name="testingId" type="id-ne" />
<field name="statusId" type="id-ne"/>
<field name="statusDate" type="date-time"/>
@@ -118,7 +118,7 @@ under the License.
package-name="org.apache.ofbiz.entity.test"
title="Entity for testing the field data types">
<description>An entity for testing the field data types</description>
<field name="testFieldTypeId" type="id-ne"/>
<field name="testFieldTypeId" type="id"/>
<field name="blobField" type="blob"/>
<field name="byteArrayField" type="byte-array"/>
<field name="objectField" type="object"/>
@@ -137,8 +137,8 @@ under the License.
<entity entity-name="TestingItem"
package-name="org.apache.ofbiz.entity.test"
title="Testing Item">
<field name="testingId" type="id-ne"/>
<field name="testingSeqId" type="id-ne"/>
<field name="testingId" type="id"/>
<field name="testingSeqId" type="id"/>
<field name="testingHistory" type="very-long"/>
<prim-key field="testingId"/>
<prim-key field="testingSeqId"/>
@@ -153,7 +153,7 @@ under the License.
<entity entity-name="TestingNode"
package-name="org.apache.ofbiz.entity.test"
title="Testing Node">
<field name="testingNodeId" type="id-ne"></field>
<field name="testingNodeId" type="id"></field>
<field name="primaryParentNodeId" type="id"></field>
<field name="description" type="description"></field>
<prim-key field="testingNodeId"/>
@@ -171,8 +171,8 @@ under the License.
<entity entity-name="TestingNodeMember"
package-name="org.apache.ofbiz.entity.test"
title="Testing Node Member">
<field name="testingNodeId" type="id-ne"/>
<field name="testingId" type="id-ne"/>
<field name="testingNodeId" type="id"/>
<field name="testingId" type="id"/>
<field name="fromDate" type="date-time"/>
<field name="thruDate" type="date-time"/>
<field name="extendFromDate" type="date-time"/><!--use to test filterDate -->
@@ -219,7 +219,7 @@ under the License.
<entity entity-name="TestingCrypto"
package-name="org.apache.ofbiz.entity.test"
title="Testing Crypto Entity">
<field name="testingCryptoId" type="id-ne"/>
<field name="testingCryptoId" type="id"/>
<field name="testingCryptoTypeId" type="id-ne"/>
<field name="unencryptedValue" type="description"/>
<field name="encryptedValue" type="description" encrypt="true"/>
@@ -245,7 +245,7 @@ under the License.
<entity entity-name="TestingRemoveAll"
package-name="org.apache.ofbiz.entity.test"
title="Testing Entity">
<field name="testingRemoveAllId" type="id-ne"/>
<field name="testingRemoveAllId" type="id"/>
<field name="description" type="description"/>
<prim-key field="testingRemoveAllId"/>
</entity>