Author: jleroux
Date: Wed May 10 18:40:24 2017 New Revision: 1794743 URL: http://svn.apache.org/viewvc?rev=1794743&view=rev Log: 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 Modified: ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel.xml ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel_test.xml Modified: ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel.xml?rev=1794743&r1=1794742&r2=1794743&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel.xml (original) +++ ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel.xml Wed May 10 18:40:24 2017 @@ -37,7 +37,7 @@ under the License. <!-- ========================================================= --> <entity entity-name="EntityAuditLog" package-name="org.apache.ofbiz.entity.audit" title="Entity Audit Log"> - <field name="auditHistorySeqId" type="id-ne"><description>Sequenced primary key</description></field> + <field name="auditHistorySeqId" type="id"><description>Sequenced primary key</description></field> <field name="changedEntityName" type="long-varchar"></field> <field name="changedFieldName" type="long-varchar"></field> <field name="pkCombinedValueText" type="long-varchar"></field> @@ -49,17 +49,17 @@ under the License. <prim-key field="auditHistorySeqId"/> </entity> <entity entity-name="EntityKeyStore" package-name="org.apache.ofbiz.entity.crypto" title="Entity Key Store Entity"> - <field name="keyName" type="id-vlong-ne"></field> + <field name="keyName" type="id-vlong"></field> <field name="keyText" type="long-varchar"></field> <prim-key field="keyName"/> </entity> <entity entity-name="SequenceValueItem" package-name="org.apache.ofbiz.entity.sequence" title="Sequence Value Item Entity"> - <field name="seqName" type="id-long-ne"></field> + <field name="seqName" type="id-long"></field> <field name="seqId" type="numeric"></field> <prim-key field="seqName"/> </entity> <entity entity-name="JavaResource" package-name="org.apache.ofbiz.entity" title="Java Resource"> - <field name="resourceName" type="id-vlong-ne" /> + <field name="resourceName" type="id-vlong" /> <field name="resourceValue" type="byte-array" /> <prim-key field="resourceName" /> </entity> @@ -69,7 +69,7 @@ under the License. <!-- ========================================================= --> <entity entity-name="Tenant" package-name="org.apache.ofbiz.entity.tenant"> - <field name="tenantId" type="id-ne"/> + <field name="tenantId" type="id"/> <field name="tenantName" type="name"/> <field name="initialPath" type="value"/> <field name="disabled" type="indicator"><description>Disabled if 'Y', defaults to 'N' (not disabled).</description></field> @@ -80,7 +80,7 @@ under the License. There should be one record for each tenant and each group-map for the active delegator. The jdbc fields will override the datasource -> inline-jdbc values for the per-tenant delegator. </description> - <field name="tenantId" type="id-ne"/> + <field name="tenantId" type="id"/> <field name="entityGroupName" type="name"/> <field name="jdbcUri" type="long-varchar"/> <field name="jdbcUsername" type="long-varchar"/> @@ -114,7 +114,7 @@ under the License. There should be one record for each tenant and each group-map for the active delegator. The jdbc fields will override the datasource -> inline-jdbc values for the per-tenant delegator. </description> - <field name="tenantId" type="id-ne"/> + <field name="tenantId" type="id"/> <field name="kekText" type="long-varchar"></field> <prim-key field="tenantId"/> <relation type="one" fk-name="TNTKEK_TNT" rel-entity-name="Tenant"> @@ -124,8 +124,8 @@ under the License. <!-- may be no reason for this entity, user is authenticated inside the tenant and this would only be useful to get a list of tenants per user <entity entity-name="TenantUserLogin" package-name="org.apache.ofbiz.entity.tenant"> - <field name="tenantId" type="id-ne"/> - <field name="userLoginId" type="id-vlong-ne"/> + <field name="tenantId" type="id"/> + <field name="userLoginId" type="id-vlong"/> <field name="fromDate" type="date-time"/> <field name="thruDate" type="date-time"/> <prim-key field="tenantId"/> @@ -145,7 +145,7 @@ under the License. </entity> <entity entity-name="TenantComponent" package-name="org.apache.ofbiz.entity.tenant"> <description></description> - <field name="tenantId" type="id-ne"></field> + <field name="tenantId" type="id"></field> <field name="componentName" type="name"></field> <field name="sequenceNum" type="numeric"></field> <prim-key field="componentName"/> @@ -159,7 +159,7 @@ under the License. </entity> <entity entity-name="TenantDomainName" package-name="org.apache.ofbiz.entity.tenant" title="Tenant and its Domain Name"> - <field name="tenantId" type="id-ne"></field> + <field name="tenantId" type="id"></field> <field name="domainName" type="long-varchar"></field> <prim-key field="domainName"/> <relation type="one" fk-name="TNNT_DMNAM" rel-entity-name="Tenant"> Modified: ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel_test.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel_test.xml?rev=1794743&r1=1794742&r2=1794743&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel_test.xml (original) +++ ofbiz/ofbiz-framework/trunk/framework/entity/entitydef/entitymodel_test.xml Wed May 10 18:40:24 2017 @@ -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> |
Free forum by Nabble | Edit this page |