@ProviderType
public class ShardUtil
extends java.lang.Object
ShardPersistenceImpl 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
ShardPersistence,
ShardPersistenceImpl| Constructor and Description |
|---|
ShardUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cacheResult(java.util.List<Shard> shards)
Caches the shards in the entity cache if it is enabled.
|
static void |
cacheResult(Shard shard)
Caches the shard in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(Shard shard) |
static int |
countAll()
Returns the number of shards.
|
static int |
countByC_C(long classNameId,
long classPK)
Returns the number of shards where classNameId = ? and classPK = ?.
|
static int |
countByName(java.lang.String name)
Returns the number of shards where name = ?.
|
static long |
countWithDynamicQuery(DynamicQuery dynamicQuery) |
static Shard |
create(long shardId)
Creates a new shard with the primary key.
|
static Shard |
fetchByC_C(long classNameId,
long classPK)
Returns the shard where classNameId = ? and classPK = ? or returns
null if it could not be found. |
static Shard |
fetchByC_C(long classNameId,
long classPK,
boolean retrieveFromCache)
Returns the shard where classNameId = ? and classPK = ? or returns
null if it could not be found, optionally using the finder cache. |
static Shard |
fetchByName(java.lang.String name)
Returns the shard where name = ? or returns
null if it could not be found. |
static Shard |
fetchByName(java.lang.String name,
boolean retrieveFromCache)
Returns the shard where name = ? or returns
null if it could not be found, optionally using the finder cache. |
static Shard |
fetchByPrimaryKey(long shardId)
Returns the shard with the primary key or returns
null if it could not be found. |
static java.util.List<Shard> |
findAll()
Returns all the shards.
|
static java.util.List<Shard> |
findAll(int start,
int end)
Returns a range of all the shards.
|
static java.util.List<Shard> |
findAll(int start,
int end,
OrderByComparator orderByComparator)
Returns an ordered range of all the shards.
|
static Shard |
findByC_C(long classNameId,
long classPK)
Returns the shard where classNameId = ? and classPK = ? or throws a
NoSuchShardException if it could not be found. |
static Shard |
findByName(java.lang.String name)
Returns the shard where name = ? or throws a
NoSuchShardException if it could not be found. |
static Shard |
findByPrimaryKey(long shardId)
Returns the shard with the primary key or throws a
NoSuchShardException if it could not be found. |
static java.util.List<Shard> |
findWithDynamicQuery(DynamicQuery dynamicQuery) |
static java.util.List<Shard> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end) |
static java.util.List<Shard> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator orderByComparator) |
static ShardPersistence |
getPersistence() |
static Shard |
remove(long shardId)
Removes the shard with the primary key from the database.
|
static void |
removeAll()
Removes all the shards from the database.
|
static Shard |
removeByC_C(long classNameId,
long classPK)
Removes the shard where classNameId = ? and classPK = ? from the database.
|
static Shard |
removeByName(java.lang.String name)
Removes the shard where name = ? from the database.
|
void |
setPersistence(ShardPersistence persistence)
Deprecated.
As of 6.2.0
|
static Shard |
update(Shard shard) |
static Shard |
update(Shard shard,
ServiceContext serviceContext) |
static Shard |
updateImpl(Shard shard) |
public static void clearCache()
BasePersistence.clearCache()public static void clearCache(Shard shard)
public static long countWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemExceptionBasePersistence.countWithDynamicQuery(DynamicQuery)public static java.util.List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemExceptionBasePersistence.findWithDynamicQuery(DynamicQuery)public static java.util.List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) throws SystemException
public static java.util.List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator) throws SystemException
public static Shard update(Shard shard) throws SystemException
public static Shard update(Shard shard, ServiceContext serviceContext) throws SystemException
public static Shard findByName(java.lang.String name) throws NoSuchShardException, SystemException
NoSuchShardException if it could not be found.name - the nameNoSuchShardException - if a matching shard could not be foundSystemException - if a system exception occurredpublic static Shard fetchByName(java.lang.String name) throws SystemException
null if it could not be found. Uses the finder cache.name - the namenull if a matching shard could not be foundSystemException - if a system exception occurredpublic static Shard fetchByName(java.lang.String name, boolean retrieveFromCache) throws SystemException
null if it could not be found, optionally using the finder cache.name - the nameretrieveFromCache - whether to use the finder cachenull if a matching shard could not be foundSystemException - if a system exception occurredpublic static Shard removeByName(java.lang.String name) throws NoSuchShardException, SystemException
name - the nameSystemException - if a system exception occurredNoSuchShardExceptionpublic static int countByName(java.lang.String name)
throws SystemException
name - the nameSystemException - if a system exception occurredpublic static Shard findByC_C(long classNameId, long classPK) throws NoSuchShardException, SystemException
NoSuchShardException if it could not be found.classNameId - the class name IDclassPK - the class p kNoSuchShardException - if a matching shard could not be foundSystemException - if a system exception occurredpublic static Shard fetchByC_C(long classNameId, long classPK) throws SystemException
null if it could not be found. Uses the finder cache.classNameId - the class name IDclassPK - the class p knull if a matching shard could not be foundSystemException - if a system exception occurredpublic static Shard fetchByC_C(long classNameId, long classPK, boolean retrieveFromCache) throws SystemException
null if it could not be found, optionally using the finder cache.classNameId - the class name IDclassPK - the class p kretrieveFromCache - whether to use the finder cachenull if a matching shard could not be foundSystemException - if a system exception occurredpublic static Shard removeByC_C(long classNameId, long classPK) throws NoSuchShardException, SystemException
classNameId - the class name IDclassPK - the class p kSystemException - if a system exception occurredNoSuchShardExceptionpublic static int countByC_C(long classNameId,
long classPK)
throws SystemException
classNameId - the class name IDclassPK - the class p kSystemException - if a system exception occurredpublic static void cacheResult(Shard shard)
shard - the shardpublic static void cacheResult(java.util.List<Shard> shards)
shards - the shardspublic static Shard create(long shardId)
shardId - the primary key for the new shardpublic static Shard remove(long shardId) throws NoSuchShardException, SystemException
shardId - the primary key of the shardNoSuchShardException - if a shard with the primary key could not be foundSystemException - if a system exception occurredpublic static Shard updateImpl(Shard shard) throws SystemException
SystemExceptionpublic static Shard findByPrimaryKey(long shardId) throws NoSuchShardException, SystemException
NoSuchShardException if it could not be found.shardId - the primary key of the shardNoSuchShardException - if a shard with the primary key could not be foundSystemException - if a system exception occurredpublic static Shard fetchByPrimaryKey(long shardId) throws SystemException
null if it could not be found.shardId - the primary key of the shardnull if a shard with the primary key could not be foundSystemException - if a system exception occurredpublic static java.util.List<Shard> findAll() throws SystemException
SystemException - if a system exception occurredpublic static java.util.List<Shard> 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. 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 ShardModelImpl. 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 shardsend - the upper bound of the range of shards (not inclusive)SystemException - if a system exception occurredpublic static java.util.List<Shard> 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. 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 ShardModelImpl. 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 shardsend - the upper bound of the range of shards (not inclusive)orderByComparator - the comparator to order the results by (optionally null)SystemException - if a system exception occurredpublic static void removeAll()
throws SystemException
SystemException - if a system exception occurredpublic static int countAll()
throws SystemException
SystemException - if a system exception occurredpublic static ShardPersistence getPersistence()
public void setPersistence(ShardPersistence persistence)