Package org.exoplatform.services.database

Examples of org.exoplatform.services.database.DBObjectQuery


   /**
    * Query( name = "" , standardSQL = "..." oracleSQL = "..." )
    */
   public ListAccess<User> findUsersByQuery(Query orgQuery) throws Exception
   {
      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      if (orgQuery.getUserName() != null)
      {
         dbQuery.addLIKE("UPPER(USER_NAME)", addAsterisk(orgQuery.getUserName().toUpperCase()));
      }
      if (orgQuery.getFirstName() != null)
      {
         dbQuery.addLIKE("UPPER(FIRST_NAME)", orgQuery.getFirstName().toUpperCase());
      }
      if (orgQuery.getLastName() != null)
      {
         dbQuery.addLIKE("UPPER(LAST_NAME)", orgQuery.getLastName().toUpperCase());
      }
      dbQuery.addLIKE("EMAIL", orgQuery.getEmail());
      dbQuery.addGT("LAST_LOGIN_TIME", orgQuery.getFromLoginDate());
      dbQuery.addLT("LAST_LOGIN_TIME", orgQuery.getToLoginDate());

      return new JDBCListAccess<User>(this, dbQuery.toQuery(), dbQuery.toCountQuery());
   }
View Full Code Here


      }

      @SuppressWarnings("unchecked")
      List<Membership> members = (List<Membership>)membershipHandler.findMembershipsByGroup(group);

      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      for (Membership member : members)
      {
         dbQuery.addEQ("USER_NAME", member.getUserName());
      }

      return new JDBCListAccess<User>(this, dbQuery.toQueryUseOR(), dbQuery.toCountQueryUseOR());
   }
View Full Code Here

      return new LazyPageList<User>(findAllUsers(), pageSize);
   }

   public ListAccess<User> findAllUsers() throws Exception
   {
      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      return new JDBCListAccess<User>(this, dbQuery.toQuery(), dbQuery.toCountQuery());
   }
View Full Code Here

   /**
    * Query( name = "" , standardSQL = "..." oracleSQL = "..." )
    */
   public ListAccess<User> findUsersByQuery(Query orgQuery) throws Exception
   {
      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      if (orgQuery.getUserName() != null)
      {
         dbQuery.addLIKE("UPPER(USER_NAME)", orgQuery.getUserName().toUpperCase());
      }
      if (orgQuery.getFirstName() != null)
      {
         dbQuery.addLIKE("UPPER(FIRST_NAME)", orgQuery.getFirstName().toUpperCase());
      }
      if (orgQuery.getLastName() != null)
      {
         dbQuery.addLIKE("UPPER(LAST_NAME)", orgQuery.getLastName().toUpperCase());
      }
      dbQuery.addLIKE("EMAIL", orgQuery.getEmail());
      dbQuery.addGT("LAST_LOGIN_TIME", orgQuery.getFromLoginDate());
      dbQuery.addLT("LAST_LOGIN_TIME", orgQuery.getToLoginDate());

      return new SimpleJDBCUserListAccess(this, dbQuery.toQuery(), dbQuery.toCountQuery());
   }
View Full Code Here

      GroupHandler groupHandler = service.getGroupHandler();
      Group group = groupHandler.findGroupById(groupId);
      @SuppressWarnings("unchecked")
      List<Membership> members = (List<Membership>)membershipHandler.findMembershipsByGroup(group);

      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      for (Membership member : members)
      {
         dbQuery.addLIKE("USER_NAME", member.getUserName());
         /*
               User g = findUserByName(member.getUserName());
               if (g != null)
                 users.add(g);
         */
      }

      return new SimpleJDBCUserListAccess(this, dbQuery.toQueryUseOR(), dbQuery.toCountQueryUseOR());
   }
View Full Code Here

      return new LazyPageList<User>(findAllUsers(), pageSize);
   }

   public ListAccess<User> findAllUsers() throws Exception
   {
      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      return new SimpleJDBCUserListAccess(this, dbQuery.toQuery(), dbQuery.toCountQuery());
   }
View Full Code Here

   /**
    * Query( name = "" , standardSQL = "..." oracleSQL = "..." )
    */
   public ListAccess<User> findUsersByQuery(Query orgQuery) throws Exception
   {
      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      dbQuery.addLIKE("USER_NAME", orgQuery.getUserName());
      dbQuery.addLIKE("FIRST_NAME", orgQuery.getFirstName());
      dbQuery.addLIKE("LAST_NAME", orgQuery.getLastName());
      dbQuery.addLIKE("EMAIL", orgQuery.getEmail());
      dbQuery.addGT("LAST_LOGIN_TIME", orgQuery.getFromLoginDate());
      dbQuery.addLT("LAST_LOGIN_TIME", orgQuery.getToLoginDate());

      return new SimpleJDBCUserListAccess(this, dbQuery.toQuery(), dbQuery.toCountQuery());
   }
View Full Code Here

      GroupHandler groupHandler = service.getGroupHandler();
      Group group = groupHandler.findGroupById(groupId);
      @SuppressWarnings("unchecked")
      List<Membership> members = (List<Membership>)membershipHandler.findMembershipsByGroup(group);

      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      for (Membership member : members)
      {
         dbQuery.addLIKE("USER_NAME", member.getUserName());
         /*
               User g = findUserByName(member.getUserName());
               if (g != null)
                 users.add(g);
         */
      }

      return new SimpleJDBCUserListAccess(this, dbQuery.toQueryUseOR(), dbQuery.toCountQueryUseOR());
   }
View Full Code Here

      return new LazyPageList<User>(findAllUsers(), pageSize);
   }

   public ListAccess<User> findAllUsers() throws Exception
   {
      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      return new SimpleJDBCUserListAccess(this, dbQuery.toQuery(), dbQuery.toCountQuery());
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.database.DBObjectQuery

Copyright © 2018 www.massapicom. 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.