Package org.apache.torque.util

Examples of org.apache.torque.util.Criteria


     * @throws Exception A generic exception.
     */
    public static boolean checkExists(User user)
        throws DataBackendException, Exception
    {
        Criteria criteria = new Criteria();

        criteria.addSelectColumn(getIdColumn());

        criteria.add(getNameColumn(), user.getName());

        List results = BasePeer.doSelect(criteria);

        if (results.size() > 1)
        {
View Full Code Here


     * @exception Exception A generic exception.
     */
    public static List selectAllUsers()
        throws Exception
    {
        Criteria criteria = new Criteria();
        criteria.addAscendingOrderByColumn(getLastNameColumn());
        criteria.addAscendingOrderByColumn(getFirstNameColumn());
        criteria.setIgnoreCase(true);
        return doSelect(criteria);
    }
View Full Code Here

     * @throws UnkownEntityException if the role or a permission is not found.
     */
    public void revokeAll(Group group)
            throws DataBackendException, UnknownEntityException
    {
        for (Iterator it = getUserList(new Criteria()).iterator();
             it.hasNext();)
        {
            User user = (User) it.next();
            for (Iterator rolesIterator = getRoles(user, group).iterator();
                 rolesIterator.hasNext();)
View Full Code Here

     * @throws DataBackendException if there is an error with LDAP
     */
    public boolean checkExists(Role role)
            throws DataBackendException
    {
        RoleSet roleSet = getRoles(new Criteria());

        return roleSet.contains(role);
    }
View Full Code Here

     * @exception Exception A generic exception.
     */
    public static List selectAllConfirmedUsers()
        throws Exception
    {
        Criteria criteria = new Criteria();

        criteria.add (getConfirmColumn(), User.CONFIRM_DATA);
        criteria.addAscendingOrderByColumn(getLastNameColumn());
        criteria.addAscendingOrderByColumn(getFirstNameColumn());
        criteria.setIgnoreCase(true);
        return doSelect(criteria);
    }
View Full Code Here

     * @throws DataBackendException if there is an error with LDAP
     */
    public boolean checkExists(Group group)
            throws DataBackendException
    {
        GroupSet groupSet = getGroups(new Criteria());

        return groupSet.contains(group);
    }
View Full Code Here

     * @throws DataBackendException if there is an error with LDAP
     */
    public boolean checkExists(Permission permission)
            throws DataBackendException
    {
        PermissionSet permissionSet = getPermissions(new Criteria());

        return permissionSet.contains(permission);
    }
View Full Code Here

     * @return A criteria for the supplied user object
     */

    public static Criteria buildCriteria(User user)
    {
        Criteria crit;

        try
        {
            Class[] clazz = new Class[] { userObject };
            Object[] params =
View Full Code Here

     * @exception Exception A generic exception.
     */
    public static RoleSet retrieveSet(User user, Group group)
        throws Exception
    {
        Criteria criteria = new Criteria();

        criteria.add(UserPeerManager.getNameColumn(),
                     user.getName());

        criteria.add(TurbineUserGroupRolePeer.GROUP_ID,
                     ((Persistent) group).getPrimaryKey());

        criteria.addJoin(UserPeerManager.getIdColumn(),
                         TurbineUserGroupRolePeer.USER_ID);

        criteria.addJoin(TurbineUserGroupRolePeer.ROLE_ID, getIdColumn());

        return retrieveSet(criteria);
    }
View Full Code Here

     * @throws Exception A generic exception.
     */
    public static boolean checkExists(Role role)
        throws DataBackendException, Exception
    {
        Criteria criteria = new Criteria();

        criteria.addSelectColumn(getIdColumn());

        criteria.add(getNameColumn(), role.getName());

        List results = BasePeer.doSelect(criteria);

        if (results.size() > 1)
        {
View Full Code Here

TOP

Related Classes of org.apache.torque.util.Criteria

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.