|
Liferay 7.0-ce-m6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.portal.service.persistence.ShardUtil
@ProviderType 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 Map<Serializable,Shard> |
fetchByPrimaryKeys(Set<Serializable> primaryKeys)
|
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<Shard> 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<Shard> 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)
BasePersistence.countWithDynamicQuery(DynamicQuery)public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery)
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<Shard> orderByComparator)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)public static Shard update(Shard shard)
BasePersistence.update(com.liferay.portal.model.BaseModel)
public static Shard update(Shard shard,
ServiceContext serviceContext)
BasePersistence.update(com.liferay.portal.model.BaseModel, ServiceContext)
public static Shard findByName(String name)
throws NoSuchShardException
NoSuchShardException if it could not be found.
name - the name
NoSuchShardException - if a matching shard could not be foundpublic static Shard fetchByName(String name)
null if it could not be found. Uses the finder cache.
name - the name
null if a matching shard could not be found
public static Shard fetchByName(String name,
boolean retrieveFromCache)
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
public static Shard removeByName(String name)
throws NoSuchShardException
name - the name
NoSuchShardExceptionpublic static int countByName(String name)
name - the name
public static Shard findByC_C(long classNameId,
long classPK)
throws NoSuchShardException
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
public static Shard fetchByC_C(long classNameId,
long classPK)
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
public static Shard fetchByC_C(long classNameId,
long classPK,
boolean retrieveFromCache)
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
public static Shard removeByC_C(long classNameId,
long classPK)
throws NoSuchShardException
classNameId - the class name IDclassPK - the class p k
NoSuchShardException
public static int countByC_C(long classNameId,
long classPK)
classNameId - the class name IDclassPK - the class p k
public 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
shardId - the primary key of the shard
NoSuchShardException - if a shard with the primary key could not be foundpublic static Shard updateImpl(Shard shard)
public static Shard findByPrimaryKey(long shardId)
throws NoSuchShardException
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 foundpublic static Shard fetchByPrimaryKey(long shardId)
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 foundpublic static Map<Serializable,Shard> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
public static List<Shard> findAll()
public static List<Shard> 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 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)
public static List<Shard> findAll(int start,
int end,
OrderByComparator<Shard> 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 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)
public static void removeAll()
public static int countAll()
public static ShardPersistence getPersistence()
@Deprecated public void setPersistence(ShardPersistence persistence)
|
Liferay 7.0-ce-m6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||