com.liferay.portal.service.persistence
Class ResourceUtil

java.lang.Object
  extended by com.liferay.portal.service.persistence.ResourceUtil

public class ResourceUtil
extends java.lang.Object

View Source

Author:
Brian Wing Shun Chan

Constructor Summary
ResourceUtil()
           
 
Method Summary
static void cacheResult(java.util.List<Resource> resources)
           
static void cacheResult(Resource resource)
           
static void clearCache()
           
static int countAll()
           
static int countByC_P(long codeId, java.lang.String primKey)
           
static int countByCodeId(long codeId)
           
static Resource create(long resourceId)
           
static Resource fetchByC_P(long codeId, java.lang.String primKey)
           
static Resource fetchByC_P(long codeId, java.lang.String primKey, boolean retrieveFromCache)
           
static Resource fetchByPrimaryKey(long resourceId)
           
static java.util.List<Resource> findAll()
           
static java.util.List<Resource> findAll(int start, int end)
           
static java.util.List<Resource> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
           
static Resource findByC_P(long codeId, java.lang.String primKey)
           
static Resource findByCodeId_First(long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
           
static Resource findByCodeId_Last(long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
           
static Resource[] findByCodeId_PrevAndNext(long resourceId, long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
           
static java.util.List<Resource> findByCodeId(long codeId)
           
static java.util.List<Resource> findByCodeId(long codeId, int start, int end)
           
static java.util.List<Resource> findByCodeId(long codeId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
           
static Resource findByPrimaryKey(long resourceId)
           
static java.util.List<java.lang.Object> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
           
static java.util.List<java.lang.Object> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end)
           
static ResourcePersistence getPersistence()
           
static Resource remove(long resourceId)
           
static Resource remove(Resource resource)
           
static void removeAll()
           
static void removeByC_P(long codeId, java.lang.String primKey)
           
static void removeByCodeId(long codeId)
           
 void setPersistence(ResourcePersistence persistence)
           
static Resource update(Resource resource)
          Deprecated. Use update(Resource resource, boolean merge).
static Resource update(Resource resource, boolean merge)
          Add, update, or merge, the entity.
static Resource updateImpl(Resource resource, boolean merge)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceUtil

public ResourceUtil()
Method Detail

cacheResult

public static void cacheResult(Resource resource)

cacheResult

public static void cacheResult(java.util.List<Resource> resources)

clearCache

public static void clearCache()

create

public static Resource create(long resourceId)

remove

public static Resource remove(long resourceId)
                       throws NoSuchResourceException,
                              com.liferay.portal.SystemException
Throws:
NoSuchResourceException
com.liferay.portal.SystemException

remove

public static Resource remove(Resource resource)
                       throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

update

public static Resource update(Resource resource)
                       throws com.liferay.portal.SystemException
Deprecated. Use update(Resource resource, boolean merge).

Throws:
com.liferay.portal.SystemException

update

public static Resource update(Resource resource,
                              boolean merge)
                       throws com.liferay.portal.SystemException
Add, update, or merge, the entity. This method also calls the model listeners to trigger the proper events associated with adding, deleting, or updating an entity.

Parameters:
resource - the entity to add, update, or merge
merge - boolean value for whether to merge the entity. The default value is false. Setting merge to true is more expensive and should only be true when resource is transient. See LEP-5473 for a detailed discussion of this method.
Returns:
true if the portlet can be displayed via Ajax
Throws:
com.liferay.portal.SystemException

updateImpl

public static Resource updateImpl(Resource resource,
                                  boolean merge)
                           throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findByPrimaryKey

public static Resource findByPrimaryKey(long resourceId)
                                 throws NoSuchResourceException,
                                        com.liferay.portal.SystemException
Throws:
NoSuchResourceException
com.liferay.portal.SystemException

fetchByPrimaryKey

public static Resource fetchByPrimaryKey(long resourceId)
                                  throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findByCodeId

public static java.util.List<Resource> findByCodeId(long codeId)
                                             throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findByCodeId

public static java.util.List<Resource> findByCodeId(long codeId,
                                                    int start,
                                                    int end)
                                             throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findByCodeId

public static java.util.List<Resource> findByCodeId(long codeId,
                                                    int start,
                                                    int end,
                                                    com.liferay.portal.kernel.util.OrderByComparator obc)
                                             throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findByCodeId_First

public static Resource findByCodeId_First(long codeId,
                                          com.liferay.portal.kernel.util.OrderByComparator obc)
                                   throws NoSuchResourceException,
                                          com.liferay.portal.SystemException
Throws:
NoSuchResourceException
com.liferay.portal.SystemException

findByCodeId_Last

public static Resource findByCodeId_Last(long codeId,
                                         com.liferay.portal.kernel.util.OrderByComparator obc)
                                  throws NoSuchResourceException,
                                         com.liferay.portal.SystemException
Throws:
NoSuchResourceException
com.liferay.portal.SystemException

findByCodeId_PrevAndNext

public static Resource[] findByCodeId_PrevAndNext(long resourceId,
                                                  long codeId,
                                                  com.liferay.portal.kernel.util.OrderByComparator obc)
                                           throws NoSuchResourceException,
                                                  com.liferay.portal.SystemException
Throws:
NoSuchResourceException
com.liferay.portal.SystemException

findByC_P

public static Resource findByC_P(long codeId,
                                 java.lang.String primKey)
                          throws NoSuchResourceException,
                                 com.liferay.portal.SystemException
Throws:
NoSuchResourceException
com.liferay.portal.SystemException

fetchByC_P

public static Resource fetchByC_P(long codeId,
                                  java.lang.String primKey)
                           throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

fetchByC_P

public static Resource fetchByC_P(long codeId,
                                  java.lang.String primKey,
                                  boolean retrieveFromCache)
                           throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findWithDynamicQuery

public static java.util.List<java.lang.Object> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
                                                             throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findWithDynamicQuery

public static java.util.List<java.lang.Object> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
                                                                    int start,
                                                                    int end)
                                                             throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findAll

public static java.util.List<Resource> findAll()
                                        throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findAll

public static java.util.List<Resource> findAll(int start,
                                               int end)
                                        throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

findAll

public static java.util.List<Resource> findAll(int start,
                                               int end,
                                               com.liferay.portal.kernel.util.OrderByComparator obc)
                                        throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

removeByCodeId

public static void removeByCodeId(long codeId)
                           throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

removeByC_P

public static void removeByC_P(long codeId,
                               java.lang.String primKey)
                        throws NoSuchResourceException,
                               com.liferay.portal.SystemException
Throws:
NoSuchResourceException
com.liferay.portal.SystemException

removeAll

public static void removeAll()
                      throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

countByCodeId

public static int countByCodeId(long codeId)
                         throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

countByC_P

public static int countByC_P(long codeId,
                             java.lang.String primKey)
                      throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

countAll

public static int countAll()
                    throws com.liferay.portal.SystemException
Throws:
com.liferay.portal.SystemException

getPersistence

public static ResourcePersistence getPersistence()

setPersistence

public void setPersistence(ResourcePersistence persistence)