Class ResourceActionUtil
com.liferay.portal.service.persistence.impl.ResourceActionPersistenceImpl 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
- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcacheResult(ResourceAction resourceAction) Caches the resource action in the entity cache if it is enabled.static voidcacheResult(List<ResourceAction> resourceActions) Caches the resource actions in the entity cache if it is enabled.static voidstatic voidclearCache(ResourceAction resourceAction) static intcountAll()Returns the number of resource actions.static intcountByN_A(String name, String actionId) Returns the number of resource actions where name = ? and actionId = ?.static intcountByName(String name) Returns the number of resource actions where name = ?.static longcountWithDynamicQuery(DynamicQuery dynamicQuery) static ResourceActioncreate(long resourceActionId) Creates a new resource action with the primary key.static ResourceActionfetchByN_A(String name, String actionId) Returns the resource action where name = ? and actionId = ? or returnsnullif it could not be found.static ResourceActionfetchByN_A(String name, String actionId, boolean useFinderCache) Returns the resource action where name = ? and actionId = ? or returnsnullif it could not be found, optionally using the finder cache.static ResourceActionfetchByName_First(String name, OrderByComparator<ResourceAction> orderByComparator) Returns the first resource action in the ordered set where name = ?.static ResourceActionfetchByName_Last(String name, OrderByComparator<ResourceAction> orderByComparator) Returns the last resource action in the ordered set where name = ?.static ResourceActionfetchByPrimaryKey(long resourceActionId) Returns the resource action with the primary key or returnsnullif it could not be found.static Map<Serializable,ResourceAction> fetchByPrimaryKeys(Set<Serializable> primaryKeys) static List<ResourceAction>findAll()Returns all the resource actions.static List<ResourceAction>findAll(int start, int end) Returns a range of all the resource actions.static List<ResourceAction>findAll(int start, int end, OrderByComparator<ResourceAction> orderByComparator) Returns an ordered range of all the resource actions.static List<ResourceAction>findAll(int start, int end, OrderByComparator<ResourceAction> orderByComparator, boolean useFinderCache) Returns an ordered range of all the resource actions.static ResourceActionReturns the resource action where name = ? and actionId = ? or throws aNoSuchResourceActionExceptionif it could not be found.static List<ResourceAction>findByName(String name) Returns all the resource actions where name = ?.static List<ResourceAction>findByName(String name, int start, int end) Returns a range of all the resource actions where name = ?.static List<ResourceAction>findByName(String name, int start, int end, OrderByComparator<ResourceAction> orderByComparator) Returns an ordered range of all the resource actions where name = ?.static List<ResourceAction>findByName(String name, int start, int end, OrderByComparator<ResourceAction> orderByComparator, boolean useFinderCache) Returns an ordered range of all the resource actions where name = ?.static ResourceActionfindByName_First(String name, OrderByComparator<ResourceAction> orderByComparator) Returns the first resource action in the ordered set where name = ?.static ResourceActionfindByName_Last(String name, OrderByComparator<ResourceAction> orderByComparator) Returns the last resource action in the ordered set where name = ?.static ResourceAction[]findByName_PrevAndNext(long resourceActionId, String name, OrderByComparator<ResourceAction> orderByComparator) Returns the resource actions before and after the current resource action in the ordered set where name = ?.static ResourceActionfindByPrimaryKey(long resourceActionId) Returns the resource action with the primary key or throws aNoSuchResourceActionExceptionif it could not be found.static List<ResourceAction>findWithDynamicQuery(DynamicQuery dynamicQuery) static List<ResourceAction>findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) static List<ResourceAction>findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<ResourceAction> orderByComparator) static ResourceActionPersistencestatic ResourceActionremove(long resourceActionId) Removes the resource action with the primary key from the database.static voidRemoves all the resource actions from the database.static ResourceActionremoveByN_A(String name, String actionId) Removes the resource action where name = ? and actionId = ? from the database.static voidremoveByName(String name) Removes all the resource actions where name = ? from the database.static voidsetPersistence(ResourceActionPersistence persistence) static ResourceActionupdate(ResourceAction resourceAction) static ResourceActionupdate(ResourceAction resourceAction, ServiceContext serviceContext) static ResourceActionupdateImpl(ResourceAction resourceAction)
-
Constructor Details
-
ResourceActionUtil
public ResourceActionUtil()
-
-
Method Details
-
clearCache
public static void clearCache()- See Also:
-
clearCache
-
countWithDynamicQuery
-
fetchByPrimaryKeys
- See Also:
-
findWithDynamicQuery
-
findWithDynamicQuery
public static List<ResourceAction> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) -
findWithDynamicQuery
public static List<ResourceAction> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<ResourceAction> orderByComparator) -
update
-
update
-
findByName
Returns all the resource actions where name = ?.- Parameters:
name- the name- Returns:
- the matching resource actions
-
findByName
Returns a range of all the resource actions where name = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromResourceActionModelImpl.- Parameters:
name- the namestart- the lower bound of the range of resource actionsend- the upper bound of the range of resource actions (not inclusive)- Returns:
- the range of matching resource actions
-
findByName
public static List<ResourceAction> findByName(String name, int start, int end, OrderByComparator<ResourceAction> orderByComparator) Returns an ordered range of all the resource actions where name = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromResourceActionModelImpl.- Parameters:
name- the namestart- the lower bound of the range of resource actionsend- the upper bound of the range of resource actions (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of matching resource actions
-
findByName
public static List<ResourceAction> findByName(String name, int start, int end, OrderByComparator<ResourceAction> orderByComparator, boolean useFinderCache) Returns an ordered range of all the resource actions where name = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromResourceActionModelImpl.- Parameters:
name- the namestart- the lower bound of the range of resource actionsend- the upper bound of the range of resource actions (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)useFinderCache- whether to use the finder cache- Returns:
- the ordered range of matching resource actions
-
findByName_First
public static ResourceAction findByName_First(String name, OrderByComparator<ResourceAction> orderByComparator) throws NoSuchResourceActionException Returns the first resource action in the ordered set where name = ?.- Parameters:
name- the nameorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching resource action
- Throws:
NoSuchResourceActionException- if a matching resource action could not be foundNoSuchResourceActionException
-
fetchByName_First
public static ResourceAction fetchByName_First(String name, OrderByComparator<ResourceAction> orderByComparator) Returns the first resource action in the ordered set where name = ?.- Parameters:
name- the nameorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching resource action, or
nullif a matching resource action could not be found
-
findByName_Last
public static ResourceAction findByName_Last(String name, OrderByComparator<ResourceAction> orderByComparator) throws NoSuchResourceActionException Returns the last resource action in the ordered set where name = ?.- Parameters:
name- the nameorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching resource action
- Throws:
NoSuchResourceActionException- if a matching resource action could not be foundNoSuchResourceActionException
-
fetchByName_Last
public static ResourceAction fetchByName_Last(String name, OrderByComparator<ResourceAction> orderByComparator) Returns the last resource action in the ordered set where name = ?.- Parameters:
name- the nameorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching resource action, or
nullif a matching resource action could not be found
-
findByName_PrevAndNext
public static ResourceAction[] findByName_PrevAndNext(long resourceActionId, String name, OrderByComparator<ResourceAction> orderByComparator) throws NoSuchResourceActionException Returns the resource actions before and after the current resource action in the ordered set where name = ?.- Parameters:
resourceActionId- the primary key of the current resource actionname- the nameorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the previous, current, and next resource action
- Throws:
NoSuchResourceActionException- if a resource action with the primary key could not be foundNoSuchResourceActionException
-
removeByName
Removes all the resource actions where name = ? from the database.- Parameters:
name- the name
-
countByName
Returns the number of resource actions where name = ?.- Parameters:
name- the name- Returns:
- the number of matching resource actions
-
findByN_A
public static ResourceAction findByN_A(String name, String actionId) throws NoSuchResourceActionException Returns the resource action where name = ? and actionId = ? or throws aNoSuchResourceActionExceptionif it could not be found.- Parameters:
name- the nameactionId- the action ID- Returns:
- the matching resource action
- Throws:
NoSuchResourceActionException- if a matching resource action could not be foundNoSuchResourceActionException
-
fetchByN_A
Returns the resource action where name = ? and actionId = ? or returnsnullif it could not be found. Uses the finder cache.- Parameters:
name- the nameactionId- the action ID- Returns:
- the matching resource action, or
nullif a matching resource action could not be found
-
fetchByN_A
Returns the resource action where name = ? and actionId = ? or returnsnullif it could not be found, optionally using the finder cache.- Parameters:
name- the nameactionId- the action IDuseFinderCache- whether to use the finder cache- Returns:
- the matching resource action, or
nullif a matching resource action could not be found
-
removeByN_A
public static ResourceAction removeByN_A(String name, String actionId) throws NoSuchResourceActionException Removes the resource action where name = ? and actionId = ? from the database.- Parameters:
name- the nameactionId- the action ID- Returns:
- the resource action that was removed
- Throws:
NoSuchResourceActionException
-
countByN_A
Returns the number of resource actions where name = ? and actionId = ?.- Parameters:
name- the nameactionId- the action ID- Returns:
- the number of matching resource actions
-
cacheResult
Caches the resource action in the entity cache if it is enabled.- Parameters:
resourceAction- the resource action
-
cacheResult
Caches the resource actions in the entity cache if it is enabled.- Parameters:
resourceActions- the resource actions
-
create
Creates a new resource action with the primary key. Does not add the resource action to the database.- Parameters:
resourceActionId- the primary key for the new resource action- Returns:
- the new resource action
-
remove
Removes the resource action with the primary key from the database. Also notifies the appropriate model listeners.- Parameters:
resourceActionId- the primary key of the resource action- Returns:
- the resource action that was removed
- Throws:
NoSuchResourceActionException- if a resource action with the primary key could not be foundNoSuchResourceActionException
-
updateImpl
-
findByPrimaryKey
public static ResourceAction findByPrimaryKey(long resourceActionId) throws NoSuchResourceActionException Returns the resource action with the primary key or throws aNoSuchResourceActionExceptionif it could not be found.- Parameters:
resourceActionId- the primary key of the resource action- Returns:
- the resource action
- Throws:
NoSuchResourceActionException- if a resource action with the primary key could not be foundNoSuchResourceActionException
-
fetchByPrimaryKey
Returns the resource action with the primary key or returnsnullif it could not be found.- Parameters:
resourceActionId- the primary key of the resource action- Returns:
- the resource action, or
nullif a resource action with the primary key could not be found
-
findAll
Returns all the resource actions.- Returns:
- the resource actions
-
findAll
Returns a range of all the resource actions.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromResourceActionModelImpl.- Parameters:
start- the lower bound of the range of resource actionsend- the upper bound of the range of resource actions (not inclusive)- Returns:
- the range of resource actions
-
findAll
public static List<ResourceAction> findAll(int start, int end, OrderByComparator<ResourceAction> orderByComparator) Returns an ordered range of all the resource actions.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromResourceActionModelImpl.- Parameters:
start- the lower bound of the range of resource actionsend- the upper bound of the range of resource actions (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of resource actions
-
findAll
public static List<ResourceAction> findAll(int start, int end, OrderByComparator<ResourceAction> orderByComparator, boolean useFinderCache) Returns an ordered range of all the resource actions.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromResourceActionModelImpl.- Parameters:
start- the lower bound of the range of resource actionsend- the upper bound of the range of resource actions (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)useFinderCache- whether to use the finder cache- Returns:
- the ordered range of resource actions
-
removeAll
public static void removeAll()Removes all the resource actions from the database. -
countAll
public static int countAll()Returns the number of resource actions.- Returns:
- the number of resource actions
-
getPersistence
-
setPersistence
-