/** * List all app users for the combo */ public ims.admin.vo.AppUserShortVoCollection listAppUsers(java.lang.String name) { StringBuilder query = new StringBuilder(); query.append("from AppUser as user where user.username != 'imsadmin' "); if (name != null) { query.append(" and (UPPER(user.username) LIKE :NAME)"); ArrayList<String> paramNames = new ArrayList<String>(); paramNames.add("NAME"); ArrayList<Object> paramValues = new ArrayList<Object>(); paramValues.add("%" + name.toUpperCase() + "%"); return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues)); } return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString())); }
/** * List all app users for the combo */ public AppUserShortVoCollection listAppUsers(java.lang.String name) { StringBuilder query = new StringBuilder(); query.append("from AppUser as user where user.username != 'imsadmin' "); if (name != null) { query.append(" and (UPPER(user.username) LIKE :NAME)"); ArrayList<String> paramNames = new ArrayList<String>(); paramNames.add("NAME"); ArrayList<Object> paramValues = new ArrayList<Object>(); paramValues.add("%" + name.toUpperCase() + "%"); query.append(" order by user.username"); return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues)); } return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString())); }
/** * List all app users for the combo */ public ims.admin.vo.AppUserShortVoCollection listAppUsers(java.lang.String name) { StringBuilder query = new StringBuilder(); query.append("from AppUser as user where user.username != 'xxxxx' "); if (name != null) { query.append(" and (UPPER(user.username) LIKE :NAME)"); ArrayList<String> paramNames = new ArrayList<String>(); paramNames.add("NAME"); ArrayList<Object> paramValues = new ArrayList<Object>(); paramValues.add("%" + name.toUpperCase() + "%"); return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues)); } return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString())); }
/** * List all app users for the combo */ public AppUserShortVoCollection listAppUsers(java.lang.String name) { StringBuilder query = new StringBuilder(); query.append("from AppUser as user where user.username != 'xxxxx' "); if (name != null) { query.append(" and (UPPER(user.username) LIKE :NAME)"); ArrayList<String> paramNames = new ArrayList<String>(); paramNames.add("NAME"); ArrayList<Object> paramValues = new ArrayList<Object>(); paramValues.add("%" + name.toUpperCase() + "%"); query.append(" order by user.username"); return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues)); } return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString())); }
public AppUserShortVoCollection getAppUsers(String username) { DomainFactory factory = getDomainFactory(); String hqlString = "from AppUser appUser where appUser.isActive = :ACTIVE and appUser.username like :USERNAME"; List appUsers = factory.find(hqlString, new String[] {"ACTIVE", "USERNAME"}, new Object[] {Boolean.TRUE, username}); return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(appUsers); }
public AppUserShortVo getAppUsersShort(AppUserShortVo voRef) { if (voRef == null) return null; DomainFactory factory = getDomainFactory(); AppUser domAppUser = (AppUser)factory.getDomainObject(AppUser.class, voRef.getID_AppUser()); return AppUserShortVoAssembler.create(domAppUser); }
public AppUserShortVo getAppUserShortVo(AppUserRefVo refVo) { if (refVo == null) throw new RuntimeException("Cannot get AppUserShortVo for null AppUserShortRefVo"); AppUser doAppUser = (AppUser) getDomainFactory().getDomainObject(AppUser.class, refVo.getID_AppUser()); return AppUserShortVoAssembler.create(doAppUser); }
@Override public AppUserShortVo getApptUserShort(AppUserRefVo userId) { if (userId != null) { AppUser user = (AppUser) getDomainFactory().getDomainObject(AppUser.class,userId.getID_AppUser()); return AppUserShortVoAssembler.create(user); } return null; }
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) { DomainFactory factory = getDomainFactory(); String andStr = " "; StringBuffer clause = new StringBuffer(); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = " from AppUser u "; boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue(); if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0) { if (mosRequired) { hql = " select u from MemberOfStaff mos inner join mos.appUser u "; clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username"); names.add("username"); values.add(appUserFilter.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } else { hql = " from AppUser u "; clause.append(" upper(u.username) like :username"); names.add("username"); values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } } else if (appUserFilter.getUsername() == null) { if (mosRequired) hql = " select u from MemberOfStaff mos inner join mos.appUser u "; } if (appUserFilter.getIsActive() != null) { clause.append(andStr + " u.isActive = :isActive" ); names.add("isActive"); values.add(appUserFilter.getIsActive()); andStr = " and "; } clause.append(andStr).append(" u.username != 'imsadmin'"); // wdev-7907 andStr=" and "; if (andStr.equals(" and ")) { hql += " where "; } hql += clause.toString(); AppUserShortVoCollection ret = new AppUserShortVoCollection(); List l = factory.find(hql, names, values); for (int i = 0; i < l.size(); i++) { AppUser domUser = (AppUser)l.get(i); AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser); if (domUser.getMos() != null && domUser.getMos().getName() != null) voUser.setUserRealName(domUser.getMos().getName().toString()); ret.add(voUser); } return ret.sort(); }
public AppUserShortVo getAppUser(AppUserVo user) { DomainFactory factory = getDomainFactory(); String andStr = " "; StringBuffer clause = new StringBuffer(); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = " from AppUser u "; boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue(); if (user.getUsername() != null && user.getUsername().length() > 0) { if (mosRequired) { hql = " select u from MemberOfStaff mos inner join mos.appUser u "; clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username"); names.add("username"); values.add(user.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } else { hql = " from AppUser u "; clause.append(" upper(u.username) like :username"); names.add("username"); values.add("%" + user.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } } else if (user.getUsername() == null) { if (mosRequired) hql = " select u from MemberOfStaff mos inner join mos.appUser u "; } if (user.getIsActive() != null) { clause.append(andStr + " u.isActive = :isActive" ); names.add("isActive"); values.add(user.getIsActive()); andStr = " and "; } clause.append(andStr).append(" u.username != 'imsadmin'"); andStr=" and "; if (andStr.equals(" and ")) { hql += " where "; } hql += clause.toString(); AppUserShortVoCollection ret = new AppUserShortVoCollection(); List l = factory.find(hql, names, values); if(l != null && l.size() > 0) { AppUser domUser = (AppUser)l.get(0); AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser); if (domUser.getMos() != null && domUser.getMos().getName() != null) voUser.setUserRealName(domUser.getMos().getName().toString()); return voUser; } return null; }
public ims.admin.vo.AppUserShortVoCollection listUsers(ims.admin.vo.AppUserShortVo filter) { DomainFactory factory = getDomainFactory(); String andStr = " "; StringBuffer clause = new StringBuffer(); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = " from AppUser u "; if (filter.getUsername() != null && filter.getUsername().length() > 0) { hql = " from AppUser u "; clause.append(" upper(u.username) like :username"); names.add("username"); values.add("%" + filter.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } clause.append(andStr + " u.isActive = :isActive" ); names.add("isActive"); values.add(Boolean.TRUE); andStr = " and "; clause.append(andStr).append(" u.username != 'xxxxx'"); andStr=" and "; if (andStr.equals(" and ")) { hql += " where "; } hql += clause.toString(); AppUserShortVoCollection ret = new AppUserShortVoCollection(); List<?> list = factory.find(hql, names, values); for (int i = 0; i < list.size(); i++) { AppUser domUser = (AppUser) list.get(i); AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser); if (domUser.getMos() != null && domUser.getMos().getName() != null) voUser.setUserRealName(domUser.getMos().getName().toString()); ret.add(voUser); } return ret.sort(); }
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) { DomainFactory factory = getDomainFactory(); String andStr = " "; StringBuffer clause = new StringBuffer(); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = " from AppUser u "; boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue(); if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0) { if (mosRequired) { hql = " select u from MemberOfStaff mos inner join mos.appUser u "; clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username"); names.add("username"); values.add(appUserFilter.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } else { hql = " from AppUser u "; clause.append(" upper(u.username) like :username"); names.add("username"); values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } } else if (appUserFilter.getUsername() == null) { if (mosRequired) hql = " select u from MemberOfStaff mos inner join mos.appUser u "; } if (appUserFilter.getIsActive() != null) { clause.append(andStr + " u.isActive = :isActive" ); names.add("isActive"); values.add(appUserFilter.getIsActive()); andStr = " and "; } if (appUserFilter.getLockedIsNotNull()) { clause.append(andStr + " u.locked = :isLocked" ); names.add("isLocked"); values.add(appUserFilter.getLocked()); andStr = " and "; } clause.append(andStr).append(" u.username != 'xxxxx'"); // wdev-7907 andStr=" and "; if (andStr.equals(" and ")) { hql += " where "; } hql += clause.toString(); AppUserShortVoCollection ret = new AppUserShortVoCollection(); List l = factory.find(hql, names, values); for (int i = 0; i < l.size(); i++) { AppUser domUser = (AppUser)l.get(i); AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser); if (domUser.getMos() != null && domUser.getMos().getName() != null) voUser.setUserRealName(domUser.getMos().getName().toString()); ret.add(voUser); } return ret.sort(); }
@Override public AppUserShortVoCollection listUsers(AppUserShortVo filter) { DomainFactory factory = getDomainFactory(); String andStr = " "; StringBuffer clause = new StringBuffer(); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = " from AppUser u "; if (filter.getUsername() != null && filter.getUsername().length() > 0) { hql = " from AppUser u "; clause.append(" upper(u.username) like :username"); names.add("username"); values.add("%" + filter.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } clause.append(andStr + " u.isActive = :isActive" ); names.add("isActive"); values.add(Boolean.TRUE); andStr = " and "; clause.append(andStr).append(" u.username != 'xxxxx'"); andStr=" and "; if (andStr.equals(" and ")) { hql += " where "; } hql += clause.toString(); AppUserShortVoCollection ret = new AppUserShortVoCollection(); List<?> list = factory.find(hql, names, values); for (int i = 0; i < list.size(); i++) { AppUser domUser = (AppUser) list.get(i); AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser); if (domUser.getMos() != null && domUser.getMos().getName() != null) voUser.setUserRealName(domUser.getMos().getName().toString()); ret.add(voUser); } return ret.sort(); }
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) { DomainFactory factory = getDomainFactory(); String andStr = " "; StringBuffer clause = new StringBuffer(); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = " from AppUser u "; boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue(); if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0) { if (mosRequired) { hql = " select u from MemberOfStaff mos inner join mos.appUser u "; clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username"); names.add("username"); values.add(appUserFilter.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } else { hql = " from AppUser u "; clause.append(" upper(u.username) like :username"); names.add("username"); values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } } else if (appUserFilter.getUsername() == null) { if (mosRequired) hql = " select u from MemberOfStaff mos inner join mos.appUser u "; } if (appUserFilter.getIsActive() != null) { clause.append(andStr + " u.isActive = :isActive" ); names.add("isActive"); values.add(appUserFilter.getIsActive()); andStr = " and "; } clause.append(andStr).append(" u.username != 'xxxxx'"); // wdev-7907 andStr=" and "; if (andStr.equals(" and ")) { hql += " where "; } hql += clause.toString(); AppUserShortVoCollection ret = new AppUserShortVoCollection(); List l = factory.find(hql, names, values); for (int i = 0; i < l.size(); i++) { AppUser domUser = (AppUser)l.get(i); AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser); if (domUser.getMos() != null && domUser.getMos().getName() != null) voUser.setUserRealName(domUser.getMos().getName().toString()); ret.add(voUser); } return ret.sort(); }
public AppUserShortVo getAppUser(AppUserVo user) { DomainFactory factory = getDomainFactory(); String andStr = " "; StringBuffer clause = new StringBuffer(); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = " from AppUser u "; boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue(); if (user.getUsername() != null && user.getUsername().length() > 0) { if (mosRequired) { hql = " select u from MemberOfStaff mos inner join mos.appUser u "; clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username"); names.add("username"); values.add(user.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } else { hql = " from AppUser u "; clause.append(" upper(u.username) like :username"); names.add("username"); values.add("%" + user.getUsername().trim().toUpperCase() + "%"); andStr = " and "; } } else if (user.getUsername() == null) { if (mosRequired) hql = " select u from MemberOfStaff mos inner join mos.appUser u "; } if (user.getIsActive() != null) { clause.append(andStr + " u.isActive = :isActive" ); names.add("isActive"); values.add(user.getIsActive()); andStr = " and "; } clause.append(andStr).append(" u.username != 'xxxxx'"); andStr=" and "; if (andStr.equals(" and ")) { hql += " where "; } hql += clause.toString(); AppUserShortVoCollection ret = new AppUserShortVoCollection(); List l = factory.find(hql, names, values); if(l != null && l.size() > 0) { AppUser domUser = (AppUser)l.get(0); AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser); if (domUser.getMos() != null && domUser.getMos().getName() != null) voUser.setUserRealName(domUser.getMos().getName().toString()); return voUser; } return null; }