Package org.apache.turbine.util.db

Examples of org.apache.turbine.util.db.Criteria


        {
            synchronized(this)
            {
                if(allGroups == null)
                {
                    allGroups = getGroups( new Criteria() );
                }
            }
        }
        return allGroups;
    }
View Full Code Here


        {
            synchronized(this)
            {
                if(allRoles == null)
                {
                    allRoles = getRoles( new Criteria() );
                }
            }
        }
        return allRoles;
    }
View Full Code Here

        {
            synchronized(this)
            {
                if(allPermissions == null)
                {
                    allPermissions = getPermissions( new Criteria() );
                }
            }
        }
        return allPermissions;
    }
View Full Code Here

     * @exception Exception, a generic exception.
     */
    public static void doUpdate(Criteria criteria)
        throws Exception
    {
        Criteria selectCriteria = new Criteria(2);
        selectCriteria.put( OID, criteria.remove(OID) );
        BasePeer.doUpdate( selectCriteria, criteria );
    }
View Full Code Here

    public static JobEntry getJob(int oid)
        throws Exception
    {
        JobEntry je = null;

        Criteria c = new Criteria(9);
        c.add(OID,new Integer(oid));

        Vector results = JobEntryPeer.doSelect(c);

        if ( results != null  )
        {
View Full Code Here

            userExists=TurbineSecurity.accountExists(user);
            groupExists=checkExists(group);
            roleExists=checkExists(role);
            if(userExists && groupExists && roleExists)
            {
                Criteria criteria = new Criteria();
                criteria.add(UserGroupRolePeer.USER_ID,
                                      ((BaseObject)user).getPrimaryKey());
                criteria.add(UserGroupRolePeer.GROUP_ID, ((BaseObject)group).getPrimaryKey());
                criteria.add(UserGroupRolePeer.ROLE_ID, ((TurbineRole)role).getPrimaryKey());
                UserGroupRolePeer.doInsert(criteria);
                return;
            }
        }
        catch(Exception e)
View Full Code Here

            userExists=TurbineSecurity.accountExists(user);
            groupExists=checkExists(group);
            roleExists=checkExists(role);
            if(userExists && groupExists && roleExists)
            {
                Criteria criteria = new Criteria();
                criteria.add(UserGroupRolePeer.USER_ID,
                                      ((BaseObject)user).getPrimaryKey());
                criteria.add(UserGroupRolePeer.GROUP_ID,
                                      ((BaseObject)group).getPrimaryKey());
                criteria.add(UserGroupRolePeer.ROLE_ID, ((TurbineRole)role).getPrimaryKey());
                UserGroupRolePeer.doDelete(criteria);
                return;
            }
        }
        catch(Exception e)
View Full Code Here

            lockExclusive();
            roleExists=checkExists(role);
            permissionExists=checkExists(permission);
            if(roleExists && permissionExists)
            {
                Criteria criteria = new Criteria();
                criteria.add(RolePermissionPeer.ROLE_ID, ((TurbineRole)role).getPrimaryKey());
                criteria.add(RolePermissionPeer.PERMISSION_ID,
                                      ((BaseObject)permission).getPrimaryKey());
                UserGroupRolePeer.doInsert(criteria);
                return;
            }
        }
View Full Code Here

            lockExclusive();
            roleExists=checkExists(role);
            permissionExists=checkExists(permission);
            if(roleExists && permissionExists)
            {
                Criteria criteria = new Criteria();
                criteria.add(RolePermissionPeer.ROLE_ID, ((TurbineRole)role).getPrimaryKey());
                criteria.add(RolePermissionPeer.PERMISSION_ID,
                                    ((BaseObject)permission).getPrimaryKey());
                RolePermissionPeer.doDelete(criteria);
                return;
            }
        }
View Full Code Here

     * @return a set of Groups that meet the specified Criteria.
     */
    public GroupSet getGroups( Criteria criteria )
        throws DataBackendException
    {
        Criteria dbCriteria = new Criteria();
        Iterator keys = criteria.keySet().iterator();
        while(keys.hasNext())
        {
            String key = (String)keys.next();
            dbCriteria.put(GroupPeer.getColumnName(key), criteria.get(key));
        }
        Vector groups = new Vector(0);
        try
        {
            groups = GroupPeer.doSelect(criteria);
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.db.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.