@ProviderType
public class ResourceBlockUtil
extends Object
ResourceBlockPersistenceImpl
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
ResourceBlockPersistence
,
ResourceBlockPersistenceImpl
Constructor and Description |
---|
ResourceBlockUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheResult(List<ResourceBlock> resourceBlocks)
Caches the resource blocks in the entity cache if it is enabled.
|
static void |
cacheResult(ResourceBlock resourceBlock)
Caches the resource block in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(ResourceBlock resourceBlock) |
static int |
countAll()
Returns the number of resource blocks.
|
static int |
countByC_G_N_P(long companyId,
long groupId,
String name,
String permissionsHash)
Returns the number of resource blocks where companyId = ? and groupId = ? and name = ? and permissionsHash = ?.
|
static int |
countByC_G_N(long companyId,
long groupId,
String name)
Returns the number of resource blocks where companyId = ? and groupId = ? and name = ?.
|
static int |
countByC_N(long companyId,
String name)
Returns the number of resource blocks where companyId = ? and name = ?.
|
static long |
countWithDynamicQuery(DynamicQuery dynamicQuery) |
static ResourceBlock |
create(long resourceBlockId)
Creates a new resource block with the primary key.
|
static ResourceBlock |
fetchByC_G_N_First(long companyId,
long groupId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the first resource block in the ordered set where companyId = ? and groupId = ? and name = ?.
|
static ResourceBlock |
fetchByC_G_N_Last(long companyId,
long groupId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the last resource block in the ordered set where companyId = ? and groupId = ? and name = ?.
|
static ResourceBlock |
fetchByC_G_N_P(long companyId,
long groupId,
String name,
String permissionsHash)
Returns the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? or returns
null if it could not be found. |
static ResourceBlock |
fetchByC_G_N_P(long companyId,
long groupId,
String name,
String permissionsHash,
boolean retrieveFromCache)
Returns the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? or returns
null if it could not be found, optionally using the finder cache. |
static ResourceBlock |
fetchByC_N_First(long companyId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the first resource block in the ordered set where companyId = ? and name = ?.
|
static ResourceBlock |
fetchByC_N_Last(long companyId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the last resource block in the ordered set where companyId = ? and name = ?.
|
static ResourceBlock |
fetchByPrimaryKey(long resourceBlockId)
Returns the resource block with the primary key or returns
null if it could not be found. |
static Map<Serializable,ResourceBlock> |
fetchByPrimaryKeys(Set<Serializable> primaryKeys) |
static List<ResourceBlock> |
findAll()
Returns all the resource blocks.
|
static List<ResourceBlock> |
findAll(int start,
int end)
Returns a range of all the resource blocks.
|
static List<ResourceBlock> |
findAll(int start,
int end,
OrderByComparator<ResourceBlock> orderByComparator)
Returns an ordered range of all the resource blocks.
|
static List<ResourceBlock> |
findAll(int start,
int end,
OrderByComparator<ResourceBlock> orderByComparator,
boolean retrieveFromCache)
Returns an ordered range of all the resource blocks.
|
static ResourceBlock |
findByC_G_N_First(long companyId,
long groupId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the first resource block in the ordered set where companyId = ? and groupId = ? and name = ?.
|
static ResourceBlock |
findByC_G_N_Last(long companyId,
long groupId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the last resource block in the ordered set where companyId = ? and groupId = ? and name = ?.
|
static ResourceBlock |
findByC_G_N_P(long companyId,
long groupId,
String name,
String permissionsHash)
Returns the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? or throws a
NoSuchResourceBlockException if it could not be found. |
static ResourceBlock[] |
findByC_G_N_PrevAndNext(long resourceBlockId,
long companyId,
long groupId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the resource blocks before and after the current resource block in the ordered set where companyId = ? and groupId = ? and name = ?.
|
static List<ResourceBlock> |
findByC_G_N(long companyId,
long groupId,
String name)
Returns all the resource blocks where companyId = ? and groupId = ? and name = ?.
|
static List<ResourceBlock> |
findByC_G_N(long companyId,
long groupId,
String name,
int start,
int end)
Returns a range of all the resource blocks where companyId = ? and groupId = ? and name = ?.
|
static List<ResourceBlock> |
findByC_G_N(long companyId,
long groupId,
String name,
int start,
int end,
OrderByComparator<ResourceBlock> orderByComparator)
Returns an ordered range of all the resource blocks where companyId = ? and groupId = ? and name = ?.
|
static List<ResourceBlock> |
findByC_G_N(long companyId,
long groupId,
String name,
int start,
int end,
OrderByComparator<ResourceBlock> orderByComparator,
boolean retrieveFromCache)
Returns an ordered range of all the resource blocks where companyId = ? and groupId = ? and name = ?.
|
static ResourceBlock |
findByC_N_First(long companyId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the first resource block in the ordered set where companyId = ? and name = ?.
|
static ResourceBlock |
findByC_N_Last(long companyId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the last resource block in the ordered set where companyId = ? and name = ?.
|
static ResourceBlock[] |
findByC_N_PrevAndNext(long resourceBlockId,
long companyId,
String name,
OrderByComparator<ResourceBlock> orderByComparator)
Returns the resource blocks before and after the current resource block in the ordered set where companyId = ? and name = ?.
|
static List<ResourceBlock> |
findByC_N(long companyId,
String name)
Returns all the resource blocks where companyId = ? and name = ?.
|
static List<ResourceBlock> |
findByC_N(long companyId,
String name,
int start,
int end)
Returns a range of all the resource blocks where companyId = ? and name = ?.
|
static List<ResourceBlock> |
findByC_N(long companyId,
String name,
int start,
int end,
OrderByComparator<ResourceBlock> orderByComparator)
Returns an ordered range of all the resource blocks where companyId = ? and name = ?.
|
static List<ResourceBlock> |
findByC_N(long companyId,
String name,
int start,
int end,
OrderByComparator<ResourceBlock> orderByComparator,
boolean retrieveFromCache)
Returns an ordered range of all the resource blocks where companyId = ? and name = ?.
|
static ResourceBlock |
findByPrimaryKey(long resourceBlockId)
Returns the resource block with the primary key or throws a
NoSuchResourceBlockException if it could not be found. |
static List<ResourceBlock> |
findWithDynamicQuery(DynamicQuery dynamicQuery) |
static List<ResourceBlock> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end) |
static List<ResourceBlock> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<ResourceBlock> orderByComparator) |
static ResourceBlockPersistence |
getPersistence() |
static ResourceBlock |
remove(long resourceBlockId)
Removes the resource block with the primary key from the database.
|
static void |
removeAll()
Removes all the resource blocks from the database.
|
static ResourceBlock |
removeByC_G_N_P(long companyId,
long groupId,
String name,
String permissionsHash)
Removes the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? from the database.
|
static void |
removeByC_G_N(long companyId,
long groupId,
String name)
Removes all the resource blocks where companyId = ? and groupId = ? and name = ? from the database.
|
static void |
removeByC_N(long companyId,
String name)
Removes all the resource blocks where companyId = ? and name = ? from the database.
|
static ResourceBlock |
update(ResourceBlock resourceBlock) |
static ResourceBlock |
update(ResourceBlock resourceBlock,
ServiceContext serviceContext) |
static ResourceBlock |
updateImpl(ResourceBlock resourceBlock) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(ResourceBlock resourceBlock)
public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
public static List<ResourceBlock> findWithDynamicQuery(DynamicQuery dynamicQuery)
public static List<ResourceBlock> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
public static List<ResourceBlock> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<ResourceBlock> orderByComparator)
public static ResourceBlock update(ResourceBlock resourceBlock)
public static ResourceBlock update(ResourceBlock resourceBlock, ServiceContext serviceContext)
public static List<ResourceBlock> findByC_N(long companyId, String name)
companyId
- the company IDname
- the namepublic static List<ResourceBlock> findByC_N(long companyId, String name, int start, int end)
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. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from ResourceBlockModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
companyId
- the company IDname
- the namestart
- the lower bound of the range of resource blocksend
- the upper bound of the range of resource blocks (not inclusive)public static List<ResourceBlock> findByC_N(long companyId, String name, int start, int end, OrderByComparator<ResourceBlock> orderByComparator)
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. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from ResourceBlockModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
companyId
- the company IDname
- the namestart
- the lower bound of the range of resource blocksend
- the upper bound of the range of resource blocks (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static List<ResourceBlock> findByC_N(long companyId, String name, int start, int end, OrderByComparator<ResourceBlock> orderByComparator, boolean retrieveFromCache)
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. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from ResourceBlockModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
companyId
- the company IDname
- the namestart
- the lower bound of the range of resource blocksend
- the upper bound of the range of resource blocks (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)retrieveFromCache
- whether to retrieve from the finder cachepublic static ResourceBlock findByC_N_First(long companyId, String name, OrderByComparator<ResourceBlock> orderByComparator) throws NoSuchResourceBlockException
companyId
- the company IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)NoSuchResourceBlockException
- if a matching resource block could not be foundpublic static ResourceBlock fetchByC_N_First(long companyId, String name, OrderByComparator<ResourceBlock> orderByComparator)
companyId
- the company IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching resource block could not be foundpublic static ResourceBlock findByC_N_Last(long companyId, String name, OrderByComparator<ResourceBlock> orderByComparator) throws NoSuchResourceBlockException
companyId
- the company IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)NoSuchResourceBlockException
- if a matching resource block could not be foundpublic static ResourceBlock fetchByC_N_Last(long companyId, String name, OrderByComparator<ResourceBlock> orderByComparator)
companyId
- the company IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching resource block could not be foundpublic static ResourceBlock[] findByC_N_PrevAndNext(long resourceBlockId, long companyId, String name, OrderByComparator<ResourceBlock> orderByComparator) throws NoSuchResourceBlockException
resourceBlockId
- the primary key of the current resource blockcompanyId
- the company IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)NoSuchResourceBlockException
- if a resource block with the primary key could not be foundpublic static void removeByC_N(long companyId, String name)
companyId
- the company IDname
- the namepublic static int countByC_N(long companyId, String name)
companyId
- the company IDname
- the namepublic static List<ResourceBlock> findByC_G_N(long companyId, long groupId, String name)
companyId
- the company IDgroupId
- the group IDname
- the namepublic static List<ResourceBlock> findByC_G_N(long companyId, long groupId, String name, int start, int end)
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. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from ResourceBlockModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
companyId
- the company IDgroupId
- the group IDname
- the namestart
- the lower bound of the range of resource blocksend
- the upper bound of the range of resource blocks (not inclusive)public static List<ResourceBlock> findByC_G_N(long companyId, long groupId, String name, int start, int end, OrderByComparator<ResourceBlock> orderByComparator)
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. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from ResourceBlockModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
companyId
- the company IDgroupId
- the group IDname
- the namestart
- the lower bound of the range of resource blocksend
- the upper bound of the range of resource blocks (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static List<ResourceBlock> findByC_G_N(long companyId, long groupId, String name, int start, int end, OrderByComparator<ResourceBlock> orderByComparator, boolean retrieveFromCache)
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. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from ResourceBlockModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
companyId
- the company IDgroupId
- the group IDname
- the namestart
- the lower bound of the range of resource blocksend
- the upper bound of the range of resource blocks (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)retrieveFromCache
- whether to retrieve from the finder cachepublic static ResourceBlock findByC_G_N_First(long companyId, long groupId, String name, OrderByComparator<ResourceBlock> orderByComparator) throws NoSuchResourceBlockException
companyId
- the company IDgroupId
- the group IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)NoSuchResourceBlockException
- if a matching resource block could not be foundpublic static ResourceBlock fetchByC_G_N_First(long companyId, long groupId, String name, OrderByComparator<ResourceBlock> orderByComparator)
companyId
- the company IDgroupId
- the group IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching resource block could not be foundpublic static ResourceBlock findByC_G_N_Last(long companyId, long groupId, String name, OrderByComparator<ResourceBlock> orderByComparator) throws NoSuchResourceBlockException
companyId
- the company IDgroupId
- the group IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)NoSuchResourceBlockException
- if a matching resource block could not be foundpublic static ResourceBlock fetchByC_G_N_Last(long companyId, long groupId, String name, OrderByComparator<ResourceBlock> orderByComparator)
companyId
- the company IDgroupId
- the group IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching resource block could not be foundpublic static ResourceBlock[] findByC_G_N_PrevAndNext(long resourceBlockId, long companyId, long groupId, String name, OrderByComparator<ResourceBlock> orderByComparator) throws NoSuchResourceBlockException
resourceBlockId
- the primary key of the current resource blockcompanyId
- the company IDgroupId
- the group IDname
- the nameorderByComparator
- the comparator to order the set by (optionally null
)NoSuchResourceBlockException
- if a resource block with the primary key could not be foundpublic static void removeByC_G_N(long companyId, long groupId, String name)
companyId
- the company IDgroupId
- the group IDname
- the namepublic static int countByC_G_N(long companyId, long groupId, String name)
companyId
- the company IDgroupId
- the group IDname
- the namepublic static ResourceBlock findByC_G_N_P(long companyId, long groupId, String name, String permissionsHash) throws NoSuchResourceBlockException
NoSuchResourceBlockException
if it could not be found.companyId
- the company IDgroupId
- the group IDname
- the namepermissionsHash
- the permissions hashNoSuchResourceBlockException
- if a matching resource block could not be foundpublic static ResourceBlock fetchByC_G_N_P(long companyId, long groupId, String name, String permissionsHash)
null
if it could not be found. Uses the finder cache.companyId
- the company IDgroupId
- the group IDname
- the namepermissionsHash
- the permissions hashnull
if a matching resource block could not be foundpublic static ResourceBlock fetchByC_G_N_P(long companyId, long groupId, String name, String permissionsHash, boolean retrieveFromCache)
null
if it could not be found, optionally using the finder cache.companyId
- the company IDgroupId
- the group IDname
- the namepermissionsHash
- the permissions hashretrieveFromCache
- whether to retrieve from the finder cachenull
if a matching resource block could not be foundpublic static ResourceBlock removeByC_G_N_P(long companyId, long groupId, String name, String permissionsHash) throws NoSuchResourceBlockException
companyId
- the company IDgroupId
- the group IDname
- the namepermissionsHash
- the permissions hashNoSuchResourceBlockException
public static int countByC_G_N_P(long companyId, long groupId, String name, String permissionsHash)
companyId
- the company IDgroupId
- the group IDname
- the namepermissionsHash
- the permissions hashpublic static void cacheResult(ResourceBlock resourceBlock)
resourceBlock
- the resource blockpublic static void cacheResult(List<ResourceBlock> resourceBlocks)
resourceBlocks
- the resource blockspublic static ResourceBlock create(long resourceBlockId)
resourceBlockId
- the primary key for the new resource blockpublic static ResourceBlock remove(long resourceBlockId) throws NoSuchResourceBlockException
resourceBlockId
- the primary key of the resource blockNoSuchResourceBlockException
- if a resource block with the primary key could not be foundpublic static ResourceBlock updateImpl(ResourceBlock resourceBlock)
public static ResourceBlock findByPrimaryKey(long resourceBlockId) throws NoSuchResourceBlockException
NoSuchResourceBlockException
if it could not be found.resourceBlockId
- the primary key of the resource blockNoSuchResourceBlockException
- if a resource block with the primary key could not be foundpublic static ResourceBlock fetchByPrimaryKey(long resourceBlockId)
null
if it could not be found.resourceBlockId
- the primary key of the resource blocknull
if a resource block with the primary key could not be foundpublic static Map<Serializable,ResourceBlock> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
public static List<ResourceBlock> findAll()
public static List<ResourceBlock> findAll(int start, int end)
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. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from ResourceBlockModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
start
- the lower bound of the range of resource blocksend
- the upper bound of the range of resource blocks (not inclusive)public static List<ResourceBlock> findAll(int start, int end, OrderByComparator<ResourceBlock> orderByComparator)
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. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from ResourceBlockModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
start
- the lower bound of the range of resource blocksend
- the upper bound of the range of resource blocks (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static List<ResourceBlock> findAll(int start, int end, OrderByComparator<ResourceBlock> orderByComparator, boolean retrieveFromCache)
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. If orderByComparator
is specified, then the query will include the given ORDER BY logic. If orderByComparator
is absent and pagination is required (start
and end
are not QueryUtil#ALL_POS
), then the query will include the default ORDER BY logic from ResourceBlockModelImpl
. If both orderByComparator
and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
start
- the lower bound of the range of resource blocksend
- the upper bound of the range of resource blocks (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)retrieveFromCache
- whether to retrieve from the finder cachepublic static void removeAll()
public static int countAll()
public static ResourceBlockPersistence getPersistence()