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

Nicolas Malin commented on OFBIZ-5760:
--------------------------------------

For the PartyQual, the problem come from three Pk field on the entity :
 * partyId
 * partyQualTypeId
 * fromDate

But the fromDate is optional on service definition. If we want manage the 
association entity like PartyQual we have two solution.
1. Require fromDate on service entry
2. Extend entity-auto like that :
{code}
Index: framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
===================================================================
--- framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java        
(révision 1624617)
+++ framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java        
(copie de travail)
@@ -91,7 +91,7 @@
             boolean allPksInOnly = true;
             for (ModelField pkField: modelEntity.getPkFieldsUnmodifiable()) {
                 ModelParam pkParam = modelService.getParam(pkField.getName());
-                if (pkParam.isOut()) {
+                if (pkParam.isOut() && !"fromDate".equals(pkField.getName())) {
                     allPksInOnly = false;
                 }
             }

@@ -229,6 +231,9 @@
                     ModelParam fromDateParam = 
modelService.getParam("fromDate");
                     if (fromDateParam == null || (fromDateParam.isOptional() 
&& parameters.get("fromDate") == null)) {
                         newEntity.set("fromDate", UtilDateTime.nowTimestamp());
+                        if (fromDateParam.isOut()) {
+                            result.put("fromDate", newEntity.get("fromDate"));
+                        }
                     }
                 }
{code}



> Convert HR entites CRUD service from simple to entity-auto
> ----------------------------------------------------------
>
>                 Key: OFBIZ-5760
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5760
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: humanres
>    Affects Versions: Trunk
>            Reporter: Nicolas Malin
>            Priority: Trivial
>              Labels: crud, entity-auto
>         Attachments: OFBIZ-5760.patch
>
>
> I converted CRUD service to entity-auto for :
> || Entity || IHM Test||
> |PartyQual | {color:red}KO{color} |
> |PartyResume| OK |
> |PartySkill| OK |
> |PerfReview| {color:red}KO{color} |
> |PerfReviewItem| - |
> |PerformanceNote| - |
> |Employment| - |
> |EmploymentApp| - |
> |PartyBenefit| OK |
> |PayGrade| OK |
> |PayHistory| - |
> |PayrollPreference| - |
> |SalaryStep| {color:red}KO{color} |
> |TerminationReason| OK |
> |UnemploymentClaim| - |
> |EmplPosition| - |
> |EmplPositionFulfillment| - |
> |EmplPositionReportingStruct| - |
> |EmplPositionResponsibility| - |
> |ValidResponsibility| - |
> |SkillType| OK |
> |ResponsibilityType| OK |
> |TerminationType| OK |
> |EmplPositionType| OK |
> |EmplPositionTypeRate| OK |
> |AgreementEmploymentAppl| - |
> |EmplLeave| OK, only on update |
> |EmplLeaveType| OK |
> |JobRequisition| OK |
> |EmploymentApp| - |
> |JobInterview| OK |
> |JobInterviewType| OK |
> |PersonTraining| - |
> |TrainingClassType| OK |
> |EmplLeaveReasonType| - |
> With this first pass I tested all  entities in IHM Test = OK.
> I need to correct the failed tests and continue the untested entities.
> It's a little big, so I prefer to open this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to