Skip to content
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

HLM Individual search failed on userid based search fixed #758

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,15 @@ private String getQueryForIndividual(IndividualSearch searchObject, Integer limi
}

if (searchObject.getUsername() != null) {
query = query + "AND username=:username ";
query = query + "AND username in (:username) ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure proper indexing on the username column to optimize performance with the IN clause.

paramsMap.put("username", searchObject.getUsername());
}

if (searchObject.getUserId() != null) {
query = query + "AND userId=:userId ";
paramsMap.put("userId", String.valueOf(searchObject.getUserId()));
query = query + "AND userId in (:userId) ";
paramsMap.put("userId", searchObject.getUserId().stream()
.map(Object::toString)
.collect(Collectors.toList()));
}

if (searchObject.getUserUuid() != null) {
Expand Down
Loading