[ 
https://issues.apache.org/jira/browse/OFBIZ-12364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17440017#comment-17440017
 ] 

Pierre Smits commented on OFBIZ-12364:
--------------------------------------

IMO, Len Silverston went a bit above and beyond when he came up with the UDM, 
as he thought that every kind of enumeration required its own table. 

And OfBiz followed suit: as examples of such implemented in OFBiz show:
{code:java}
    <entity entity-name="BudgetType"
            package-name="org.ofbiz.accounting.budget"
            title="Budget Type Entity">
      <field name="budgetTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id-ne"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="budgetTypeId"/>
      <relation type="one" fk-name="BUDGET_TYPE_PAR" title="Parent" 
rel-entity-name="BudgetType">
        <key-map field-name="parentTypeId" rel-field-name="budgetTypeId"/>
      </relation>
    </entity>
{code}
{code:java}
    <entity entity-name="ContentType"
            package-name="org.ofbiz.content.content"
            default-resource-name="ContentEntityLabels"
            title="Content Type Entity">
      <field name="contentTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id-ne"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="contentTypeId"/>
      <relation type="one" fk-name="CNTNT_TYPE_PARENT" title="Parent" 
rel-entity-name="ContentType">
        <key-map field-name="parentTypeId" rel-field-name="contentTypeId"/>
      </relation>
    </entity>
{code}
which are in essence the same as the base in framework/common:
{code:java}
    <entity entity-name="EnumerationType"
            package-name="org.ofbiz.common.enum"
            default-resource-name="CommonEntityLabels"
            title="Enumeration Type Entity">
      <field name="enumTypeId" type="id-ne"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="enumTypeId"/>
      <relation type="one" fk-name="ENUM_TYPE_PARENT" title="Parent" 
rel-entity-name="EnumerationType">
        <key-map field-name="parentTypeId" rel-field-name="enumTypeId"/>
      </relation>
    </entity>
{code}

It goes to show that a bit more thought up front could have led to not having 
over a 100 similar tables (with some of which only containing a handful of 
records in the dataset(s)) in the entity model.

> Incorrect definition and usage of EmplPositionType?
> ---------------------------------------------------
>
>                 Key: OFBIZ-12364
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12364
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: humanres
>    Affects Versions: Trunk
>            Reporter: ddev
>            Priority: Major
>         Attachments: ofbiz-empl-position-type-patch.diff
>
>
> In the Data Model Resouce Book, on page 326 (or on page 306, depending on how 
> you are counting pages), it shows EmplPositionType having fields "title" for 
> the position title, and "description" to describe what the position is 
> supposed to be about.
> However, EmplPositionType in ofbiz is missing the "title" field. 
> Fixing this is a simple one line patch.
> However, additionally ofbiz seed data seems to put the title data in the 
> description field, like so:
> applications/datamodel/data/seed/HumanResSeedData.xml: <EmplPositionType 
> description="Chief Executive Officer" hasTable="N" emplPositionTypeId="CEO"/>
> This is a simple patch as well (patch is attached)
> But does this mean we would assume that people are putting the title in the 
> description field in their local database, meaning we wouldn't patch it 
> without some kind of translation system to move the description data to the 
> title field.  What about those people who are using the field correctly 
> already?
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to