Package org.apache.torque.util

Examples of org.apache.torque.util.Criteria


     * @param role object to build the criteria
     * @return the Criteria
     */
    public static Criteria buildCriteria(Role role)
    {
        Criteria criteria = new Criteria();
        if (!((BaseObject) role).isNew())
        {
            criteria.add(ROLE_ID, ((BaseObject) role).getPrimaryKey());
        }
        criteria.add(NAME, role.getName());
        // causing the removal and updating of roles to
        // crap out because of the generated SQL.
        //criteria.add(OBJECTDATA, role.getAttributes());
        return criteria;
    }
View Full Code Here


     * @exception TorqueException a generic exception.
     */
    public static void doUpdate(Criteria criteria)
        throws TorqueException
    {
        Criteria selectCriteria = new Criteria(2);
        selectCriteria.put(ROLE_ID, criteria.remove(ROLE_ID));
        BasePeer.doUpdate(selectCriteria, 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(ROLE_ID);
        criteria.add(NAME, role.getName());
        List results = BasePeer.doSelect(criteria);
        if (results.size() > 1)
        {
            throw new DataBackendException("Multiple roles named '"
                    + role.getName() + "' exist!");
View Full Code Here

            setEnabled(getConfiguration().getBoolean("enabled", true));
            scheduleQueue = new JobQueue();
            mainLoop = new MainLoop();

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

            if (jobs != null && jobs.size() > 0)
            {
                Iterator it = jobs.iterator();
                while (it.hasNext())
View Full Code Here

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

            // Remove from the queue.
            scheduleQueue.remove(je);
View Full Code Here

     *         data backend.
     */
    public GroupSet getAllGroups()
            throws DataBackendException
    {
        return getGroups(new Criteria());
    }
View Full Code Here

     *         data backend.
     */
    public RoleSet getAllRoles()
            throws DataBackendException
    {
        return getRoles(new Criteria());
    }
View Full Code Here

     *         data backend.
     */
    public PermissionSet getAllPermissions()
            throws DataBackendException
    {
        return getPermissions(new Criteria());
    }
View Full Code Here

     * @return A GroupSet.
     * @exception Exception a generic exception.
     */
    public static GroupSet retrieveSet() throws Exception
    {
        return retrieveSet(new Criteria());
    }
View Full Code Here

     * @exception TorqueException a generic exception.
     */
    public static void doUpdate(Criteria criteria)
        throws TorqueException
    {
        Criteria selectCriteria = new Criteria(2);
        selectCriteria.put(GROUP_ID, criteria.remove(GROUP_ID));
        BasePeer.doUpdate(selectCriteria, criteria);
    }
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.