Liferay 6.0-ee

com.liferay.portal.service.persistence
Class ShardUtil

java.lang.Object
  extended by com.liferay.portal.service.persistence.ShardUtil

public class ShardUtil
extends Object

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.

Never modify this class directly. Modify service.xml and rerun ServiceBuilder to regenerate this class.

Caching information and settings can be found in portal.properties

See Also:
ShardPersistence, ShardPersistenceImpl
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time it is generated.

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()
          Counts all the shards.
static int countByC_C(long classNameId, long classPK)
          Counts all the shards where classNameId = ? and classPK = ?.
static int countByName(String name)
          Counts all the shards where name = ?.
 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)
          Finds 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)
          Finds 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)
          Finds the shard where name = ? or returns null if it could not be found.
static Shard fetchByName(String name, boolean retrieveFromCache)
          Finds the shard where name = ? or returns null if it could not be found, optionally using the finder cache.
static Shard fetchByPrimaryKey(long shardId)
          Finds the shard with the primary key or returns null if it could not be found.
static List<Shard> findAll()
          Finds all the shards.
static List<Shard> findAll(int start, int end)
          Finds a range of all the shards.
static List<Shard> findAll(int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the shards.
static Shard findByC_C(long classNameId, long classPK)
          Finds the shard where classNameId = ? and classPK = ? or throws a NoSuchShardException if it could not be found.
static Shard findByName(String name)
          Finds the shard where name = ? or throws a NoSuchShardException if it could not be found.
static Shard findByPrimaryKey(long shardId)
          Finds 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 Shard remove(Shard shard)
           
static void removeAll()
          Removes all the shards from the database.
static void removeByC_C(long classNameId, long classPK)
          Removes the shard where classNameId = ? and classPK = ? from the database.
static void removeByName(String name)
          Removes the shard where name = ? from the database.
 void setPersistence(ShardPersistence persistence)
           
static Shard update(Shard shard, boolean merge)
           
static Shard update(Shard shard, boolean merge, ServiceContext serviceContext)
           
static Shard updateImpl(Shard shard, boolean merge)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShardUtil

public ShardUtil()
Method Detail

clearCache

public static void clearCache()
See Also:
BasePersistence.clearCache()

clearCache

public static void clearCache(Shard shard)
See Also:
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)

countWithDynamicQuery

public long countWithDynamicQuery(DynamicQuery dynamicQuery)
                           throws SystemException
Throws:
SystemException
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery)
                                        throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                               int start,
                                               int end)
                                        throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)

findWithDynamicQuery

public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                               int start,
                                               int end,
                                               OrderByComparator orderByComparator)
                                        throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)

remove

public static Shard remove(Shard shard)
                    throws SystemException
Throws:
SystemException
See Also:
BasePersistence.remove(com.liferay.portal.model.BaseModel)

update

public static Shard update(Shard shard,
                           boolean merge)
                    throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean)

update

public static Shard update(Shard shard,
                           boolean merge,
                           ServiceContext serviceContext)
                    throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)

cacheResult

public static void cacheResult(Shard shard)
Caches the shard in the entity cache if it is enabled.

Parameters:
shard - the shard to cache

cacheResult

public static void cacheResult(List<Shard> shards)
Caches the shards in the entity cache if it is enabled.

Parameters:
shards - the shards to cache

create

public static Shard create(long shardId)
Creates a new shard with the primary key. Does not add the shard to the database.

Parameters:
shardId - the primary key for the new shard
Returns:
the new shard

remove

public static Shard remove(long shardId)
                    throws NoSuchShardException,
                           SystemException
Removes the shard with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
shardId - the primary key of the shard to remove
Returns:
the shard that was removed
Throws:
NoSuchShardException - if a shard with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

public static Shard updateImpl(Shard shard,
                               boolean merge)
                        throws SystemException
Throws:
SystemException

findByPrimaryKey

public static Shard findByPrimaryKey(long shardId)
                              throws NoSuchShardException,
                                     SystemException
Finds the shard with the primary key or throws a NoSuchShardException if it could not be found.

Parameters:
shardId - the primary key of the shard to find
Returns:
the shard
Throws:
NoSuchShardException - if a shard with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

public static Shard fetchByPrimaryKey(long shardId)
                               throws SystemException
Finds the shard with the primary key or returns null if it could not be found.

Parameters:
shardId - the primary key of the shard to find
Returns:
the shard, or null if a shard with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findByName

