Package org.apache.jetspeed.components.persistence.store

Examples of org.apache.jetspeed.components.persistence.store.Filter


        else
        {
            PersistenceStore store = getPersistenceStore();
            prepareTransaction(store);

            Filter filter = store.newFilter();
            filter.addEqualTo("id", entityId.toString());
            Object q = store.newQuery(PortletEntityImpl.class, filter);
            MutablePortletEntity portletEntity = (MutablePortletEntity) store.getObjectByQuery(q);
            if (portletEntity == null)
            {
                return null;
View Full Code Here


    }

    public Collection getPortletEntities( PortletDefinition portletDefinition )
    {
        prepareTransaction(persistenceStore);
        Filter filter = persistenceStore.newFilter();
        String appName = ((MutablePortletApplication) portletDefinition.getPortletApplicationDefinition()).getName();
        String portletName = portletDefinition.getName();
        filter.addEqualTo("appName", appName);
        filter.addEqualTo("portletName", portletName);

        return persistenceStore.getCollectionByQuery(persistenceStore.newQuery(PortletEntityImpl.class, filter));
    }
View Full Code Here

        {
            return (Page) pageCache.get(id);
        }
        else
        {
            Filter filter = persistenceStore.newFilter();
            filter.addEqualTo("id", id);
            Object q = persistenceStore.newQuery(pageClass, filter);
            persistenceStore.getTransaction().begin();
            Page page = (Page) persistenceStore.getObjectByQuery(q);
            if (page == null)
            {
View Full Code Here

     * @param lcokLevel
     * @return
     */
    public Collection getExtent(Class clazz, int lockLevel)
    {
        Filter filter = newFilter();
        Object query = newQuery(clazz, filter);
        return getCollectionByQuery(query, lockLevel);
    }
View Full Code Here

    public void setRuleForPrincipal(Principal principal, ProfilingRule rule, String locatorName)
    {
        Transaction tx = persistentStore.getTransaction();
        tx.begin();
 
        Filter filter = persistentStore.newFilter();
        filter.addEqualTo("principalName", principal);
        filter.addEqualTo("locatorName", locatorName);
        Object query = persistentStore.newQuery(principalRuleClass, filter);
        PrincipalRule pr = (PrincipalRule) persistentStore.getObjectByQuery(query);
        if (pr == null)
        {
            pr = new PrincipalRuleImpl(); // TODO: factory
View Full Code Here

        PrincipalRule pr = (PrincipalRule) principalRules.get(makePrincipalRuleKey(principal, locatorName));
        if (pr != null)
        {
            return pr;
        }
        Filter filter = persistentStore.newFilter();       
        filter.addEqualTo("principalName", principal);
        filter.addEqualTo("locatorName", locatorName);       
        Object query = persistentStore.newQuery(principalRuleClass, filter);
        pr = (PrincipalRule) persistentStore.getObjectByQuery(query);
        principalRules.put(makePrincipalRuleKey(principal, locatorName), pr);
        return pr;
    }
View Full Code Here

     *         not found.
     */
    private ProfilingRule lookupProfilingRule( String ruleid )
    {
        // TODO: implement caching
        Filter filter = persistentStore.newFilter();
        Object query = persistentStore.newQuery(profilingRuleClass, filter);
        ProfilingRule rule = (ProfilingRule) persistentStore.getObjectByQuery(query);
        return rule;
    }
View Full Code Here

     *
     * @see org.apache.jetspeed.profiler.ProfilerService#getRule(java.lang.String)
     */
    public ProfilingRule getRule( String id )
    {
        Filter filter = persistentStore.newFilter();
        filter.addEqualTo("id", id);
        Object query = persistentStore.newQuery(profilingRuleClass, filter);
        return (ProfilingRule) persistentStore.getObjectByQuery(query);
    }
View Full Code Here

        return this.anonymousUser;
    }

    public String[] getLocatorNamesForPrincipal(Principal principal)
    {
        Filter filter = persistentStore.newFilter();       
        filter.addEqualTo("principalName", principal.getName());
        Object query = persistentStore.newQuery(principalRuleClass, filter);
        Collection result = persistentStore.getCollectionByQuery(query);
        if (result.size() == 0)
        {
            return new String[]{};
View Full Code Here

        return names;
    }
   
    public Collection getRulesForPrincipal(Principal principal)
    {
        Filter filter = persistentStore.newFilter();       
        filter.addEqualTo("principalName", principal.getName());
        Object query = persistentStore.newQuery(principalRuleClass, filter);
        Collection result = persistentStore.getCollectionByQuery(query);
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.components.persistence.store.Filter

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.