Package com.dotmarketing.common.db

Examples of com.dotmarketing.common.db.DotConnect.concat()


  public List<User> getUsersByName(String filter, int start, int limit) throws DotDataException {
    DotConnect dotConnect = new DotConnect();
    boolean isFilteredByName = UtilMethods.isSet(filter);
    filter = (isFilteredByName ? filter : "");
    StringBuffer baseSql = new StringBuffer("select user_.userId from user_ where companyid = ? and userid <> 'system' ");
    String userFullName = dotConnect.concat( new String[]{ "firstname", "' '", "lastname" } );

    if( isFilteredByName ) {
      baseSql.append(" and lower(");
      baseSql.append(userFullName);
      baseSql.append(") like ?");
View Full Code Here


  @Override
  public Map<String, Object> getUsersAnRolesByName(String filter, int start, int limit) throws DotDataException {
    filter = (UtilMethods.isSet(filter) ? filter : "");
    DotConnect dotConnect = new DotConnect();
 
    String baseSql = " (select distinct 0 as isuser, 'role' as type, " + dotConnect.concat( new String[]{"role_.roleId", "''"}) + " as id, role_.name as name, 'role' as emailaddress " +
    "from role_ where companyid = '" + PublicCompanyFactory.getDefaultCompanyId() + "' " +
    "union " +
    "select distinct 1 as isuser, 'user' as type, user_.userId as id, " + dotConnect.concat( new String[]{"user_.firstName", "' '", "user_.lastName" } ) + " as name, user_.emailaddress as emailaddress " +
    "from user_ where companyid = '" + PublicCompanyFactory.getDefaultCompanyId() + "' " +
    "order by isuser, name) ";
View Full Code Here

    DotConnect dotConnect = new DotConnect();
 
    String baseSql = " (select distinct 0 as isuser, 'role' as type, " + dotConnect.concat( new String[]{"role_.roleId", "''"}) + " as id, role_.name as name, 'role' as emailaddress " +
    "from role_ where companyid = '" + PublicCompanyFactory.getDefaultCompanyId() + "' " +
    "union " +
    "select distinct 1 as isuser, 'user' as type, user_.userId as id, " + dotConnect.concat( new String[]{"user_.firstName", "' '", "user_.lastName" } ) + " as name, user_.emailaddress as emailaddress " +
    "from user_ where companyid = '" + PublicCompanyFactory.getDefaultCompanyId() + "' " +
    "order by isuser, name) ";
   
    String sql = "select isuser, id, name, type, emailaddress from " + baseSql + " uar ";
    if(UtilMethods.isSet(filter))
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.