Liferay 6.1.2-ce-ga3

com.liferay.portal.service.persistence
Class ResourceCodeUtil

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

public class ResourceCodeUtil
extends Object

The persistence utility for the resource code service. This utility wraps ResourceCodePersistenceImpl and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.

Caching information and settings can be found in portal.properties

See Also:
ResourceCodePersistence, ResourceCodePersistenceImpl

Constructor Summary
ResourceCodeUtil()
           
 
Method Summary
static void cacheResult(List<ResourceCode> resourceCodes)
          Caches the resource codes in the entity cache if it is enabled.
static void cacheResult(ResourceCode resourceCode)
          Caches the resource code in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(ResourceCode resourceCode)
           
static int countAll()
          Returns the number of resource codes.
static int countByC_N_S(long companyId, String name, int scope)
          Returns the number of resource codes where companyId = ? and name = ? and scope = ?.
static int countByCompanyId(long companyId)
          Returns the number of resource codes where companyId = ?.
static int countByName(String name)
          Returns the number of resource codes where name = ?.
 long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static ResourceCode create(long codeId)
          Creates a new resource code with the primary key.
static ResourceCode fetchByC_N_S(long companyId, String name, int scope)
          Returns the resource code where companyId = ? and name = ? and scope = ? or returns null if it could not be found.
static ResourceCode fetchByC_N_S(long companyId, String name, int scope, boolean retrieveFromCache)
          Returns the resource code where companyId = ? and name = ? and scope = ? or returns null if it could not be found, optionally using the finder cache.
static ResourceCode fetchByCompanyId_First(long companyId, OrderByComparator orderByComparator)
          Returns the first resource code in the ordered set where companyId = ?.
static ResourceCode fetchByCompanyId_Last(long companyId, OrderByComparator orderByComparator)
          Returns the last resource code in the ordered set where companyId = ?.
static ResourceCode fetchByName_First(String name, OrderByComparator orderByComparator)
          Returns the first resource code in the ordered set where name = ?.
static ResourceCode fetchByName_Last(String name, OrderByComparator orderByComparator)
          Returns the last resource code in the ordered set where name = ?.
static ResourceCode fetchByPrimaryKey(long codeId)
          Returns the resource code with the primary key or returns null if it could not be found.
static List<ResourceCode> findAll()
          Returns all the resource codes.
static List<ResourceCode> findAll(int start, int end)
          Returns a range of all the resource codes.
