Liferay 6.2-ce-ga5

com.liferay.portlet.shopping.service.persistence
Class ShoppingCouponUtil

java.lang.Object
  extended by com.liferay.portlet.shopping.service.persistence.ShoppingCouponUtil

@ProviderType
public class ShoppingCouponUtil
extends Object

The persistence utility for the shopping coupon service. This utility wraps ShoppingCouponPersistenceImpl 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

See Also:
ShoppingCouponPersistence, ShoppingCouponPersistenceImpl

Constructor Summary
ShoppingCouponUtil()
           
 
Method Summary
static void cacheResult(List<ShoppingCoupon> shoppingCoupons)
          Caches the shopping coupons in the entity cache if it is enabled.
static void cacheResult(ShoppingCoupon shoppingCoupon)
          Caches the shopping coupon in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(ShoppingCoupon shoppingCoupon)
           
static int countAll()
          Returns the number of shopping coupons.
static int countByCode(String code)
          Returns the number of shopping coupons where code = ?.
static int countByGroupId(long groupId)
          Returns the number of shopping coupons where groupId = ?.
static long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static ShoppingCoupon create(long couponId)
          Creates a new shopping coupon with the primary key.
static ShoppingCoupon fetchByCode(String code)
          Returns the shopping coupon where code = ? or returns null if it could not be found.
static ShoppingCoupon fetchByCode(String code, boolean retrieveFromCache)
          Returns the shopping coupon where code = ? or returns null if it could not be found, optionally using the finder cache.
static ShoppingCoupon fetchByGroupId_First(long groupId, OrderByComparator orderByComparator)
          Returns the first shopping coupon in the ordered set where groupId = ?.
static ShoppingCoupon fetchByGroupId_Last(long groupId, OrderByComparator orderByComparator)
          Returns the last shopping coupon in the ordered set where groupId = ?.
static ShoppingCoupon fetchByPrimaryKey(long couponId)
          Returns the shopping coupon with the primary key or returns null if it could not be found.
static List<ShoppingCoupon> findAll()
          Returns all the shopping coupons.
static List<ShoppingCoupon> findAll(int start, int end)
          Returns a range of all the shopping coupons.
static List<ShoppingCoupon> findAll(int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the shopping coupons.
static ShoppingCoupon findByCode(String code)
          Returns the shopping coupon where code = ? or throws a NoSuchCouponException if it could not be found.
static ShoppingCoupon findByGroupId_First(long groupId, OrderByComparator orderByComparator)
          Returns the first shopping coupon in the ordered set where groupId = ?.
static ShoppingCoupon findByGroupId_Last(long groupId, OrderByComparator orderByComparator)
          Returns the last shopping coupon in the ordered set where groupId = ?.
static ShoppingCoupon[] findByGroupId_PrevAndNext(long couponId, long groupId, OrderByComparator orderByComparator)
          Returns the shopping coupons before and after the current shopping coupon in the ordered set where groupId = ?.
static List<ShoppingCoupon> findByGroupId(long groupId)
          Returns all the shopping coupons where groupId = ?.
static List<ShoppingCoupon> findByGroupId(long groupId, int start, int end)
          Returns a range of all the shopping coupons where groupId = ?.
static List<ShoppingCoupon> findByGroupId(long groupId, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the shopping coupons where groupId = ?.
static ShoppingCoupon findByPrimaryKey(long couponId)
          Returns the shopping coupon with the primary key or throws a NoSuchCouponException if it could not be found.
static List<ShoppingCoupon> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<ShoppingCoupon> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<ShoppingCoupon> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
           
static ShoppingCouponPersistence getPersistence()
           
static ShoppingCoupon remove(long couponId)
          Removes the shopping coupon with the primary key from the database.
static void removeAll()
          Removes all the shopping coupons from the database.
static ShoppingCoupon removeByCode(String code)
          Removes the shopping coupon where code = ? from the database.
static void removeByGroupId(long groupId)
          Removes all the shopping coupons where groupId = ? from the database.
 void setPersistence(ShoppingCouponPersistence persistence)
          Deprecated. As of 6.2.0
static ShoppingCoupon update(ShoppingCoupon shoppingCoupon)
           
static ShoppingCoupon update(ShoppingCoupon shoppingCoupon, ServiceContext serviceContext)
           
static ShoppingCoupon updateImpl(ShoppingCoupon shoppingCoupon)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShoppingCouponUtil

public ShoppingCouponUtil()
Method Detail

clearCache

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

clearCache

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

countWithDynamicQuery

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

findWithDynamicQuery

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

findWithDynamicQuery

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

findWithDynamicQuery

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

update

public static ShoppingCoupon update(ShoppingCoupon shoppingCoupon)
                             throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel)

update

public static ShoppingCoupon update(ShoppingCoupon shoppingCoupon,
                                    ServiceContext serviceContext)
                             throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, ServiceContext)

