|
Liferay 6.2.0-ce-rc4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.portal.service.persistence.ShardUtil
public class ShardUtil
The persistence utility for the shard service. This utility wraps 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 Summary | |
|---|---|
ShardUtil()
|
|
| Method Summary | |
|---|---|
static void |
cacheResult(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(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(String name)
Returns the shard where name = ? or returns null if it could not be found. |
static Shard |
fetchByName(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 List<Shard> |
findAll()
Returns all the shards. |
static List<Shard> |
findAll(int start,
int end)
Returns a range of all the shards. |
static 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(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 List<Shard> |
findWithDynamicQuery(DynamicQuery dynamicQuery)
|
static List<Shard> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
|
static 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(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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShardUtil()
| Method Detail |
|---|
public static void clearCache()
BasePersistence.clearCache()public static void clearCache(Shard shard)
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)
public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
throws SystemException
SystemExceptionBasePersistence.countWithDynamicQuery(DynamicQuery)
public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery)
throws SystemException
SystemExceptionBasePersistence.findWithDynamicQuery(DynamicQuery)
public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
throws SystemException
SystemExceptionBasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator orderByComparator)
throws SystemException
SystemExceptionBasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static Shard update(Shard shard)
throws SystemException
SystemExceptionBasePersistence.update(com.liferay.portal.model.BaseModel)
public static Shard update(Shard shard,
ServiceContext serviceContext)
throws SystemException
SystemExceptionBasePersistence.update(com.liferay.portal.model.BaseModel, ServiceContext)
public static Shard findByName(String name)
throws NoSuchShardException,
SystemException
NoSuchShardException if it could not be found.
name - the name
NoSuchShardException - if a matching shard could not be found
SystemException - if a system exception occurred
public static Shard fetchByName(String name)
throws SystemException
null if it could not be found. Uses the finder cache.
name - the name
null if a matching shard could not be found
SystemException - if a system exception occurred
public static Shard fetchByName(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 cache
null if a matching shard could not be found
SystemException - if a system exception occurred
public static Shard removeByName(String name)
throws NoSuchShardException,
SystemException
name - the name
SystemException - if a system exception occurred
NoSuchShardException
public static int countByName(String name)
throws SystemException
name - the name
SystemException - if a system exception occurred
public 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 k
NoSuchShardException - if a matching shard could not be found
SystemException - if a system exception occurred
public 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 k
null if a matching shard could not be found
SystemException - if a system exception occurred
public 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 cache
null if a matching shard could not be found
SystemException - if a system exception occurred
public static Shard removeByC_C(long classNameId,
long classPK)
throws NoSuchShardException,
SystemException
classNameId - the class name IDclassPK - the class p k
SystemException - if a system exception occurred
NoSuchShardException
public static int countByC_C(long classNameId,
long classPK)
throws SystemException
classNameId - the class name IDclassPK - the class p k
SystemException - if a system exception occurredpublic static void cacheResult(Shard shard)
shard - the shardpublic static void cacheResult(List<Shard> shards)
shards - the shardspublic static Shard create(long shardId)
shardId - the primary key for the new shard
public static Shard remove(long shardId)
throws NoSuchShardException,
SystemException
shardId - the primary key of the shard
NoSuchShardException - if a shard with the primary key could not be found
SystemException - if a system exception occurred
public static Shard updateImpl(Shard shard)
throws SystemException
SystemException
public static Shard findByPrimaryKey(long shardId)
throws NoSuchShardException,
SystemException
NoSuchShardException if it could not be found.
shardId - the primary key of the shard
NoSuchShardException - if a shard with the primary key could not be found
SystemException - if a system exception occurred
public static Shard fetchByPrimaryKey(long shardId)
throws SystemException
null if it could not be found.
shardId - the primary key of the shard
null if a shard with the primary key could not be found
SystemException - if a system exception occurred
public static List<Shard> findAll()
throws SystemException
SystemException - if a system exception occurred
public static 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 occurred
public static 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 occurred
public static void removeAll()
throws SystemException
SystemException - if a system exception occurred
public static int countAll()
throws SystemException
SystemException - if a system exception occurredpublic static ShardPersistence getPersistence()
public void setPersistence(ShardPersistence persistence)
|
Liferay 6.2.0-ce-rc4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||