static List<ResourceCode> findAll(int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the resource codes.
static ResourceCode findByC_N_S(long companyId, String name, int scope)
          Returns the resource code where companyId = ? and name = ? and scope = ? or throws a NoSuchResourceCodeException if it could not be found.
static ResourceCode findByCompanyId_First(long companyId, OrderByComparator orderByComparator)
          Returns the first resource code in the ordered set where companyId = ?.
static ResourceCode findByCompanyId_Last(long companyId, OrderByComparator orderByComparator)
          Returns the last resource code in the ordered set where companyId = ?.
static ResourceCode[] findByCompanyId_PrevAndNext(long codeId, long companyId, OrderByComparator orderByComparator)
          Returns the resource codes before and after the current resource code in the ordered set where companyId = ?.
static List<ResourceCode> findByCompanyId(long companyId)
          Returns all the resource codes where companyId = ?.
static List<ResourceCode> findByCompanyId(long companyId, int start, int end)
          Returns a range of all the resource codes where companyId = ?.
static List<ResourceCode> findByCompanyId(long companyId, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the resource codes where companyId = ?.
static ResourceCode findByName_First(String name, OrderByComparator orderByComparator)
          Returns the first resource code in the ordered set where name = ?.
static ResourceCode findByName_Last(String name, OrderByComparator orderByComparator)
          Returns the last resource code in the ordered set where name = ?.
static ResourceCode[] findByName_PrevAndNext(long codeId, String name, OrderByComparator orderByComparator)
          Returns the resource codes before and after the current resource code in the ordered set where name = ?.
static List<ResourceCode> findByName(String name)
          Returns all the resource codes where name = ?.
static List<ResourceCode> findByName(String name, int start, int end)
          Returns a range of all the resource codes where name = ?.
static List<ResourceCode> findByName(String name, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the resource codes where name = ?.
static ResourceCode findByPrimaryKey(long codeId)
          Returns the resource code with the primary key or throws a NoSuchResourceCodeException if it could not be found.
static List<ResourceCode> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<ResourceCode> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<ResourceCode> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
           
static ResourceCodePersistence getPersistence()
           
static ResourceCode remove(long codeId)
          Removes the resource code with the primary key from the database.
static void removeAll()
          Removes all the resource codes from the database.
static ResourceCode removeByC_N_S(long companyId, String name, int scope)
          Removes the resource code where companyId = ? and name = ? and scope = ? from the database.
static void removeByCompanyId(long companyId)
          Removes all the resource codes where companyId = ? from the database.
static void removeByName(String name)
          Removes all the resource codes where name = ? from the database.
 void setPersistence(ResourceCodePersistence persistence)
          Deprecated.  
static ResourceCode update(ResourceCode resourceCode, boolean merge)
           
static ResourceCode update(ResourceCode resourceCode, boolean merge, ServiceContext serviceContext)
           
static ResourceCode updateImpl(ResourceCode resourceCode, boolean merge)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCodeUtil

public ResourceCodeUtil()
Method Detail

clearCache

public static void clearCache()
See Also:
BasePersistence.clearCache()

clearCache

public static void clearCache(ResourceCode resourceCode)
See Also:
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)

countWithDynamicQuery

public long countWithDynamicQuery(DynamicQuery dynamicQuery)
                           throws SystemException
Throws:
SystemException
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<ResourceCode> findWithDynamicQuery(DynamicQuery dynamicQuery)
                                               throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<ResourceCode> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                      int start,
                                                      int end)
                                               throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)

findWithDynamicQuery

public static List<ResourceCode> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                      int start,
                                                      int end,
                                                      OrderByComparator orderByComparator)
                                               throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)

update

public static ResourceCode update(ResourceCode resourceCode,
                                  boolean merge)
                           throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean)

update

public static ResourceCode update(ResourceCode resourceCode,
                                  boolean merge,
                                  ServiceContext serviceContext)
                           throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)

cacheResult

public static void cacheResult(ResourceCode resourceCode)
Caches the resource code in the entity cache if it is enabled.

Parameters:
resourceCode - the resource code

cacheResult

public static void cacheResult(List<ResourceCode> resourceCodes)
Caches the resource codes in the entity cache if it is enabled.

Parameters:
resourceCodes - the resource codes

create

public static ResourceCode create(long codeId)
Creates a new resource code with the primary key. Does not add the resource code to the database.

Parameters:
codeId - the primary key for the new resource code
Returns:
the new resource code

remove

public static ResourceCode remove(long codeId)
                           throws NoSuchResourceCodeException,
                                  SystemException
Removes the resource code with the primary key from the database. Also notifies the appropriate model listeners.

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

updateImpl

public static ResourceCode updateImpl(ResourceCode resourceCode,
                                      boolean merge)
                               throws SystemException
Throws:
SystemException

findByPrimaryKey

public static ResourceCode findByPrimaryKey(long codeId)
                                     throws NoSuchResourceCodeException,
                                            SystemException
Returns the resource code with the primary key or throws a NoSuchResourceCodeException if it could not be found.

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

fetchByPrimaryKey

public static ResourceCode fetchByPrimaryKey(long codeId)
                                      throws SystemException
Returns the resource code with the primary key or returns null if it could not be found.

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

findByCompanyId

public static List<ResourceCode> findByCompanyId(long companyId)
                                          throws SystemException
Returns all the resource codes where companyId = ?.

Parameters:
companyId - the company ID
Returns:
the matching resource codes
Throws:
SystemException - if a system exception occurred

findByCompanyId

public static List<ResourceCode> findByCompanyId(long companyId,
                                                 int start,
                                                 int end)
                                          throws SystemException
Returns a range of all the resource codes where companyId = ?.

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:
companyId - the company ID
start - the lower bound of the range of resource codes
end - the upper bound of the range of resource codes (not inclusive)
Returns:
the range of matching resource codes
Throws:
SystemException - if a system exception occurred

