Liferay 6.1.2-ce-ga3

com.liferay.portal.service.persistence
Interface ResourcePersistence

All Superinterfaces:
BasePersistence<Resource>
All Known Implementing Classes:
ResourcePersistenceImpl

public interface ResourcePersistence
extends BasePersistence<Resource>

The persistence interface for the resource service.

Caching information and settings can be found in portal.properties

See Also:
ResourcePersistenceImpl, ResourceUtil
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time it is generated.

Method Summary
 void cacheResult(List<Resource> resources)
          Caches the resources in the entity cache if it is enabled.
 void cacheResult(Resource resource)
          Caches the resource in the entity cache if it is enabled.
 int countAll()
          Returns the number of resources.
 int countByC_P(long codeId, String primKey)
          Returns the number of resources where codeId = ? and primKey = ?.
 int countByCodeId(long codeId)
          Returns the number of resources where codeId = ?.
 int countByPrimKey(String primKey)
          Returns the number of resources where primKey = ?.
 Resource create(long resourceId)
          Creates a new resource with the primary key.
 Resource fetchByC_P(long codeId, String primKey)
          Returns the resource where codeId = ? and primKey = ? or returns null if it could not be found.
 Resource fetchByC_P(long codeId, String primKey, boolean retrieveFromCache)
          Returns the resource where codeId = ? and primKey = ? or returns null if it could not be found, optionally using the finder cache.
 Resource fetchByCodeId_First(long codeId, OrderByComparator orderByComparator)
          Returns the first resource in the ordered set where codeId = ?.
 Resource fetchByCodeId_Last(long codeId, OrderByComparator orderByComparator)
          Returns the last resource in the ordered set where codeId = ?.
 Resource fetchByPrimaryKey(long resourceId)
          Returns the resource with the primary key or returns null if it could not be found.
 Resource fetchByPrimKey_First(String primKey, OrderByComparator orderByComparator)
          Returns the first resource in the ordered set where primKey = ?.
 Resource fetchByPrimKey_Last(String primKey, OrderByComparator orderByComparator)
          Returns the last resource in the ordered set where primKey = ?.
 List<Resource> findAll()
          Returns all the resources.
 List<Resource> findAll(int start, int end)
          Returns a range of all the resources.
 List<Resource> findAll(int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the resources.
 Resource findByC_P(long codeId, String primKey)
          Returns the resource where codeId = ? and primKey = ? or throws a NoSuchResourceException if it could not be found.
 Resource findByCodeId_First(long codeId, OrderByComparator orderByComparator)
          Returns the first resource in the ordered set where codeId = ?.
 Resource findByCodeId_Last(long codeId, OrderByComparator orderByComparator)
          Returns the last resource in the ordered set where codeId = ?.
 Resource[] findByCodeId_PrevAndNext(long resourceId, long codeId, OrderByComparator orderByComparator)
          Returns the resources before and after the current resource in the ordered set where codeId = ?.
 List<Resource> findByCodeId(long codeId)
          Returns all the resources where codeId = ?.
 List<Resource> findByCodeId(long codeId, int start, int end)
          Returns a range of all the resources where codeId = ?.
 List<Resource> findByCodeId(long codeId, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the resources where codeId = ?.
 Resource findByPrimaryKey(long resourceId)
          Returns the resource with the primary key or throws a NoSuchResourceException if it could not be found.
 Resource findByPrimKey_First(String primKey, OrderByComparator orderByComparator)
          Returns the first resource in the ordered set where primKey = ?.
 Resource findByPrimKey_Last(String primKey, OrderByComparator orderByComparator)
          Returns the last resource in the ordered set where primKey = ?.
 Resource[] findByPrimKey_PrevAndNext(long resourceId, String primKey, OrderByComparator orderByComparator)
          Returns the resources before and after the current resource in the ordered set where primKey = ?.
 List<Resource> findByPrimKey(String primKey)
          Returns all the resources where primKey = ?.
 List<Resource> findByPrimKey(String primKey, int start, int end)
          Returns a range of all the resources where primKey = ?.
 List<Resource> findByPrimKey(String primKey, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the resources where primKey = ?.
 Resource remove(long resourceId)
          Removes the resource with the primary key from the database.
 void removeAll()
          Removes all the resources from the database.
 Resource removeByC_P(long codeId, String primKey)
          Removes the resource where codeId = ? and primKey = ? from the database.
 void removeByCodeId(long codeId)
          Removes all the resources where codeId = ? from the database.
 void removeByPrimKey(String primKey)
          Removes all the resources where primKey = ? from the database.
 Resource updateImpl(Resource resource, boolean merge)
           
 
Methods inherited from interface com.liferay.portal.service.persistence.BasePersistence
clearCache, clearCache, clearCache, closeSession, countWithDynamicQuery, fetchByPrimaryKey, findByPrimaryKey, findWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, getDataSource, getListeners, openSession, processException, registerListener, remove, remove, setDataSource, unregisterListener, update, update
 

Method Detail

cacheResult

void cacheResult(Resource resource)
Caches the resource in the entity cache if it is enabled.

Parameters:
resource - the resource

cacheResult

void cacheResult(List<Resource> resources)
Caches the resources in the entity cache if it is enabled.

Parameters:
resources - the resources

create

Resource create(long resourceId)
Creates a new resource with the primary key. Does not add the resource to the database.

Parameters:
resourceId - the primary key for the new resource
Returns:
the new resource

remove

Resource remove(long resourceId)
                throws NoSuchResourceException,
                       SystemException
Removes the resource with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
resourceId - the primary key of the resource
Returns:
the resource that was removed
Throws:
NoSuchResourceException - if a resource with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

Resource updateImpl(Resource resource,
                    boolean merge)
                    throws SystemException
Throws:
SystemException

findByPrimaryKey

Resource findByPrimaryKey(long resourceId)
                          throws NoSuchResourceException,
                                 SystemException
Returns the resource with the primary key or throws a NoSuchResourceException if it could not be found.

Parameters:
resourceId - the primary key of the resource
Returns:
the resource
Throws:
NoSuchResourceException - if a resource with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

Resource fetchByPrimaryKey(long resourceId)
                           throws SystemException
Returns the resource with the primary key or returns null if it could not be found.

Parameters:
resourceId - the primary key of the resource
Returns:
the resource, or null if a resource with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findByCodeId

List<Resource> findByCodeId(long codeId)
                            throws SystemException
Returns all the resources where codeId = ?.

Parameters:
codeId - the code ID
Returns:
the matching resources
Throws:
SystemException - if a system exception occurred

findByCodeId

List<Resource> findByCodeId(long codeId,
                            int start,
                            int end)
                            throws SystemException
Returns a range of all the resources where codeId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
codeId - the code ID
start - the lower bound of the range of resources
end - the upper bound of the range of resources (not inclusive)
Returns:
the range of matching resources
Throws:
SystemException - if a system exception occurred

findByCodeId

List<Resource> findByCodeId(long codeId,
                            int start,
                            int end,
                            OrderByComparator orderByComparator)
                            throws SystemException
Returns an ordered range of all the resources where codeId = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
codeId - the code ID
start - the lower bound of the range of resources
end - the upper bound of the range of resources (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching resources
Throws:
SystemException - if a system exception occurred

findByCodeId_First

Resource findByCodeId_First(long codeId,
                            OrderByComparator orderByComparator)
                            throws NoSuchResourceException,
                                   SystemException
Returns the first resource in the ordered set where codeId = ?.

Parameters:
codeId - the code ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching resource
Throws:
NoSuchResourceException - if a matching resource could not be found
SystemException - if a system exception occurred

fetchByCodeId_First

Resource fetchByCodeId_First(long codeId,
                             OrderByComparator orderByComparator)
                             throws SystemException
Returns the first resource in the ordered set where codeId = ?.

Parameters:
codeId - the code ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching resource, or null if a matching resource could not be found
Throws:
SystemException - if a system exception occurred

findByCodeId_Last

Resource findByCodeId_Last(long codeId,
                           OrderByComparator orderByComparator)
                           throws NoSuchResourceException,
                                  SystemException
Returns the last resource in the ordered set where codeId = ?.

Parameters:
codeId - the code ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching resource
Throws:
NoSuchResourceException - if a matching resource could not be found
SystemException - if a system exception occurred

fetchByCodeId_Last

Resource fetchByCodeId_Last(long codeId,
                            OrderByComparator orderByComparator)
                            throws SystemException
Returns the last resource in the ordered set where codeId = ?.

Parameters:
codeId - the code ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching resource, or null if a matching resource could not be found
Throws:
SystemException - if a system exception occurred

findByCodeId_PrevAndNext

Resource[] findByCodeId_PrevAndNext(long resourceId,
                                    long codeId,
                                    OrderByComparator orderByComparator)
                                    throws NoSuchResourceException,
                                           SystemException
Returns the resources before and after the current resource in the ordered set where codeId = ?.

Parameters:
resourceId - the primary key of the current resource
codeId - the code ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next resource
Throws:
NoSuchResourceException - if a resource with the primary key could not be found
SystemException - if a system exception occurred

findByPrimKey

List<Resource> findByPrimKey(String primKey)
                             throws SystemException
Returns all the resources where primKey = ?.

Parameters:
primKey - the prim key
Returns:
the matching resources
Throws:
SystemException - if a system exception occurred

findByPrimKey

List<Resource> findByPrimKey(String primKey,
                             int start,
                             int end)
                             throws SystemException
Returns a range of all the resources where primKey = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
primKey - the prim key
start - the lower bound of the range of resources
end - the upper bound of the range of resources (not inclusive)
Returns:
the range of matching resources
Throws:
SystemException - if a system exception occurred

findByPrimKey

List<Resource> findByPrimKey(String primKey,
                             int start,
                             int end,
                             OrderByComparator orderByComparator)
                             throws SystemException
Returns an ordered range of all the resources where primKey = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
primKey - the prim key
start - the lower bound of the range of resources
end - the upper bound of the range of resources (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching resources
Throws:
SystemException - if a system exception occurred

findByPrimKey_First

Resource findByPrimKey_First(String primKey,
                             OrderByComparator orderByComparator)
                             throws NoSuchResourceException,
                                    SystemException
Returns the first resource in the ordered set where primKey = ?.

Parameters:
primKey - the prim key
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching resource
Throws:
NoSuchResourceException - if a matching resource could not be found
SystemException - if a system exception occurred

fetchByPrimKey_First

Resource fetchByPrimKey_First(String primKey,
                              OrderByComparator orderByComparator)
                              throws SystemException
Returns the first resource in the ordered set where primKey = ?.

Parameters:
primKey - the prim key
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching resource, or null if a matching resource could not be found
Throws:
SystemException - if a system exception occurred

findByPrimKey_Last

Resource findByPrimKey_Last(String primKey,
                            OrderByComparator orderByComparator)
                            throws NoSuchResourceException,
                                   SystemException
Returns the last resource in the ordered set where primKey = ?.

Parameters:
primKey - the prim key
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching resource
Throws:
NoSuchResourceException - if a matching resource could not be found
SystemException - if a system exception occurred

fetchByPrimKey_Last

Resource fetchByPrimKey_Last(String primKey,
                             OrderByComparator orderByComparator)
                             throws SystemException
Returns the last resource in the ordered set where primKey = ?.

Parameters:
primKey - the prim key
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching resource, or null if a matching resource could not be found
Throws:
SystemException - if a system exception occurred

findByPrimKey_PrevAndNext

Resource[] findByPrimKey_PrevAndNext(long resourceId,
                                     String primKey,
                                     OrderByComparator orderByComparator)
                                     throws NoSuchResourceException,
                                            SystemException
Returns the resources before and after the current resource in the ordered set where primKey = ?.

Parameters:
resourceId - the primary key of the current resource
primKey - the prim key
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next resource
Throws:
NoSuchResourceException - if a resource with the primary key could not be found
SystemException - if a system exception occurred

findByC_P

Resource findByC_P(long codeId,
                   String primKey)
                   throws NoSuchResourceException,
                          SystemException
Returns the resource where codeId = ? and primKey = ? or throws a NoSuchResourceException if it could not be found.

Parameters:
codeId - the code ID
primKey - the prim key
Returns:
the matching resource
Throws:
NoSuchResourceException - if a matching resource could not be found
SystemException - if a system exception occurred

fetchByC_P

Resource fetchByC_P(long codeId,
                    String primKey)
                    throws SystemException
Returns the resource where codeId = ? and primKey = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
codeId - the code ID
primKey - the prim key
Returns:
the matching resource, or null if a matching resource could not be found
Throws:
SystemException - if a system exception occurred

fetchByC_P

Resource fetchByC_P(long codeId,
                    String primKey,
                    boolean retrieveFromCache)
                    throws SystemException
Returns the resource where codeId = ? and primKey = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
codeId - the code ID
primKey - the prim key
retrieveFromCache - whether to use the finder cache
Returns:
the matching resource, or null if a matching resource could not be found
Throws:
SystemException - if a system exception occurred

findAll

List<Resource> findAll()
                       throws SystemException
Returns all the resources.

Returns:
the resources
Throws:
SystemException - if a system exception occurred

findAll

List<Resource> findAll(int start,
                       int end)
                       throws SystemException
Returns a range of all the resources.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of resources
end - the upper bound of the range of resources (not inclusive)
Returns:
the range of resources
Throws:
SystemException - if a system exception occurred

findAll

List<Resource> findAll(int start,
                       int end,
                       OrderByComparator orderByComparator)
                       throws SystemException
Returns an ordered range of all the resources.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of resources
end - the upper bound of the range of resources (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of resources
Throws:
SystemException - if a system exception occurred

removeByCodeId

void removeByCodeId(long codeId)
                    throws SystemException
Removes all the resources where codeId = ? from the database.

Parameters:
codeId - the code ID
Throws:
SystemException - if a system exception occurred

removeByPrimKey

void removeByPrimKey(String primKey)
                     throws SystemException
Removes all the resources where primKey = ? from the database.

Parameters:
primKey - the prim key
Throws:
SystemException - if a system exception occurred

removeByC_P

Resource removeByC_P(long codeId,
                     String primKey)
                     throws NoSuchResourceException,
                            SystemException
Removes the resource where codeId = ? and primKey = ? from the database.

Parameters:
codeId - the code ID
primKey - the prim key
Returns:
the resource that was removed
Throws:
SystemException - if a system exception occurred
NoSuchResourceException

removeAll

void removeAll()
               throws SystemException
Removes all the resources from the database.

Throws:
SystemException - if a system exception occurred

countByCodeId

int countByCodeId(long codeId)
                  throws SystemException
Returns the number of resources where codeId = ?.

Parameters:
codeId - the code ID
Returns:
the number of matching resources
Throws:
SystemException - if a system exception occurred

countByPrimKey

int countByPrimKey(String primKey)
                   throws SystemException
Returns the number of resources where primKey = ?.

Parameters:
primKey - the prim key
Returns:
the number of matching resources
Throws:
SystemException - if a system exception occurred

countByC_P

int countByC_P(long codeId,
               String primKey)
               throws SystemException
Returns the number of resources where codeId = ? and primKey = ?.

Parameters:
codeId - the code ID
primKey - the prim key
Returns:
the number of matching resources
Throws:
SystemException - if a system exception occurred

countAll

int countAll()
             throws SystemException
Returns the number of resources.

Returns:
the number of resources
Throws:
SystemException - if a system exception occurred

Liferay 6.1.2-ce-ga3