Fixes Collaborators' autocomplete search query not working properly.
This commit is contained in:
parent
199d011f98
commit
7de3e34a6d
|
@ -32,6 +32,8 @@ public class UserInfoDaoImpl extends DatabaseAccess<UserInfo> implements UserInf
|
||||||
users.where((builder, root) -> builder.or(builder.like(builder.upper(root.get("name")), "%" + criteria.getLike().toUpperCase() + "%"), builder.like(root.get("email"), "%" + criteria.getLike() + "%")));
|
users.where((builder, root) -> builder.or(builder.like(builder.upper(root.get("name")), "%" + criteria.getLike().toUpperCase() + "%"), builder.like(root.get("email"), "%" + criteria.getLike() + "%")));
|
||||||
if (criteria.getEmail() != null)
|
if (criteria.getEmail() != null)
|
||||||
users.where((builder, root) -> builder.equal(root.get("email"), criteria.getEmail()));
|
users.where((builder, root) -> builder.equal(root.get("email"), criteria.getEmail()));
|
||||||
|
if (criteria.getCollaboratorLike() != null)
|
||||||
|
users.where((builder, root) -> builder.or(builder.like(builder.upper(root.get("name")), "%" + criteria.getCollaboratorLike().toUpperCase() + "%"), builder.like(root.get("email"), "%" + criteria.getCollaboratorLike() + "%")));
|
||||||
return users;
|
return users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +44,6 @@ public class UserInfoDaoImpl extends DatabaseAccess<UserInfo> implements UserInf
|
||||||
users.subQuery((builder1, root1) -> builder1.equal(root1.get("id"), principalId),
|
users.subQuery((builder1, root1) -> builder1.equal(root1.get("id"), principalId),
|
||||||
Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmps:id")))),
|
Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmps:id")))),
|
||||||
builder.notEqual(root.get("id"), principalId)));
|
builder.notEqual(root.get("id"), principalId)));
|
||||||
|
|
||||||
return users;
|
return users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,7 @@ public class UserManager {
|
||||||
|
|
||||||
public DataTableData<UserListingModel> getCollaboratorsPaged(UserInfoTableRequestItem userInfoTableRequestItem, Principal principal) throws Exception {
|
public DataTableData<UserListingModel> getCollaboratorsPaged(UserInfoTableRequestItem userInfoTableRequestItem, Principal principal) throws Exception {
|
||||||
UserInfoDao userInfoDao = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao();
|
UserInfoDao userInfoDao = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao();
|
||||||
|
QueryableList<UserInfo> users = userInfoDao.getWithCriteria(userInfoTableRequestItem.getCriteria());
|
||||||
QueryableList<UserInfo> users = userInfoDao.asQueryable();
|
|
||||||
|
|
||||||
List<UserListingModel> colaborators = userInfoDao.getAuthenticated(users, principal.getId())
|
List<UserListingModel> colaborators = userInfoDao.getAuthenticated(users, principal.getId())
|
||||||
.withHint(HintedModelFactory.getHint(UserListingModel.class))
|
.withHint(HintedModelFactory.getHint(UserListingModel.class))
|
||||||
|
|
Loading…
Reference in New Issue