findByCompanyId

public static List<ResourceCode> findByCompanyId(long companyId,
                                                 int start,
                                                 int end,
                                                 OrderByComparator orderByComparator)
                                          throws SystemException
Returns an ordered range of all the resource codes where companyId = ?.

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:
companyId - the company ID
start - the lower bound of the range of resource codes
end - the upper bound of the range of resource codes (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching resource codes
Throws:
SystemException - if a system exception occurred

findByCompanyId_First

public static ResourceCode findByCompanyId_First(long companyId,
                                                 OrderByComparator orderByComparator)
                                          throws NoSuchResourceCodeException,
                                                 SystemException
Returns the first resource code in the ordered set where companyId = ?.

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

fetchByCompanyId_First

public static ResourceCode fetchByCompanyId_First(long companyId,
                                                  OrderByComparator orderByComparator)
                                           throws SystemException
Returns the first resource code in the ordered set where companyId = ?.

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

findByCompanyId_Last

public static ResourceCode findByCompanyId_Last(long companyId,
                                                OrderByComparator orderByComparator)
                                         throws NoSuchResourceCodeException,
                                                SystemException
Returns the last resource code in the ordered set where companyId = ?.

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

fetchByCompanyId_Last

public static ResourceCode fetchByCompanyId_Last(long companyId,
                                                 OrderByComparator orderByComparator)
                                          throws SystemException
Returns the last resource code in the ordered set where companyId = ?.

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

findByCompanyId_PrevAndNext

public static ResourceCode[] findByCompanyId_PrevAndNext(long codeId,
                                                         long companyId,
                                                         OrderByComparator orderByComparator)
                                                  throws NoSuchResourceCodeException,
                                                         SystemException
Returns the resource codes before and after the current resource code in the ordered set where companyId = ?.

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

findByName

public static List<ResourceCode> findByName(String name)
                                     throws SystemException
Returns all the resource codes where name = ?.

Parameters:
name - the name
Returns:
the matching resource codes
Throws:
SystemException - if a system exception occurred

findByName

public static List<ResourceCode> findByName(String name,
                                            int start,
                                            int end)
                                     throws SystemException
Returns a range of all the resource codes where name = ?.

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:
name - the name
start - the lower bound of the range of resource codes
end - the upper bound of the range of resource codes (not inclusive)
Returns:
the range of matching resource codes
Throws:
SystemException - if a system exception occurred

findByName

public static List<ResourceCode> findByName(String name,
                                            int start,
                                            int end,
                                            OrderByComparator orderByComparator)
                                     throws SystemException
Returns an ordered range of all the resource codes where name = ?.

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:
name - the name
start - the lower bound of the range of resource codes
end - the upper bound of the range of resource codes (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching resource codes
Throws:
SystemException - if a system exception occurred

findByName_First

public static ResourceCode findByName_First(String name,
                                            OrderByComparator orderByComparator)
                                     throws NoSuchResourceCodeException,
                                            SystemException
Returns the first resource code in the ordered set where name = ?.

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

fetchByName_First

public static ResourceCode fetchByName_First(String name,
                                             OrderByComparator orderByComparator)
                                      throws SystemException
Returns the first resource code in the ordered set where name = ?.

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

findByName_Last

public static ResourceCode findByName_Last(String name,
                                           OrderByComparator orderByComparator)
                                    throws NoSuchResourceCodeException,
                                           SystemException
Returns the last resource code in the ordered set where name = ?.

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

fetchByName_Last

public static ResourceCode fetchByName_Last(String name,
                                            OrderByComparator orderByComparator)
                                     throws SystemException
Returns the last resource code in the ordered set where name = ?.

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

findByName_PrevAndNext

public static ResourceCode[] findByName_PrevAndNext(long codeId,
                                                    String name,
                                                    OrderByComparator orderByComparator)
                                             throws NoSuchResourceCodeException,
                                                    SystemException
Returns the resource codes before and after the current resource code in the ordered set where name = ?.

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

findByC_N_S

public static ResourceCode findByC_N_S(long companyId,
                                       String name,
                                       int scope)
                                throws NoSuchResourceCodeException,
                                       SystemException
Returns the resource code where companyId = ? and name = ? and scope = ? or throws a NoSuchResourceCodeException if it could not be found.

Parameters:
companyId - the company ID
name - the name
scope - the scope
Returns:
the matching resource code
Throws:
NoSuchResourceCodeException - if a matching resource code could not be found
SystemException - if a system exception occurred

fetchByC_N_S

public static ResourceCode fetchByC_N_S(long companyId,
                                        String name,
                                        int scope)
                                 throws SystemException
Returns the resource code where companyId = ? and name = ? and scope = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
companyId - the company ID
name - the name
scope - the scope
Returns:
the matching resource code, or null if a matching resource code could not be found
Throws:
SystemException - if a system exception occurred

fetchByC_N_S

public static ResourceCode fetchByC_N_S(long companyId,
                                        String name,
                                        int scope,
                                        boolean retrieveFromCache)
                                 throws SystemException
Returns the resource code where companyId = ? and name = ? and scope = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
companyId - the company ID
name - the name
scope - the scope
retrieveFromCache - whether to use the finder cache
Returns:
the matching resource code, or null if a matching resource code could not be found
Throws:
SystemException - if a system exception occurred

findAll

public static List<ResourceCode> findAll()
                                  throws SystemException
Returns all the resource codes.

Returns:
the resource codes
Throws:
SystemException - if a system exception occurred

findAll

public static List<ResourceCode> findAll(int start,
                                         int end)
                                  throws SystemException
Returns a range of all the resource codes.

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 resource codes
end - the upper bound of the range of resource codes (not inclusive)
Returns:
the range of resource codes
Throws:
SystemException - if a system exception occurred

findAll

public static List<ResourceCode> findAll(int start,
                                         int end,
                                         OrderByComparator orderByComparator)
                                  throws SystemException
Returns an ordered range of all the resource codes.

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 resource codes
end - the upper bound of the range of resource codes (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of resource codes
Throws:
SystemException - if a system exception occurred

removeByCompanyId

public static void removeByCompanyId(long companyId)
                              throws SystemException
Removes all the resource codes where companyId = ? from the database.

Parameters:
companyId - the company ID
Throws:
SystemException - if a system exception occurred

removeByName

public static void removeByName(String name)
                         throws SystemException
Removes all the resource codes where name = ? from the database.

Parameters:
name - the name
Throws:
SystemException - if a system exception occurred

removeByC_N_S

public static ResourceCode removeByC_N_S(long companyId,
                                         String name,
                                         int scope)
                                  throws NoSuchResourceCodeException,
                                         SystemException
Removes the resource code where companyId = ? and name = ? and scope = ? from the database.

Parameters:
companyId - the company ID
name - the name
scope - the scope
Returns:
the resource code that was removed
Throws:
SystemException - if a system exception occurred
NoSuchResourceCodeException

removeAll

public static void removeAll()
                      throws SystemException
Removes all the resource codes from the database.

Throws:
SystemException - if a system exception occurred

countByCompanyId

public static int countByCompanyId(long companyId)
                            throws SystemException
Returns the number of resource codes where companyId = ?.

Parameters:
companyId - the company ID
Returns:
the number of matching resource codes
Throws:
SystemException - if a system exception occurred

countByName

public static int countByName(String name)
                       throws SystemException
Returns the number of resource codes where name = ?.

Parameters:
name - the name
Returns:
the number of matching resource codes
Throws:
SystemException - if a system exception occurred

countByC_N_S

public static int countByC_N_S(long companyId,
                               String name,
                               int scope)
                        throws SystemException
Returns the number of resource codes where companyId = ? and name = ? and scope = ?.

Parameters:
companyId - the company ID
name - the name
scope - the scope
Returns:
the number of matching resource codes
Throws:
SystemException - if a system exception occurred

countAll

public static int countAll()
                    throws SystemException
Returns the number of resource codes.

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

getPersistence

public static ResourceCodePersistence getPersistence()

setPersistence

public void setPersistence(ResourceCodePersistence persistence)
Deprecated. 


Liferay 6.1.2-ce-ga3