Package org.apache.turbine.util.db

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


            {
                scheduleQueue = new JobQueue();
                mainLoop = new MainLoop();

                // Load all from cold storage.
                Vector jobs  = JobEntryPeer.doSelect(new Criteria());

                if ( jobs != null && jobs.size() > 0 )
                {
                    scheduleQueue.batchLoad(jobs);
                    restart();
View Full Code Here


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

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

        throws Exception
    {
        // First remove from DB.
        try
        {
            Criteria c = new Criteria()
                .add(JobEntryPeer.OID, je.getPrimaryKey());

            JobEntryPeer.doDelete(c);
        }
        catch(Exception ouch)
View Full Code Here

        try
        {
            groupExists = checkExists(group);
            if(groupExists)
            {
                Criteria criteria = GroupPeer.buildCriteria(group);
                GroupPeer.doUpdate(criteria);
            }
        }
        catch(Exception e)
        {
View Full Code Here

        try
        {
            roleExists = checkExists(role);
            if(roleExists)
            {
                Criteria criteria = RolePeer.buildCriteria(role);
                RolePeer.doUpdate(criteria);
            }
        }
        catch(Exception e)
        {
View Full Code Here

        try
        {
            permissionExists = checkExists(permission);
            if(permissionExists)
            {
                Criteria criteria = PermissionPeer.buildCriteria(permission);
                PermissionPeer.doUpdate(criteria);
            }
        }
        catch(Exception e)
        {
View Full Code Here

            lockExclusive();
            groupExists = checkExists(group);
            if(!groupExists)
            {
                // add a row to the table
                Criteria criteria = GroupPeer.buildCriteria(group);
                GroupPeer.doInsert(criteria);
                // try to get the object back using the name as key.
                criteria = new Criteria();
                criteria.add(GroupPeer.NAME, ((SecurityObject)group).getName());
                Vector results = GroupPeer.doSelect(criteria);
                if(results.size() != 1)
                {
                    throw new DataBackendException(
                        "Internal error - query returned " +
View Full Code Here

            lockExclusive();
            roleExists = checkExists(role);
            if(!roleExists)
            {
                // add a row to the table
                Criteria criteria = RolePeer.buildCriteria(role);
                RolePeer.doInsert(criteria);
                // try to get the object back using the name as key.
                criteria = new Criteria();
                criteria.add(RolePeer.NAME, role.getName());
                Vector results = RolePeer.doSelect(criteria);
                if(results.size() != 1)
                {
                    throw new DataBackendException(
                        "Internal error - query returned " +
View Full Code Here

            lockExclusive();
            permissionExists = checkExists(permission);
            if(!permissionExists)
            {
                // add a row to the table
                Criteria criteria = PermissionPeer.buildCriteria(permission);
                PermissionPeer.doInsert(criteria);
                // try to get the object back using the name as key.
                criteria = new Criteria();
                criteria.add(PermissionPeer.NAME,
                    ((SecurityObject)permission).getName());
                Vector results = PermissionPeer.doSelect(criteria);
                if(results.size() != 1)
                {
                    throw new DataBackendException(
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.