findByGroupId

public static List<ShoppingCoupon> findByGroupId(long groupId)
                                          throws SystemException
Returns all the shopping coupons where groupId = ?.

Parameters:
groupId - the group ID
Returns:
the matching shopping coupons
Throws:
SystemException - if a system exception occurred

findByGroupId

public static List<ShoppingCoupon> findByGroupId(long groupId,
                                                 int start,
                                                 int end)
                                          throws SystemException
Returns a range of all the shopping coupons where groupId = ?.

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 ShoppingCouponModelImpl. 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.

Parameters:
groupId - the group ID
start - the lower bound of the range of shopping coupons
end - the upper bound of the range of shopping coupons (not inclusive)
Returns:
the range of matching shopping coupons
Throws:
SystemException - if a system exception occurred

findByGroupId

public static List<ShoppingCoupon> findByGroupId(long groupId,
                                                 int start,
                                                 int end,
                                                 OrderByComparator orderByComparator)
                                          throws SystemException
Returns an ordered range of all the shopping coupons where groupId = ?.

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 ShoppingCouponModelImpl. 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.

Parameters:
groupId - the group ID
start - the lower bound of the range of shopping coupons
end - the upper bound of the range of shopping coupons (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching shopping coupons
Throws:
SystemException - if a system exception occurred

findByGroupId_First

public static ShoppingCoupon findByGroupId_First(long groupId,
                                                 OrderByComparator orderByComparator)
                                          throws SystemException,
                                                 NoSuchCouponException
Returns the first shopping coupon in the ordered set where groupId = ?.

Parameters:
groupId - the group ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching shopping coupon
Throws:
NoSuchCouponException - if a matching shopping coupon could not be found
SystemException - if a system exception occurred

fetchByGroupId_First

public static ShoppingCoupon fetchByGroupId_First(long groupId,
                                                  OrderByComparator orderByComparator)
                                           throws SystemException
Returns the first shopping coupon in the ordered set where groupId = ?.

Parameters:
groupId - the group ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching shopping coupon, or null if a matching shopping coupon could not be found
Throws:
SystemException - if a system exception occurred

findByGroupId_Last

public static ShoppingCoupon findByGroupId_Last(long groupId,
                                                OrderByComparator orderByComparator)
                                         throws SystemException,
                                                NoSuchCouponException
Returns the last shopping coupon in the ordered set where groupId = ?.

Parameters:
groupId - the group ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching shopping coupon
Throws:
NoSuchCouponException - if a matching shopping coupon could not be found
SystemException - if a system exception occurred

fetchByGroupId_Last

public static ShoppingCoupon fetchByGroupId_Last(long groupId,
                                                 OrderByComparator orderByComparator)
                                          throws SystemException
Returns the last shopping coupon in the ordered set where groupId = ?.

Parameters:
groupId - the group ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching shopping coupon, or null if a matching shopping coupon could not be found
Throws:
SystemException - if a system exception occurred

findByGroupId_PrevAndNext

public static ShoppingCoupon[] findByGroupId_PrevAndNext(long couponId,
                                                         long groupId,
                                                         OrderByComparator orderByComparator)
                                                  throws SystemException,
                                                         NoSuchCouponException
Returns the shopping coupons before and after the current shopping coupon in the ordered set where groupId = ?.

Parameters:
couponId - the primary key of the current shopping coupon
groupId - the group ID
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next shopping coupon
Throws:
NoSuchCouponException - if a shopping coupon with the primary key could not be found
SystemException - if a system exception occurred

removeByGroupId

public static void removeByGroupId(long groupId)
                            throws SystemException
Removes all the shopping coupons where groupId = ? from the database.

Parameters:
groupId - the group ID
Throws:
SystemException - if a system exception occurred

countByGroupId

public static int countByGroupId(long groupId)
                          throws SystemException
Returns the number of shopping coupons where groupId = ?.

Parameters:
groupId - the group ID
Returns:
the number of matching shopping coupons
Throws:
SystemException - if a system exception occurred

findByCode

public static ShoppingCoupon findByCode(String code)
                                 throws SystemException,
                                        NoSuchCouponException
Returns the shopping coupon where code = ? or throws a NoSuchCouponException if it could not be found.

Parameters:
code - the code
Returns:
the matching shopping coupon
Throws:
NoSuchCouponException - if a matching shopping coupon could not be found
SystemException - if a system exception occurred

fetchByCode

public static ShoppingCoupon fetchByCode(String code)
                                  throws SystemException
Returns the shopping coupon where code = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
code - the code
Returns:
the matching shopping coupon, or null if a matching shopping coupon could not be found
Throws:
SystemException - if a system exception occurred

fetchByCode

public static ShoppingCoupon fetchByCode(String code,
                                         boolean retrieveFromCache)
                                  throws SystemException
Returns the shopping coupon where code = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
code - the code
retrieveFromCache - whether to use the finder cache
Returns:
the matching shopping coupon, or null if a matching shopping coupon could not be found
Throws:
SystemException - if a system exception occurred

removeByCode

public static ShoppingCoupon removeByCode(String code)
                                   throws SystemException,
                                          NoSuchCouponException
Removes the shopping coupon where code = ? from the database.

Parameters:
code - the code
Returns:
the shopping coupon that was removed
Throws:
SystemException - if a system exception occurred
NoSuchCouponException

countByCode

public static int countByCode(String code)
                       throws SystemException
Returns the number of shopping coupons where code = ?.

Parameters:
code - the code
Returns:
the number of matching shopping coupons
Throws:
SystemException - if a system exception occurred

cacheResult

public static void cacheResult(ShoppingCoupon shoppingCoupon)
Caches the shopping coupon in the entity cache if it is enabled.

Parameters:
shoppingCoupon - the shopping coupon

cacheResult

public static void cacheResult(List<ShoppingCoupon> shoppingCoupons)
Caches the shopping coupons in the entity cache if it is enabled.

Parameters:
shoppingCoupons - the shopping coupons

create

public static ShoppingCoupon create(long couponId)
Creates a new shopping coupon with the primary key. Does not add the shopping coupon to the database.

Parameters:
couponId - the primary key for the new shopping coupon
Returns:
the new shopping coupon

remove

public static ShoppingCoupon remove(long couponId)
                             throws SystemException,
                                    NoSuchCouponException
Removes the shopping coupon with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
couponId - the primary key of the shopping coupon
Returns:
the shopping coupon that was removed
Throws:
NoSuchCouponException - if a shopping coupon with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

public static ShoppingCoupon updateImpl(ShoppingCoupon shoppingCoupon)
                                 throws SystemException
Throws:
SystemException

findByPrimaryKey

public static ShoppingCoupon findByPrimaryKey(long couponId)
                                       throws SystemException,
                                              NoSuchCouponException
Returns the shopping coupon with the primary key or throws a NoSuchCouponException if it could not be found.

Parameters:
couponId - the primary key of the shopping coupon
Returns:
the shopping coupon
Throws:
NoSuchCouponException - if a shopping coupon with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

public static ShoppingCoupon fetchByPrimaryKey(long couponId)
                                        throws SystemException
Returns the shopping coupon with the primary key or returns null if it could not be found.

Parameters:
couponId - the primary key of the shopping coupon
Returns:
the shopping coupon, or null if a shopping coupon with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findAll

public static List<ShoppingCoupon> findAll()
                                    throws SystemException
Returns all the shopping coupons.

Returns:
the shopping coupons
Throws:
SystemException - if a system exception occurred

findAll

public static List<ShoppingCoupon> findAll(int start,
                                           int end)
                                    throws SystemException
Returns a range of all the shopping coupons.

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 ShoppingCouponModelImpl. 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.

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

findAll

public static List<ShoppingCoupon> findAll(int start,
                                           int end,
                                           OrderByComparator orderByComparator)
                                    throws SystemException
Returns an ordered range of all the shopping coupons.

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 ShoppingCouponModelImpl. 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.

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

removeAll

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

Throws:
SystemException - if a system exception occurred

countAll

public static int countAll()
                    throws SystemException
Returns the number of shopping coupons.

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

getPersistence

public static ShoppingCouponPersistence getPersistence()

setPersistence

public void setPersistence(ShoppingCouponPersistence persistence)
Deprecated. As of 6.2.0


Liferay 6.2-ce-ga5