You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2012/05/12 23:18:48 UTC

svn commit: r1337666 - in /ofbiz/trunk/applications/humanres: src/org/ofbiz/humanres/HumanResEvents.java webapp/humanres/WEB-INF/actions/category/CategoryTree.groovy

Author: doogie
Date: Sat May 12 21:18:48 2012
New Revision: 1337666

URL: http://svn.apache.org/viewvc?rev=1337666&view=rev
Log:
DEPRECATION: applications/humanres: findByPrimaryKey variants replaced
with findOne

Modified:
    ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java
    ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/actions/category/CategoryTree.groovy

Modified: ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java?rev=1337666&r1=1337665&r2=1337666&view=diff
==============================================================================
--- ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java (original)
+++ ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java Sat May 12 21:18:48 2012
@@ -70,7 +70,7 @@ public class HumanResEvents {
                 if (UtilValidate.isNotEmpty(emlpfillCtxs)) {
                     for (GenericValue emlpfillCtx : emlpfillCtxs ) {
                         String memberId = emlpfillCtx.getString("partyId");
-                        GenericValue memCtx = delegator.findByPrimaryKey("Person" ,UtilMisc.toMap("partyId", memberId));
+                        GenericValue memCtx = delegator.findOne("Person" ,UtilMisc.toMap("partyId", memberId), false);
                         String title = null;
                         if (UtilValidate.isNotEmpty(memCtx)) {
                             String firstname = (String) memCtx.get("firstName");
@@ -83,7 +83,7 @@ public class HumanResEvents {
                             }
                             title = firstname +" "+ lastname;
                         }
-                        GenericValue memGroupCtx = delegator.findByPrimaryKey("PartyGroup" ,UtilMisc.toMap("partyId", memberId));
+                        GenericValue memGroupCtx = delegator.findOne("PartyGroup" ,UtilMisc.toMap("partyId", memberId), false);
                         if (UtilValidate.isNotEmpty(memGroupCtx)) {
                             title = memGroupCtx.getString("groupName");
                         }
@@ -117,7 +117,7 @@ public class HumanResEvents {
         }
         
         try {
-            GenericValue partyGroup = delegator.findByPrimaryKey("PartyGroup" ,UtilMisc.toMap("partyId", partyId));
+            GenericValue partyGroup = delegator.findOne("PartyGroup" ,UtilMisc.toMap("partyId", partyId), false);
             if (UtilValidate.isNotEmpty(partyGroup)) {
                 childOfComs = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", UtilMisc.toMap(
                         "partyIdFrom", partyGroup.get("partyId"), "partyRelationshipTypeId", "GROUP_ROLLUP")));
@@ -136,7 +136,7 @@ public class HumanResEvents {
                         catId = childOfCom.get("partyIdTo");
                         
                         //Department or Sub department
-                        GenericValue childContext = delegator.findByPrimaryKey("PartyGroup" ,UtilMisc.toMap("partyId", catId));
+                        GenericValue childContext = delegator.findOne("PartyGroup" ,UtilMisc.toMap("partyId", catId), false);
                         if (UtilValidate.isNotEmpty(childContext)) {
                             catNameField = (String) childContext.get("groupName");
                             title = catNameField;
@@ -154,7 +154,7 @@ public class HumanResEvents {
                         }
                         
                         //Employee
-                        GenericValue emContext = delegator.findByPrimaryKey("Person" ,UtilMisc.toMap("partyId", catId));
+                        GenericValue emContext = delegator.findOne("Person" ,UtilMisc.toMap("partyId", catId), false);
                         if (UtilValidate.isNotEmpty(emContext)) {
                             String firstname = (String) emContext.get("firstName");
                             String lastname = (String) emContext.get("lastName");
@@ -216,7 +216,7 @@ public class HumanResEvents {
                             emplMap.put("state", "closed");
                         }
                         
-                        GenericValue emplContext = delegator.findByPrimaryKey("EmplPositionType" ,UtilMisc.toMap("emplPositionTypeId", typeId));
+                        GenericValue emplContext = delegator.findOne("EmplPositionType" ,UtilMisc.toMap("emplPositionTypeId", typeId), false);
                         String title = null;
                         if (UtilValidate.isNotEmpty(emplContext)) {
                             title = (String) emplContext.get("description") + " " +"["+ emplId +"]";

Modified: ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/actions/category/CategoryTree.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/actions/category/CategoryTree.groovy?rev=1337666&r1=1337665&r2=1337666&view=diff
==============================================================================
--- ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/actions/category/CategoryTree.groovy (original)
+++ ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/actions/category/CategoryTree.groovy Sat May 12 21:18:48 2012
@@ -44,14 +44,14 @@ subtopLists =  FastList.newInstance();
 partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", [partyIdFrom : partyId, partyRelationshipTypeId : "GROUP_ROLLUP"]));
 if (partyRelationships) {
     //root
-    partyRoot = delegator.findByPrimaryKey("PartyGroup", [partyId : partyId]);
+    partyRoot = delegator.findOne("PartyGroup", [partyId : partyId], false);
     partyRootMap = FastMap.newInstance();
     partyRootMap.put("partyId", partyId);
     partyRootMap.put("groupName", partyRoot.getString("groupName"));
 
     //child
     for(partyRelationship in partyRelationships) {
-        partyGroup = delegator.findByPrimaryKey("PartyGroup", [partyId : partyRelationship.getString("partyIdTo")]);
+        partyGroup = delegator.findOne("PartyGroup", [partyId : partyRelationship.getString("partyIdTo")], false);
         partyGroupMap = FastMap.newInstance();
         partyGroupMap.put("partyId", partyGroup.getString("partyId"));
         partyGroupMap.put("groupName", partyGroup.getString("groupName"));