Package org.apache.ojb.broker.query

Examples of org.apache.ojb.broker.query.Query


   
    public SSOSite getSite(String siteUrl)
    {
        Criteria filter = new Criteria();
        filter.addEqualTo("siteURL", siteUrl);
        Query query = QueryFactory.newQuery(SSOSiteImpl.class, filter);
        SSOSite site = (SSOSite) getPersistenceBrokerTemplate().getObjectByQuery(query);
        if (site != null)
        {   
            this.mapSite.put(siteUrl, site);
        }
View Full Code Here


    private InternalGroupPrincipal  getGroupPrincipals(String principalFullPath)
    {
        // Get to the backend to return the group that matches the full path
        Criteria filter = new Criteria();
        filter.addEqualTo("fullPath", principalFullPath);
        Query query = QueryFactory.newQuery(InternalGroupPrincipalImpl.class, filter);
        InternalGroupPrincipal group = (InternalGroupPrincipal) getPersistenceBrokerTemplate().getObjectByQuery(query);
        return group;      
    }
View Full Code Here

        }

        Criteria c = new Criteria();
        c.addEqualTo("fullPath", fullPath);
        c.addEqualTo("nodeType", new Integer(nodeType));
        Query query = QueryFactory.newQuery(NodeImpl.class, c);

        Node nodeObj = (Node) getPersistenceBrokerTemplate().getObjectByQuery(query);
        if (null != nodeObj)
        {
          NodeImplProxy proxy = new NodeImplProxy(nodeObj);
View Full Code Here

    {
       
        Criteria c = new Criteria();
        c.addEqualTo("fullPath", fullPath);
        c.addEqualTo("nodeType", new Integer(nodeType));
        Query query = QueryFactory.newQuery(NodeImpl.class, c);

        Node nodeObj = (Node) getPersistenceBrokerTemplate().getObjectByQuery(query);
        if (null != nodeObj)
        {
          proxy.setNode(nodeObj);
View Full Code Here

            return (proxy.getNode() != null);
        }
        Criteria c = new Criteria();
        c.addEqualTo("fullPath", fullPath);
        c.addEqualTo("nodeType", new Integer(nodeType));
        Query query = QueryFactory.newQuery(NodeImpl.class, c);

        Node nodeObj = (Node) getPersistenceBrokerTemplate().getObjectByQuery(query);
        if (null != nodeObj)
        {
          NodeImplProxy proxy = new NodeImplProxy(nodeObj);
View Full Code Here

        }
        // check to see if node exists in persistent store       
        Criteria c = new Criteria();
        c.addEqualTo("fullPath", fullPath);
        c.addEqualTo("nodeType", new Integer(nodeType));
        Query query = QueryFactory.newQuery(NodeImpl.class, c);
        Node nodeObj = (Node) getPersistenceBrokerTemplate().getObjectByQuery(query);
        if (null != nodeObj)
        {
            throw new NodeAlreadyExistsException("Node of type " + nodeType + " already exists at path " + fullPath);
        }
View Full Code Here

            return resolveChildren(hit.getChildren());
        }

        Criteria c = new Criteria();
        c.addEqualTo("parentNodeId", new Long(parentNode.getNodeId()));
        Query query = QueryFactory.newQuery(NodeImpl.class, c);
        Collection children = getPersistenceBrokerTemplate().getCollectionByQuery(query);
        hit.setChildren(cacheChildren(children));
        // null or not
        return children;
    }
View Full Code Here

        }
        if (propertyValue != null)
        {
            c.addEqualTo("nodeProperties.propertyValue", propertyValue);
        }
        Query query = QueryFactory.newQuery(NodeImpl.class, c);
        Collection children = getPersistenceBrokerTemplate().getCollectionByQuery(query);
        Collection proxied = new ArrayList();
        Iterator iter = children.iterator();
        while (iter.hasNext())
        {
View Full Code Here

        int count = 0;
        NodeCache root = null;
        Criteria c = new Criteria();
        c.addLike("fullPath", path + "%");
        //c.addOrderBy("fullPath");
        Query query = QueryFactory.newQuery(NodeImpl.class, c);
        Collection result = getPersistenceBrokerTemplate().getCollectionByQuery(query);
        // TODO: ensure that we always get the first node back first
        if (result == null || result.isEmpty())
        {
            return count;          
View Full Code Here

        Identity oid = new Identity(main1, broker);
        MainObject newMain = (MainObject) broker.getObjectByIdentity(oid);
        assertNull(newMain);
        Criteria crit = new Criteria();
        crit.addLike("name", nameSub);
        Query q = QueryFactory.newQuery(SubObject.class, crit);
        Collection result = broker.getCollectionByQuery(q);
        assertEquals(0, result.size());
    }
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.query.Query

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.