public static Shard findByName(String name)
                        throws NoSuchShardException,
                               SystemException
Finds the shard where name = ? or throws a NoSuchShardException if it could not be found.

Parameters:
name - the name to search with
Returns:
the matching shard
Throws:
NoSuchShardException - if a matching shard could not be found
SystemException - if a system exception occurred

fetchByName

public static Shard fetchByName(String name)
                         throws SystemException
Finds the shard where name = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
name - the name to search with
Returns:
the matching shard, or null if a matching shard could not be found
Throws:
SystemException - if a system exception occurred

fetchByName

public static Shard fetchByName(String name,
                                boolean retrieveFromCache)
                         throws SystemException
Finds the shard where name = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
name - the name to search with
Returns:
the matching shard, or null if a matching shard could not be found
Throws:
SystemException - if a system exception occurred

findByC_C

public static Shard findByC_C(long classNameId,
                              long classPK)
                       throws NoSuchShardException,
                              SystemException
Finds the shard where classNameId = ? and classPK = ? or throws a NoSuchShardException if it could not be found.

Parameters:
classNameId - the class name id to search with
classPK - the class p k to search with
Returns:
the matching shard
Throws:
NoSuchShardException - if a matching shard could not be found
SystemException - if a system exception occurred

fetchByC_C

public static Shard fetchByC_C(long classNameId,
                               long classPK)
                        throws SystemException
Finds the shard where classNameId = ? and classPK = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
classNameId - the class name id to search with
classPK - the class p k to search with
Returns:
the matching shard, or null if a matching shard could not be found
Throws:
SystemException - if a system exception occurred

fetchByC_C

public static Shard fetchByC_C(long classNameId,
                               long classPK,
                               boolean retrieveFromCache)
                        throws SystemException
Finds the shard where classNameId = ? and classPK = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
classNameId - the class name id to search with
classPK - the class p k to search with
Returns:
the matching shard, or null if a matching shard could not be found
Throws:
SystemException - if a system exception occurred

findAll

public static List<Shard> findAll()
                           throws SystemException
Finds all the shards.

Returns:
the shards
Throws:
SystemException - if a system exception occurred

findAll

public static List<Shard> findAll(int start,
                                  int end)
                           throws SystemException
Finds a range of all the shards.

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.

Parameters:
start - the lower bound of the range of shards to return
end - the upper bound of the range of shards to return (not inclusive)
Returns:
the range of shards
Throws:
SystemException - if a system exception occurred

findAll

public static List<Shard> findAll(int start,
                                  int end,
                                  OrderByComparator orderByComparator)
                           throws SystemException
Finds an ordered range of all the shards.

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.

Parameters:
start - the lower bound of the range of shards to return
end - the upper bound of the range of shards to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of shards
Throws:
SystemException - if a system exception occurred

removeByName

public static void removeByName(String name)
                         throws NoSuchShardException,
                                SystemException
Removes the shard where name = ? from the database.

Parameters:
name - the name to search with
Throws:
SystemException - if a system exception occurred
NoSuchShardException

removeByC_C

public static void removeByC_C(long classNameId,
                               long classPK)
                        throws NoSuchShardException,
                               SystemException
Removes the shard where classNameId = ? and classPK = ? from the database.

Parameters:
classNameId - the class name id to search with
classPK - the class p k to search with
Throws:
SystemException - if a system exception occurred
NoSuchShardException

removeAll

public static void removeAll()
                      throws SystemException
Removes all the shards from the database.

Throws:
SystemException - if a system exception occurred

countByName

public static int countByName(String name)
                       throws SystemException
Counts all the shards where name = ?.

Parameters:
name - the name to search with
Returns:
the number of matching shards
Throws:
SystemException - if a system exception occurred

countByC_C

public static int countByC_C(long classNameId,
                             long classPK)
                      throws SystemException
Counts all the shards where classNameId = ? and classPK = ?.

Parameters:
classNameId - the class name id to search with
classPK - the class p k to search with
Returns:
the number of matching shards
Throws:
SystemException - if a system exception occurred

countAll

public static int countAll()
                    throws SystemException
Counts all the shards.

Returns:
the number of shards
Throws:
SystemException - if a system exception occurred

getPersistence

public static ShardPersistence getPersistence()

setPersistence

public void setPersistence(ShardPersistence persistence)

Liferay 6.0-ee