-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved: findParty_Status. (OFBIZ-12677) #531
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1604,14 +1604,17 @@ public static Map<String, Object> performFindParty(DispatchContext dctx, Map<Str | |
EntityFunction.upper("%" + partyId + "%"))); | ||
} | ||
|
||
// now the statusId - send ANY for all statuses; leave null for just enabled; or pass a specific status | ||
// now the statusId - null for all statuses; "PARTY_ENABLED" finds statusId == null entries also, other passed in values are matched exactly | ||
if (UtilValidate.isNotEmpty(statusId)) { | ||
andExprs.add(EntityCondition.makeCondition("statusId", statusId)); | ||
} else { | ||
// NOTE: _must_ explicitly allow null as it is not included in a not equal in many databases... odd but true | ||
andExprs.add(EntityCondition.makeCondition(EntityCondition.makeCondition("statusId", GenericEntity.NULL_FIELD), | ||
EntityOperator.OR, EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PARTY_DISABLED"))); | ||
if ("PARTY_ENABLED".equals(statusId)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please share use case why this change is needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's OK to be able to select disabled party. That can make sense in some situations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll discuss those changes and will provide an altered pull request. |
||
// NOTE: _must_ explicitly allow null as it is not included in a not equal in many databases... odd but true | ||
andExprs.add(EntityCondition.makeCondition(EntityCondition.makeCondition("statusId", | ||
GenericEntity.NULL_FIELD), EntityOperator.OR, EntityCondition.makeCondition("statusId", "PARTY_ENABLED"))); | ||
} else { | ||
andExprs.add(EntityCondition.makeCondition("statusId", statusId)); | ||
} | ||
} | ||
|
||
// check for partyTypeId | ||
if (UtilValidate.isNotEmpty(partyTypeId)) { | ||
andExprs.add(EntityCondition.makeCondition("partyTypeId", partyTypeId)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is unwanted change. Could you please revert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree I see no reason why
<attribute name="roleTypeId" type="String" mode="IN" optional="true"/> <!-- can be null or ANY to include
any -->has been moved. Not a big deal but we lose the comment