DEPRECATION: applications/party: findByAnd variants replaced with findByAnd that takes a boolean useCache parameter.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338410 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+7
-7
@@ -379,7 +379,7 @@ public class CommunicationEventServices {
|
||||
Map<String, Object> tmpResult = null;
|
||||
|
||||
// Retrieve a contact list party status
|
||||
List<GenericValue> contactListPartyStatuses = delegator.findByAnd("ContactListPartyStatus", UtilMisc.toMap("contactListId", contactListId, "partyId", contactListPartyAndContactMech.getString("partyId"), "fromDate", contactListPartyAndContactMech.getTimestamp("fromDate"), "statusId", "CLPT_ACCEPTED"));
|
||||
List<GenericValue> contactListPartyStatuses = delegator.findByAnd("ContactListPartyStatus", UtilMisc.toMap("contactListId", contactListId, "partyId", contactListPartyAndContactMech.getString("partyId"), "fromDate", contactListPartyAndContactMech.getTimestamp("fromDate"), "statusId", "CLPT_ACCEPTED"), null, false);
|
||||
GenericValue contactListPartyStatus = EntityUtil.getFirst(contactListPartyStatuses);
|
||||
if (UtilValidate.isNotEmpty(contactListPartyStatus)) {
|
||||
// prepare body parameters
|
||||
@@ -546,7 +546,7 @@ public class CommunicationEventServices {
|
||||
String partyIdFrom = null;
|
||||
GenericValue fromCm;
|
||||
try {
|
||||
List<GenericValue> fromCms = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("infoString", sendFrom), UtilMisc.toList("-fromDate"));
|
||||
List<GenericValue> fromCms = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("infoString", sendFrom), UtilMisc.toList("-fromDate"), false);
|
||||
fromCms = EntityUtil.filterByDate(fromCms);
|
||||
fromCm = EntityUtil.getFirst(fromCms);
|
||||
} catch (GenericEntityException e) {
|
||||
@@ -562,7 +562,7 @@ public class CommunicationEventServices {
|
||||
String contactMechIdTo = null;
|
||||
GenericValue toCm;
|
||||
try {
|
||||
List<GenericValue> toCms = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("infoString", sendTo, "partyId", partyId), UtilMisc.toList("-fromDate"));
|
||||
List<GenericValue> toCms = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("infoString", sendTo, "partyId", partyId), UtilMisc.toList("-fromDate"), false);
|
||||
toCms = EntityUtil.filterByDate(toCms);
|
||||
toCm = EntityUtil.getFirst(toCms);
|
||||
} catch (GenericEntityException e) {
|
||||
@@ -739,7 +739,7 @@ public class CommunicationEventServices {
|
||||
// make sure this isn't a duplicate
|
||||
List<GenericValue> commEvents;
|
||||
try {
|
||||
commEvents = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", messageId));
|
||||
commEvents = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", messageId), null, false);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, module);
|
||||
return ServiceUtil.returnError(e.getMessage());
|
||||
@@ -835,7 +835,7 @@ public class CommunicationEventServices {
|
||||
if (inReplyTo != null && inReplyTo[0] != null) {
|
||||
GenericValue parentCommEvent = null;
|
||||
try {
|
||||
List<GenericValue> events = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", inReplyTo[0].replaceAll("[<>]", "")));
|
||||
List<GenericValue> events = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", inReplyTo[0].replaceAll("[<>]", "")), null, false);
|
||||
parentCommEvent = EntityUtil.getFirst(events);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, module);
|
||||
@@ -1215,7 +1215,7 @@ public class CommunicationEventServices {
|
||||
if (messageId != null) {
|
||||
List<GenericValue> values;
|
||||
try {
|
||||
values = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", messageId));
|
||||
values = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", messageId), null, false);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, module);
|
||||
return ServiceUtil.returnError(e.getMessage());
|
||||
@@ -1247,7 +1247,7 @@ public class CommunicationEventServices {
|
||||
// no communication events found for that message ID; possible this is a NEWSLETTER
|
||||
try {
|
||||
values = delegator.findByAnd("ContactListCommStatus", UtilMisc.toMap("messageId",
|
||||
messageId));
|
||||
messageId), null, false);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, module);
|
||||
return ServiceUtil.returnError(e.getMessage());
|
||||
|
||||
@@ -166,7 +166,7 @@ public class ContactMechServices {
|
||||
if (!partyId.equals("_NA_")) {
|
||||
// try to find a PartyContactMech with a valid date range
|
||||
try {
|
||||
List<GenericValue> partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate")), true);
|
||||
List<GenericValue> partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate"), false), true);
|
||||
partyContactMech = EntityUtil.getFirst(partyContactMechs);
|
||||
if (partyContactMech == null) {
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
|
||||
@@ -281,7 +281,7 @@ public class ContactMechServices {
|
||||
|
||||
try {
|
||||
// try to find a PartyContactMech with a valid date range
|
||||
List<GenericValue> partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate")), true);
|
||||
List<GenericValue> partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate"), false), true);
|
||||
|
||||
partyContactMech = EntityUtil.getFirst(partyContactMechs);
|
||||
} catch (GenericEntityException e) {
|
||||
@@ -429,7 +429,7 @@ public class ContactMechServices {
|
||||
if (!partyId.equals("_NA_")) {
|
||||
// try to find a PartyContactMech with a valid date range
|
||||
try {
|
||||
List<GenericValue> partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate")), true);
|
||||
List<GenericValue> partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate"), false), true);
|
||||
partyContactMech = EntityUtil.getFirst(partyContactMechs);
|
||||
if (partyContactMech == null) {
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
|
||||
@@ -640,7 +640,7 @@ public class ContactMechServices {
|
||||
try {
|
||||
contactMech = delegator.findOne("ContactMech", UtilMisc.toMap("contactMechId", contactMechId), false);
|
||||
// try to find a PartyContactMech with a valid date range
|
||||
List<GenericValue> partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate")), true);
|
||||
List<GenericValue> partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate"), false), true);
|
||||
|
||||
partyContactMech = EntityUtil.getFirst(partyContactMechs);
|
||||
} catch (GenericEntityException e) {
|
||||
@@ -811,7 +811,7 @@ public class ContactMechServices {
|
||||
try {
|
||||
Map<String, String> pcmpFindMap = UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId);
|
||||
//Debug.logInfo("pcmpFindMap = " + pcmpFindMap, module);
|
||||
List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap), true);
|
||||
List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap, null, false), true);
|
||||
|
||||
tempVal = EntityUtil.getFirst(allPCMPs);
|
||||
} catch (GenericEntityException e) {
|
||||
@@ -870,7 +870,7 @@ public class ContactMechServices {
|
||||
try {
|
||||
Map<String, String> pcmpFindMap = UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId);
|
||||
//Debug.logInfo("pcmpFindMap = " + pcmpFindMap, module);
|
||||
List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap), true);
|
||||
List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap, null, false), true);
|
||||
|
||||
tempVal = EntityUtil.getFirst(allPCMPs);
|
||||
} catch (GenericEntityException e) {
|
||||
@@ -1056,7 +1056,7 @@ public class ContactMechServices {
|
||||
verifyHash = HashCrypt.digestHash("MD5", Long.toString(random).getBytes());
|
||||
List<GenericValue> emailAddVerifications = null;
|
||||
try {
|
||||
emailAddVerifications = delegator.findByAnd("EmailAddressVerification", UtilMisc.toMap("verifyHash", verifyHash));
|
||||
emailAddVerifications = delegator.findByAnd("EmailAddressVerification", UtilMisc.toMap("verifyHash", verifyHash), null, false);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e.getMessage(), module);
|
||||
return ServiceUtil.returnError(e.getMessage());
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ContactMechWorker {
|
||||
List<GenericValue> allPartyContactMechs = null;
|
||||
|
||||
try {
|
||||
List<GenericValue> tempCol = delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId));
|
||||
List<GenericValue> tempCol = delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId), null, false);
|
||||
if (contactMechTypeId != null) {
|
||||
List<GenericValue> tempColTemp = FastList.newInstance();
|
||||
for (GenericValue partyContactMech: tempCol) {
|
||||
@@ -133,7 +133,7 @@ public class ContactMechWorker {
|
||||
List<GenericValue> allFacilityContactMechs = null;
|
||||
|
||||
try {
|
||||
List<GenericValue> tempCol = delegator.findByAnd("FacilityContactMech", UtilMisc.toMap("facilityId", facilityId));
|
||||
List<GenericValue> tempCol = delegator.findByAnd("FacilityContactMech", UtilMisc.toMap("facilityId", facilityId), null, false);
|
||||
if (contactMechTypeId != null) {
|
||||
List<GenericValue> tempColTemp = FastList.newInstance();
|
||||
for (GenericValue partyContactMech: tempCol) {
|
||||
@@ -205,7 +205,7 @@ public class ContactMechWorker {
|
||||
List<GenericValue> allOrderContactMechs = null;
|
||||
|
||||
try {
|
||||
allOrderContactMechs = delegator.findByAnd("OrderContactMech", UtilMisc.toMap("orderId", orderId), UtilMisc.toList("contactMechPurposeTypeId"));
|
||||
allOrderContactMechs = delegator.findByAnd("OrderContactMech", UtilMisc.toMap("orderId", orderId), UtilMisc.toList("contactMechPurposeTypeId"), false);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e, module);
|
||||
}
|
||||
@@ -262,7 +262,7 @@ public class ContactMechWorker {
|
||||
List<GenericValue> allWorkEffortContactMechs = null;
|
||||
|
||||
try {
|
||||
List<GenericValue> workEffortContactMechs = delegator.findByAnd("WorkEffortContactMech", UtilMisc.toMap("workEffortId", workEffortId));
|
||||
List<GenericValue> workEffortContactMechs = delegator.findByAnd("WorkEffortContactMech", UtilMisc.toMap("workEffortId", workEffortId), null, false);
|
||||
allWorkEffortContactMechs = EntityUtil.filterByDate(workEffortContactMechs);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e, module);
|
||||
@@ -338,7 +338,7 @@ public class ContactMechWorker {
|
||||
List<GenericValue> partyContactMechs = null;
|
||||
|
||||
try {
|
||||
partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId)), true);
|
||||
partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), null, false), true);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e, module);
|
||||
}
|
||||
@@ -387,7 +387,7 @@ public class ContactMechWorker {
|
||||
Iterator<GenericValue> typePurposes = null;
|
||||
|
||||
try {
|
||||
typePurposes = UtilMisc.toIterator(delegator.findByAnd("ContactMechTypePurpose", UtilMisc.toMap("contactMechTypeId", contactMechTypeId)));
|
||||
typePurposes = UtilMisc.toIterator(delegator.findByAnd("ContactMechTypePurpose", UtilMisc.toMap("contactMechTypeId", contactMechTypeId), null, false));
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e, module);
|
||||
}
|
||||
@@ -550,7 +550,7 @@ public class ContactMechWorker {
|
||||
List<GenericValue> facilityContactMechs = null;
|
||||
|
||||
try {
|
||||
facilityContactMechs = EntityUtil.filterByDate(delegator.findByAnd("FacilityContactMech", UtilMisc.toMap("facilityId", facilityId, "contactMechId", contactMechId)), true);
|
||||
facilityContactMechs = EntityUtil.filterByDate(delegator.findByAnd("FacilityContactMech", UtilMisc.toMap("facilityId", facilityId, "contactMechId", contactMechId), null, false), true);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e, module);
|
||||
}
|
||||
@@ -599,7 +599,7 @@ public class ContactMechWorker {
|
||||
Iterator<GenericValue> typePurposes = null;
|
||||
|
||||
try {
|
||||
typePurposes = UtilMisc.toIterator(delegator.findByAnd("ContactMechTypePurpose", UtilMisc.toMap("contactMechTypeId", contactMechTypeId)));
|
||||
typePurposes = UtilMisc.toIterator(delegator.findByAnd("ContactMechTypePurpose", UtilMisc.toMap("contactMechTypeId", contactMechTypeId), null, false));
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e, module);
|
||||
}
|
||||
@@ -692,7 +692,7 @@ public class ContactMechWorker {
|
||||
List<GenericValue> allPartyContactMechs = null;
|
||||
|
||||
try {
|
||||
allPartyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId)), true);
|
||||
allPartyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId), null, false), true);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e, module);
|
||||
}
|
||||
@@ -741,7 +741,7 @@ public class ContactMechWorker {
|
||||
List<GenericValue> partyContactMechs = null;
|
||||
|
||||
try {
|
||||
partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", curContactMechId)), true);
|
||||
partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", curContactMechId), null, false), true);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logWarning(e, module);
|
||||
}
|
||||
@@ -845,7 +845,7 @@ public class ContactMechWorker {
|
||||
Delegator delegator = postalAddress.getDelegator();
|
||||
List<GenericValue> postalAddresses = FastList.newInstance();
|
||||
try {
|
||||
List<GenericValue> partyContactMechs = delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", companyPartyId));
|
||||
List<GenericValue> partyContactMechs = delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", companyPartyId), null, false);
|
||||
partyContactMechs = EntityUtil.filterByDate(partyContactMechs);
|
||||
if (partyContactMechs != null) {
|
||||
for (GenericValue pcm: partyContactMechs) {
|
||||
@@ -927,8 +927,8 @@ public class ContactMechWorker {
|
||||
}
|
||||
|
||||
// no shortcut, try the longcut to see if there is something with a geoCode associated to the countryGeoId
|
||||
List<GenericValue> geoAssocAndGeoToList = delegator.findByAndCache("GeoAssocAndGeoTo",
|
||||
UtilMisc.toMap("geoIdFrom", postalAddress.getString("countryGeoId"), "geoCode", postalAddress.getString("postalCode"), "geoAssocTypeId", "REGIONS"));
|
||||
List<GenericValue> geoAssocAndGeoToList = delegator.findByAnd("GeoAssocAndGeoTo",
|
||||
UtilMisc.toMap("geoIdFrom", postalAddress.getString("countryGeoId"), "geoCode", postalAddress.getString("postalCode"), "geoAssocTypeId", "REGIONS"), null, true);
|
||||
GenericValue geoAssocAndGeoTo = EntityUtil.getFirst(geoAssocAndGeoToList);
|
||||
if (geoAssocAndGeoTo != null) {
|
||||
// save the value to the database for quicker future reference
|
||||
|
||||
@@ -231,7 +231,7 @@ public class PartyContentWrapper implements ContentWrapper {
|
||||
}
|
||||
|
||||
public static List<String> getPartyContentTextList(GenericValue party, String partyContentTypeId, Locale locale, String mimeTypeId, Delegator delegator, LocalDispatcher dispatcher) throws GeneralException, IOException {
|
||||
List<GenericValue> partyContentList = delegator.findByAndCache("PartyContent", UtilMisc.toMap("partyId", party.getString("partyId"), "partyContentTypeId", partyContentTypeId), UtilMisc.toList("-fromDate"));
|
||||
List<GenericValue> partyContentList = delegator.findByAnd("PartyContent", UtilMisc.toMap("partyId", party.getString("partyId"), "partyContentTypeId", partyContentTypeId), UtilMisc.toList("-fromDate"), true);
|
||||
partyContentList = EntityUtil.filterByDate(partyContentList);
|
||||
|
||||
List<String> contentList = FastList.newInstance();
|
||||
@@ -264,7 +264,7 @@ public class PartyContentWrapper implements ContentWrapper {
|
||||
|
||||
List<GenericValue> partyContentList = null;
|
||||
try {
|
||||
partyContentList = delegator.findByAndCache("PartyContent", UtilMisc.toMap("partyId", partyId, "partyContentTypeId", partyContentTypeId), UtilMisc.toList("-fromDate"));
|
||||
partyContentList = delegator.findByAnd("PartyContent", UtilMisc.toMap("partyId", partyId, "partyContentTypeId", partyContentTypeId), UtilMisc.toList("-fromDate"), true);
|
||||
} catch (GeneralException e) {
|
||||
Debug.logError(e, module);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class PartyRelationshipServices {
|
||||
partyRelationShipList = delegator.findByAnd("PartyRelationship", UtilMisc.toMap(sideChecked, partyId,
|
||||
"roleTypeIdFrom", roleTypeIdFrom,
|
||||
"roleTypeIdTo", roleTypeIdTo,
|
||||
"partyRelationshipTypeId", partyRelationshipTypeId));
|
||||
"partyRelationshipTypeId", partyRelationshipTypeId), null, false);
|
||||
// We consider the last one (in time) as sole active (we try to maintain a unique relationship and keep changes history)
|
||||
partyRelationShipList = EntityUtil.filterByDate(partyRelationShipList);
|
||||
GenericValue oldPartyRelationShip = EntityUtil.getFirst(partyRelationShipList);
|
||||
|
||||
@@ -245,7 +245,7 @@ public class PartyServices {
|
||||
|
||||
// disable all userlogins for this user when the new status is disabled
|
||||
if (("PARTY_DISABLED").equals(statusId)) {
|
||||
List <GenericValue> userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId));
|
||||
List <GenericValue> userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId), null, false);
|
||||
for(GenericValue userLogin : userLogins) {
|
||||
if (!"N".equals(userLogin.getString("enabled"))) {
|
||||
userLogin.set("enabled", "N");
|
||||
@@ -1597,7 +1597,7 @@ public class PartyServices {
|
||||
// update the non-existing party roles
|
||||
List<GenericValue> rolesToMove;
|
||||
try {
|
||||
rolesToMove = delegator.findByAnd("PartyRole", UtilMisc.toMap("partyId", partyId));
|
||||
rolesToMove = delegator.findByAnd("PartyRole", UtilMisc.toMap("partyId", partyId), null, false);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, module);
|
||||
return ServiceUtil.returnError(e.getMessage());
|
||||
@@ -1689,7 +1689,7 @@ public class PartyServices {
|
||||
// update the non-existing attributes
|
||||
List<GenericValue> attrsToMove;
|
||||
try {
|
||||
attrsToMove = delegator.findByAnd("PartyAttribute", UtilMisc.toMap("partyId", partyId));
|
||||
attrsToMove = delegator.findByAnd("PartyAttribute", UtilMisc.toMap("partyId", partyId), null, false);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, module);
|
||||
return ServiceUtil.returnError(e.getMessage());
|
||||
|
||||
@@ -110,7 +110,7 @@ public class PartyWorker {
|
||||
|
||||
public static GenericValue findPartyLatestContactMech(String partyId, String contactMechTypeId, Delegator delegator) {
|
||||
try {
|
||||
List<GenericValue> cmList = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("partyId", partyId, "contactMechTypeId", contactMechTypeId), UtilMisc.toList("-fromDate"));
|
||||
List<GenericValue> cmList = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("partyId", partyId, "contactMechTypeId", contactMechTypeId), UtilMisc.toList("-fromDate"), false);
|
||||
cmList = EntityUtil.filterByDate(cmList);
|
||||
return EntityUtil.getFirst(cmList);
|
||||
} catch (GenericEntityException e) {
|
||||
@@ -161,7 +161,7 @@ public class PartyWorker {
|
||||
|
||||
public static GenericValue findPartyLatestUserLogin(String partyId, Delegator delegator) {
|
||||
try {
|
||||
List<GenericValue> userLoginList = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId), UtilMisc.toList("-" + ModelEntity.STAMP_FIELD));
|
||||
List<GenericValue> userLoginList = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId), UtilMisc.toList("-" + ModelEntity.STAMP_FIELD), false);
|
||||
return EntityUtil.getFirst(userLoginList);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, "Error while finding latest UserLogin for party with ID [" + partyId + "]: " + e.toString(), module);
|
||||
@@ -171,7 +171,7 @@ public class PartyWorker {
|
||||
|
||||
public static Timestamp findPartyLastLoginTime(String partyId, Delegator delegator) {
|
||||
try {
|
||||
List<GenericValue> loginHistory = delegator.findByAnd("UserLoginHistory", UtilMisc.toMap("partyId", partyId), UtilMisc.toList("-fromDate"));
|
||||
List<GenericValue> loginHistory = delegator.findByAnd("UserLoginHistory", UtilMisc.toMap("partyId", partyId), UtilMisc.toList("-fromDate"), false);
|
||||
GenericValue v = EntityUtil.getFirst(loginHistory);
|
||||
if (v != null) {
|
||||
return v.getTimestamp("fromDate");
|
||||
@@ -502,7 +502,7 @@ public class PartyWorker {
|
||||
if (UtilValidate.isNotEmpty(partyIdentificationTypeId)) {
|
||||
conditions.put("partyIdentificationTypeId", partyIdentificationTypeId);
|
||||
}
|
||||
partiesFound = delegator.findByAndCache("PartyIdentificationAndParty", conditions, UtilMisc.toList("partyId"));
|
||||
partiesFound = delegator.findByAnd("PartyIdentificationAndParty", conditions, UtilMisc.toList("partyId"), true);
|
||||
}
|
||||
|
||||
if (! searchPartyFirst) {
|
||||
|
||||
+2
-2
@@ -32,11 +32,11 @@ partyIdTo = context.partyIdTo;
|
||||
|
||||
if (parameters.communicationEventTypeId) {
|
||||
if ("EMAIL_COMMUNICATION".equals(parameters.communicationEventTypeId)) {
|
||||
userEmailAddresses = delegator.findByAnd("PartyContactWithPurpose", [contactMechTypeId : "EMAIL_ADDRESS" , partyId : partyIdFrom]);
|
||||
userEmailAddresses = delegator.findByAnd("PartyContactWithPurpose", [contactMechTypeId : "EMAIL_ADDRESS" , partyId : partyIdFrom], null, false);
|
||||
userEmailAddresses = EntityUtil.filterByDate(userEmailAddresses, UtilDateTime.nowTimestamp(), "contactFromDate", "contactThruDate", true);
|
||||
context.userEmailAddresses = userEmailAddresses;
|
||||
|
||||
targetEmailAddresses = delegator.findByAnd("PartyContactWithPurpose", [contactMechTypeId : "EMAIL_ADDRESS", partyId : partyIdTo]);
|
||||
targetEmailAddresses = delegator.findByAnd("PartyContactWithPurpose", [contactMechTypeId : "EMAIL_ADDRESS", partyId : partyIdTo], null, false);
|
||||
targetEmailAddresses = EntityUtil.filterByDate(targetEmailAddresses, UtilDateTime.nowTimestamp(), "contactFromDate", "contactThruDate", true);
|
||||
context.targetEmailAddresses = targetEmailAddresses;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ if (!partyId && shoppingListId) {
|
||||
context.partyId = partyId;
|
||||
|
||||
// get the top level shopping lists for the party
|
||||
allShoppingLists = delegator.findByAnd("ShoppingList", [partyId : partyId], ["listName"]);
|
||||
allShoppingLists = delegator.findByAnd("ShoppingList", [partyId : partyId], ["listName"], false);
|
||||
shoppingLists = EntityUtil.filterByAnd(allShoppingLists, [parentShoppingListId : null]);
|
||||
context.allShoppingLists = allShoppingLists;
|
||||
context.shoppingLists = shoppingLists;
|
||||
@@ -124,7 +124,7 @@ if (shoppingListId) {
|
||||
context.shoppingListType = shoppingListType;
|
||||
|
||||
// get the child shopping lists of the current list for the logged in user
|
||||
childShoppingLists = delegator.findByAndCache("ShoppingList", [partyId : partyId, parentShoppingListId : shoppingListId], ["listName"]);
|
||||
childShoppingLists = delegator.findByAnd("ShoppingList", [partyId : partyId, parentShoppingListId : shoppingListId], ["listName"], true);
|
||||
// now get prices for each child shopping list...
|
||||
if (childShoppingLists) {
|
||||
childShoppingListDatas = new ArrayList(childShoppingLists.size());
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.ofbiz.entity.util.EntityUtil;
|
||||
partyId = partyId ?: parameters.partyId;
|
||||
|
||||
savedCart = EntityUtil.getFirst(delegator.findByAnd("ShoppingList", [partyId : partyId,
|
||||
shoppingListTypeId : "SLT_SPEC_PURP" , listName : "auto-save"]));
|
||||
shoppingListTypeId : "SLT_SPEC_PURP" , listName : "auto-save"], null, false));
|
||||
|
||||
if (savedCart) {
|
||||
context.savedCartListId = savedCart.shoppingListId;
|
||||
|
||||
@@ -21,7 +21,7 @@ if (userLogin) {
|
||||
companies = delegator.findByAnd("PartyRelationship",
|
||||
[partyIdTo: userLogin.partyId,
|
||||
roleTypeIdTo: "CONTACT",
|
||||
roleTypeIdFrom: "ACCOUNT"]);
|
||||
roleTypeIdFrom: "ACCOUNT"], null, false);
|
||||
if (companies) {
|
||||
company = companies[0];
|
||||
context.myCompanyId = company.partyIdFrom;
|
||||
|
||||
@@ -19,28 +19,28 @@
|
||||
import org.ofbiz.entity.*;
|
||||
import org.ofbiz.entity.util.EntityUtil;
|
||||
|
||||
roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT']);
|
||||
roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT'], null, false);
|
||||
if (roleTypeAndParty) {
|
||||
context.accountDescription = roleTypeAndParty[0].description;
|
||||
}
|
||||
|
||||
roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'CONTACT']);
|
||||
roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'CONTACT'], null, false);
|
||||
if (roleTypeAndParty) {
|
||||
context.contactDescription = roleTypeAndParty.get(0).description;
|
||||
}
|
||||
roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'LEAD']);
|
||||
roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'LEAD'], null, false);
|
||||
if (roleTypeAndParty) {
|
||||
context.leadDescription = roleTypeAndParty.get(0).description;
|
||||
partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdTo": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"]));
|
||||
partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdTo": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"], null, false));
|
||||
if (partyRelationships) {
|
||||
context.partyGroupId = partyRelationships.get(0).partyIdFrom;
|
||||
context.partyId = parameters.partyId;
|
||||
}
|
||||
}
|
||||
roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT_LEAD']);
|
||||
roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT_LEAD'], null, false);
|
||||
if (roleTypeAndParty) {
|
||||
context.leadDescription = roleTypeAndParty.get(0).description;
|
||||
partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdFrom": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"]));
|
||||
partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdFrom": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"], null, false));
|
||||
if (partyRelationships) {
|
||||
context.partyGroupId = parameters.partyId;
|
||||
context.partyId = partyRelationships.get(0).partyIdTo;
|
||||
|
||||
@@ -25,7 +25,7 @@ serverHits = null;
|
||||
if (visitId) {
|
||||
visit = delegator.findOne("Visit", [visitId : visitId], false);
|
||||
if (visit) {
|
||||
serverHits = delegator.findByAnd("ServerHit", [visitId : visitId], ["-hitStartDateTime"]);
|
||||
serverHits = delegator.findByAnd("ServerHit", [visitId : visitId], ["-hitStartDateTime"], false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ under the License.
|
||||
<#if partyType?exists>
|
||||
<td>
|
||||
<#if partyType.partyTypeId?has_content && partyType.partyTypeId=="PERSON">
|
||||
<#assign partyRelateCom = delegator.findByAnd("PartyRelationship", {"partyIdTo", partyRow.partyId,"roleTypeIdFrom","ACCOUNT","roleTypeIdTo","CONTACT"})>
|
||||
<#assign partyRelateCom = delegator.findByAnd("PartyRelationship", {"partyIdTo", partyRow.partyId,"roleTypeIdFrom","ACCOUNT","roleTypeIdTo","CONTACT"}, null, false)>
|
||||
<#if partyRelateCom?has_content>
|
||||
<#list partyRelateCom as partyRelationship>
|
||||
<#if partyRelationship.partyIdFrom?has_content>
|
||||
|
||||
Reference in New Issue
Block a user