Hi Jacques,

I have read the comments that you have suggested in the data model.
I apologize for missing the single primary key changes and the name of the 
column approverId.
Now what I am trying to do in the EmplLeave table is I will add a another 
primary key 'emplLeaveId' without changing other primary key 
present in the table.

Now the entity looks like this. 

<entity entity-name="EmplLeave"
            package-name="org.ofbiz.humanres.employment"
            title="Employee Leave Entity">
        <field name="emplLeaveId" type="id-ne"/> 
        <field name="partyId" type="id-ne"/>
        <field name="leaveTypeId" type="id-ne"/>
        <field name="emplLeaveReasonTypeId" type="id-ne"/>
        <field name="fromDate" type="date-time"/>
        <field name="thruDate" type="date-time"/>
        <field name="approverPartyId" type="id-ne"/>
        <field name="approvalStatus" type="short-varchar"/>
        <field name="description" type="description"/>
        <prim-key field="emplLeaveId"/>
        <prim-key field="partyId"/>
        <prim-key field="leaveTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="EMPL_LEAVE_PRTY" rel-entity-name=
"Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="EMPL_LEAVE_ELETP" rel-entity-name=
"EmplLeaveType">
            <key-map field-name="leaveTypeId"/>
        </relation>
        <relation type="one" fk-name="EMPL_LEAVE_REASON_ELETP" 
rel-entity-name="EmplLeaveReasonType">
            <key-map field-name="emplLeaveReasonTypeId"/>
        </relation>
        <relation type="one-nofk" fk-name="EMPL_LEAVE_APPR" title=
"Approver" rel-entity-name="Party">
            <key-map field-name="approverPartyId" rel-field-name="partyId"
/>
        </relation>
    </entity>

<entity entity-name="EmplLeaveReasonType"
            package-name="org.ofbiz.humanres.employment"
            title="Leave Reason Type Entity">
        <field name="emplLeaveReasonTypeId" type="id-ne"/>
        <field name="parentTypeId" type="id-ne"/>
        <field name="hasTable" type="indicator"/>
        <field name="description" type="description"/>
        <prim-key field="emplLeaveReasonTypeId"/>
        <relation type="one" fk-name="EMPL_LEAVE_REASON_ELETP" title=
"Parent" rel-entity-name=
            "EmplLeaveReasonType">
            <key-map field-name="parentTypeId" rel-field-name=
"emplLeaveReasonTypeId"/>
        </relation>
     </entity>

If you have any doubt in this please let me know so that I will make this 
better.

Also I have seen comment of Scot  "Don't we need to add a migration 
service when we're making backwards incompatible data model changes? "
I didn't understood what he meant by adding a migration service for 
backwards incompatible data model changes.
Can you please elaborate on the same so that I can also include the 
changes of the above comment.

Thanks & Regards

Pardeep Ruhil

______________________________________________________________________

Reply via email to