Liferay 6.0.5

com.liferay.portlet.shopping.service.persistence
Interface ShoppingCouponPersistence

All Superinterfaces:
BasePersistence<ShoppingCoupon>
All Known Implementing Classes:
ShoppingCouponPersistenceImpl

public interface ShoppingCouponPersistence
extends BasePersistence<ShoppingCoupon>

The persistence interface for the shopping coupon service.

Never modify or reference this interface directly. Always use ShoppingCouponUtil to access the shopping coupon persistence. Modify service.xml and rerun ServiceBuilder to regenerate this interface.

Caching information and settings can be found in portal.properties

See Also:
ShoppingCouponPersistenceImpl, ShoppingCouponUtil
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time is generated.

Method Summary
 void cacheResult(List<ShoppingCoupon> shoppingCoupons)
          Caches the shopping coupons in the entity cache if it is enabled.
 void cacheResult(ShoppingCoupon shoppingCoupon)
          Caches the shopping coupon in the entity cache if it is enabled.
 int countAll()
          Counts all the shopping coupons.
 int countByCode(String code)
          Counts all the shopping coupons where code = ?.
 int countByGroupId(long groupId)
          Counts all the shopping coupons where groupId = ?.
 ShoppingCoupon create(long couponId)
          Creates a new shopping coupon with the primary key.
 ShoppingCoupon fetchByCode(String code)
          Finds the shopping coupon where code = ? or returns null if it could not be found.
 ShoppingCoupon fetchByCode(String code, boolean retrieveFromCache)
          Finds the shopping coupon where code = ? or returns null if it could not be found, optionally using the finder cache.
 ShoppingCoupon fetchByPrimaryKey(long couponId)
          Finds the shopping coupon with the primary key or returns null if it could not be found.
 List<ShoppingCoupon> findAll()
          Finds all the shopping coupons.
 List<ShoppingCoupon> findAll(int start, int end)
          Finds a range of all the shopping coupons.
 List<ShoppingCoupon> findAll(int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the shopping coupons.
 ShoppingCoupon findByCode(String code)
          Finds the shopping coupon where code = ? or throws a NoSuchCouponException if it could not be found.
 ShoppingCoupon findByGroupId_First(long groupId, OrderByComparator orderByComparator)
          Finds the first shopping coupon in the ordered set where groupId = ?.
 ShoppingCoupon findByGroupId_Last(long groupId, OrderByComparator orderByComparator)
          Finds the last shopping coupon in the ordered set where groupId = ?.
 ShoppingCoupon[] findByGroupId_PrevAndNext(long couponId, long groupId, OrderByComparator orderByComparator)
          Finds the shopping coupons before and after the current shopping coupon in the ordered set where groupId = ?.
 List<ShoppingCoupon> findByGroupId(long groupId)
          Finds all the shopping coupons where groupId = ?.
 List<ShoppingCoupon> findByGroupId(long groupId, int start, int end)
          Finds a range of all the shopping coupons where groupId = ?.
 List<ShoppingCoupon> findByGroupId(long groupId, int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the shopping coupons where groupId = ?.
 ShoppingCoupon findByPrimaryKey(long couponId)
          Finds the shopping coupon with the primary key or throws a NoSuchCouponException if it could not be found.
 ShoppingCoupon remove(long couponId)
          Removes the shopping coupon with the primary key from the database.
 void removeAll()
          Removes all the shopping coupons from the database.
 void removeByCode(String code)
          Removes the shopping coupon where code = ? from the database.
 void removeByGroupId(long groupId)
          Removes all the shopping coupons where groupId = ? from the database.
 ShoppingCoupon updateImpl(ShoppingCoupon shoppingCoupon, boolean merge)
           
 
Methods inherited from interface com.liferay.portal.service.persistence.BasePersistence
clearCache, clearCache, countWithDynamicQuery, fetchByPrimaryKey, findByPrimaryKey, findWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, getDataSource, getListeners, registerListener, remove, remove, setDataSource, unregisterListener, update, update
 

Method Detail

cacheResult

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

Parameters:
shoppingCoupon - the shopping coupon to cache

cacheResult

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

Parameters:
shoppingCoupons - the shopping coupons to cache

create

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

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 to remove
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

ShoppingCoupon updateImpl(ShoppingCoupon shoppingCoupon,
                          boolean merge)
                          throws SystemException
Throws:
SystemException

findByPrimaryKey

ShoppingCoupon findByPrimaryKey(long couponId)
                                throws SystemException,
                                       NoSuchCouponException
Finds 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 to find
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

ShoppingCoupon fetchByPrimaryKey(long couponId)
                                 throws SystemException
Finds 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 to find
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

findByGroupId

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

Parameters:
groupId - the group id to search with
Returns:
the matching shopping coupons
Throws:
SystemException - if a system exception occurred

findByGroupId

List<ShoppingCoupon> findByGroupId(long groupId,
                                   int start,
                                   int end)
                                   throws SystemException
Finds 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.

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

findByGroupId

List<ShoppingCoupon> findByGroupId(long groupId,
                                   int start,
                                   int end,
                                   OrderByComparator orderByComparator)
                                   throws SystemException
Finds 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.

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

findByGroupId_First

ShoppingCoupon findByGroupId_First(long groupId,
                                   OrderByComparator orderByComparator)
                                   throws SystemException,
                                          NoSuchCouponException
Finds the first shopping coupon in the ordered set 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.

Parameters:
groupId - the group id to search with
orderByComparator - the comparator to order the set by
Returns:
the first matching shopping coupon
Throws:
NoSuchCouponException - if a matching shopping coupon could not be found
SystemException - if a system exception occurred

findByGroupId_Last

ShoppingCoupon findByGroupId_Last(long groupId,
                                  OrderByComparator orderByComparator)
                                  throws SystemException,
                                         NoSuchCouponException
Finds the last shopping coupon in the ordered set 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.

Parameters:
groupId - the group id to search with
orderByComparator - the comparator to order the set by
Returns:
the last matching shopping coupon
Throws:
NoSuchCouponException - if a matching shopping coupon could not be found
SystemException - if a system exception occurred

findByGroupId_PrevAndNext

ShoppingCoupon[] findByGroupId_PrevAndNext(long couponId,
                                           long groupId,
                                           OrderByComparator orderByComparator)
                                           throws SystemException,
                                                  NoSuchCouponException
Finds the shopping coupons before and after the current shopping coupon in the ordered set 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.

Parameters:
couponId - the primary key of the current shopping coupon
groupId - the group id to search with
orderByComparator - the comparator to order the set by
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

findByCode

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

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

fetchByCode

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

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

fetchByCode

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

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

findAll

List<ShoppingCoupon> findAll()
                             throws SystemException
Finds all the shopping coupons.

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

findAll

List<ShoppingCoupon> findAll(int start,
                             int end)
                             throws SystemException
Finds 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.

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

findAll

List<ShoppingCoupon> findAll(int start,
                             int end,
                             OrderByComparator orderByComparator)
                             throws SystemException
Finds 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.

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

removeByGroupId

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

Parameters:
groupId - the group id to search with
Throws:
SystemException - if a system exception occurred

removeByCode

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

Parameters:
code - the code to search with
Throws:
SystemException - if a system exception occurred
NoSuchCouponException

removeAll

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

Throws:
SystemException - if a system exception occurred

countByGroupId

int countByGroupId(long groupId)
                   throws SystemException
Counts all the shopping coupons where groupId = ?.

Parameters:
groupId - the group id to search with
Returns:
the number of matching shopping coupons
Throws:
SystemException - if a system exception occurred

countByCode

int countByCode(String code)
                throws SystemException
Counts all the shopping coupons where code = ?.

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

countAll

int countAll()
             throws SystemException
Counts all the shopping coupons.

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

Liferay 6.0.5