|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.portal.service.persistence.ResourceCodeUtil
public class ResourceCodeUtil
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
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 |
---|
public ResourceCodeUtil()
Method Detail |
---|
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(ResourceCode resourceCode)
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)
public long countWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemException
BasePersistence.countWithDynamicQuery(DynamicQuery)
public static List<ResourceCode> findWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static List<ResourceCode> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static List<ResourceCode> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static ResourceCode update(ResourceCode resourceCode, boolean merge) throws SystemException
SystemException
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean)
public static ResourceCode update(ResourceCode resourceCode, boolean merge, ServiceContext serviceContext) throws SystemException
SystemException
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
public static void cacheResult(ResourceCode resourceCode)
resourceCode
- the resource codepublic static void cacheResult(List<ResourceCode> resourceCodes)
resourceCodes
- the resource codespublic static ResourceCode create(long codeId)
codeId
- the primary key for the new resource code
public static ResourceCode remove(long codeId) throws NoSuchResourceCodeException, SystemException
codeId
- the primary key of the resource code
NoSuchResourceCodeException
- if a resource code with the primary key could not be found
SystemException
- if a system exception occurredpublic static ResourceCode updateImpl(ResourceCode resourceCode, boolean merge) throws SystemException
SystemException
public static ResourceCode findByPrimaryKey(long codeId) throws NoSuchResourceCodeException, SystemException
NoSuchResourceCodeException
if it could not be found.
codeId
- the primary key of the resource code
NoSuchResourceCodeException
- if a resource code with the primary key could not be found
SystemException
- if a system exception occurredpublic static ResourceCode fetchByPrimaryKey(long codeId) throws SystemException
null
if it could not be found.
codeId
- the primary key of the resource code
null
if a resource code with the primary key could not be found
SystemException
- if a system exception occurredpublic static List<ResourceCode> findByCompanyId(long companyId) throws SystemException
companyId
- the company ID
SystemException
- if a system exception occurredpublic static List<ResourceCode> findByCompanyId(long companyId, int start, int end) throws SystemException
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.
companyId
- the company IDstart
- the lower bound of the range of resource codesend
- the upper bound of the range of resource codes (not inclusive)
SystemException
- if a system exception occurredpublic static List<ResourceCode> findByCompanyId(long companyId, int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
companyId
- the company IDstart
- the lower bound of the range of resource codesend
- the upper bound of the range of resource codes (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static ResourceCode findByCompanyId_First(long companyId, OrderByComparator orderByComparator) throws NoSuchResourceCodeException, SystemException
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchResourceCodeException
- if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode fetchByCompanyId_First(long companyId, OrderByComparator orderByComparator) throws SystemException
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode findByCompanyId_Last(long companyId, OrderByComparator orderByComparator) throws NoSuchResourceCodeException, SystemException
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchResourceCodeException
- if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode fetchByCompanyId_Last(long companyId, OrderByComparator orderByComparator) throws SystemException
companyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode[] findByCompanyId_PrevAndNext(long codeId, long companyId, OrderByComparator orderByComparator) throws NoSuchResourceCodeException, SystemException
codeId
- the primary key of the current resource codecompanyId
- the company IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchResourceCodeException
- if a resource code with the primary key could not be found
SystemException
- if a system exception occurredpublic static List<ResourceCode> findByName(String name) throws SystemException
name
- the name
SystemException
- if a system exception occurredpublic static List<ResourceCode> findByName(String name, int start, int end) throws SystemException
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.
name
- the namestart
- the lower bound of the range of resource codesend
- the upper bound of the range of resource codes (not inclusive)
SystemException
- if a system exception occurredpublic static List<ResourceCode> findByName(String name, int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
name
- the namestart
- the lower bound of the range of resource codesend
- the upper bound of the range of resource codes (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static ResourceCode findByName_First(String name, OrderByComparator orderByComparator) throws NoSuchResourceCodeException, SystemException
name
- the nameorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchResourceCodeException
- if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode fetchByName_First(String name, OrderByComparator orderByComparator) throws SystemException
name
- the nameorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode findByName_Last(String name, OrderByComparator orderByComparator) throws NoSuchResourceCodeException, SystemException
name
- the nameorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchResourceCodeException
- if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode fetchByName_Last(String name, OrderByComparator orderByComparator) throws SystemException
name
- the nameorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode[] findByName_PrevAndNext(long codeId, String name, OrderByComparator orderByComparator) throws NoSuchResourceCodeException, SystemException
codeId
- the primary key of the current resource codename
- the nameorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchResourceCodeException
- if a resource code with the primary key could not be found
SystemException
- if a system exception occurredpublic static ResourceCode findByC_N_S(long companyId, String name, int scope) throws NoSuchResourceCodeException, SystemException
NoSuchResourceCodeException
if it could not be found.
companyId
- the company IDname
- the namescope
- the scope
NoSuchResourceCodeException
- if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode fetchByC_N_S(long companyId, String name, int scope) throws SystemException
null
if it could not be found. Uses the finder cache.
companyId
- the company IDname
- the namescope
- the scope
null
if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static ResourceCode fetchByC_N_S(long companyId, String name, int scope, boolean retrieveFromCache) throws SystemException
null
if it could not be found, optionally using the finder cache.
companyId
- the company IDname
- the namescope
- the scoperetrieveFromCache
- whether to use the finder cache
null
if a matching resource code could not be found
SystemException
- if a system exception occurredpublic static List<ResourceCode> findAll() throws SystemException
SystemException
- if a system exception occurredpublic static List<ResourceCode> findAll(int start, int end) throws SystemException
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.
start
- the lower bound of the range of resource codesend
- the upper bound of the range of resource codes (not inclusive)
SystemException
- if a system exception occurredpublic static List<ResourceCode> findAll(int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
start
- the lower bound of the range of resource codesend
- the upper bound of the range of resource codes (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static void removeByCompanyId(long companyId) throws SystemException
companyId
- the company ID
SystemException
- if a system exception occurredpublic static void removeByName(String name) throws SystemException
name
- the name
SystemException
- if a system exception occurredpublic static ResourceCode removeByC_N_S(long companyId, String name, int scope) throws NoSuchResourceCodeException, SystemException
companyId
- the company IDname
- the namescope
- the scope
SystemException
- if a system exception occurred
NoSuchResourceCodeException
public static void removeAll() throws SystemException
SystemException
- if a system exception occurredpublic static int countByCompanyId(long companyId) throws SystemException
companyId
- the company ID
SystemException
- if a system exception occurredpublic static int countByName(String name) throws SystemException
name
- the name
SystemException
- if a system exception occurredpublic static int countByC_N_S(long companyId, String name, int scope) throws SystemException
companyId
- the company IDname
- the namescope
- the scope
SystemException
- if a system exception occurredpublic static int countAll() throws SystemException
SystemException
- if a system exception occurredpublic static ResourceCodePersistence getPersistence()
public void setPersistence(ResourceCodePersistence persistence)
|
Liferay 6.1.2-ce-ga3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |