Liferay 6.2-ce-ga5

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

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

@ProviderType
public class ShoppingItemUtil
extends Object

The persistence utility for the shopping item service. This utility wraps ShoppingItemPersistenceImpl 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:
ShoppingItemPersistence, ShoppingItemPersistenceImpl

Constructor Summary
ShoppingItemUtil()
           
 
Method Summary
static void cacheResult(List<ShoppingItem> shoppingItems)
          Caches the shopping items in the entity cache if it is enabled.
static void cacheResult(ShoppingItem shoppingItem)
          Caches the shopping item in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(ShoppingItem shoppingItem)
           
static int countAll()
          Returns the number of shopping items.
static int countByC_S(long companyId, String sku)
          Returns the number of shopping items where companyId = ? and sku = ?.
static int countByG_C(long groupId, long categoryId)
          Returns the number of shopping items where groupId = ? and categoryId = ?.
static int countByLargeImageId(long largeImageId)
          Returns the number of shopping items where largeImageId = ?.
static int countByMediumImageId(long mediumImageId)
          Returns the number of shopping items where mediumImageId = ?.
static int countBySmallImageId(long smallImageId)
          Returns the number of shopping items where smallImageId = ?.
static long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static ShoppingItem create(long itemId)
          Creates a new shopping item with the primary key.
static ShoppingItem fetchByC_S(long companyId, String sku)
          Returns the shopping item where companyId = ? and sku = ? or returns null if it could not be found.
static ShoppingItem fetchByC_S(long companyId, String sku, boolean retrieveFromCache)
          Returns the shopping item where companyId = ? and sku = ? or returns null if it could not be found, optionally using the finder cache.
static ShoppingItem fetchByG_C_First(long groupId, long categoryId, OrderByComparator orderByComparator)
          Returns the first shopping item in the ordered set where groupId = ? and categoryId = ?.
static ShoppingItem fetchByG_C_Last(long groupId, long categoryId, OrderByComparator orderByComparator)
          Returns the last shopping item in the ordered set where groupId = ? and categoryId = ?.
static ShoppingItem fetchByLargeImageId(long largeImageId)
          Returns the shopping item where largeImageId = ? or returns null if it could not be found.
static ShoppingItem fetchByLargeImageId(long largeImageId, boolean retrieveFromCache)
          Returns the shopping item where largeImageId = ? or returns null if it could not be found, optionally using the finder cache.
static ShoppingItem fetchByMediumImageId(long mediumImageId)
          Returns the shopping item where mediumImageId = ? or returns null if it could not be found.
static ShoppingItem fetchByMediumImageId(long mediumImageId, boolean retrieveFromCache)
          Returns the shopping item where mediumImageId = ? or returns null if it could not be found, optionally using the finder cache.
static ShoppingItem fetchByPrimaryKey(long itemId)
          Returns the shopping item with the primary key or returns null if it could not be found.
static ShoppingItem fetchBySmallImageId(long smallImageId)
          Returns the shopping item where smallImageId = ? or returns null if it could not be found.
static ShoppingItem fetchBySmallImageId(long smallImageId, boolean retrieveFromCache)
          Returns the shopping item where smallImageId = ? or returns null if it could not be found, optionally using the finder cache.
static int filterCountByG_C(long groupId, long categoryId)
          Returns the number of shopping items that the user has permission to view where groupId = ? and categoryId = ?.
static ShoppingItem[] filterFindByG_C_PrevAndNext(long itemId, long groupId, long categoryId, OrderByComparator orderByComparator)
          Returns the shopping items before and after the current shopping item in the ordered set of shopping items that the user has permission to view where groupId = ? and categoryId = ?.
static List<ShoppingItem> filterFindByG_C(long groupId, long categoryId)
          Returns all the shopping items that the user has permission to view where groupId = ? and categoryId = ?.
static List<ShoppingItem> filterFindByG_C(long groupId, long categoryId, int start, int end)
          Returns a range of all the shopping items that the user has permission to view where groupId = ? and categoryId = ?.
static List<ShoppingItem> filterFindByG_C(long groupId, long categoryId, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the shopping items that the user has permissions to view where groupId = ? and categoryId = ?.
static List<ShoppingItem> findAll()
          Returns all the shopping items.
static List<ShoppingItem> findAll(int start, int end)
          Returns a range of all the shopping items.
static List<ShoppingItem> findAll(int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the shopping items.
static ShoppingItem findByC_S(long companyId, String sku)
          Returns the shopping item where companyId = ? and sku = ? or throws a NoSuchItemException if it could not be found.
static ShoppingItem findByG_C_First(long groupId, long categoryId, OrderByComparator orderByComparator)
          Returns the first shopping item in the ordered set where groupId = ? and categoryId = ?.
static ShoppingItem findByG_C_Last(long groupId, long categoryId, OrderByComparator orderByComparator)
          Returns the last shopping item in the ordered set where groupId = ? and categoryId = ?.
static ShoppingItem[] findByG_C_PrevAndNext(long itemId, long groupId, long categoryId, OrderByComparator orderByComparator)
          Returns the shopping items before and after the current shopping item in the ordered set where groupId = ? and categoryId = ?.
static List<ShoppingItem> findByG_C(long groupId, long categoryId)
          Returns all the shopping items where groupId = ? and categoryId = ?.
static List<ShoppingItem> findByG_C(long groupId, long categoryId, int start, int end)
          Returns a range of all the shopping items where groupId = ? and categoryId = ?.
static List<ShoppingItem> findByG_C(long groupId, long categoryId, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the shopping items where groupId = ? and categoryId = ?.
static ShoppingItem findByLargeImageId(long largeImageId)
          Returns the shopping item where largeImageId = ? or throws a NoSuchItemException if it could not be found.
static ShoppingItem findByMediumImageId(long mediumImageId)
          Returns the shopping item where mediumImageId = ? or throws a NoSuchItemException if it could not be found.
static ShoppingItem findByPrimaryKey(long itemId)
          Returns the shopping item with the primary key or throws a NoSuchItemException if it could not be found.
static ShoppingItem findBySmallImageId(long smallImageId)
          Returns the shopping item where smallImageId = ? or throws a NoSuchItemException if it could not be found.
static List<ShoppingItem> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<ShoppingItem> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<ShoppingItem> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
           
static ShoppingItemPersistence getPersistence()
           
static ShoppingItem remove(long itemId)
          Removes the shopping item with the primary key from the database.
static void removeAll()
          Removes all the shopping items from the database.
static ShoppingItem removeByC_S(long companyId, String sku)
          Removes the shopping item where companyId = ? and sku = ? from the database.
static void removeByG_C(long groupId, long categoryId)
          Removes all the shopping items where groupId = ? and categoryId = ? from the database.
static ShoppingItem removeByLargeImageId(long largeImageId)
          Removes the shopping item where largeImageId = ? from the database.
static ShoppingItem removeByMediumImageId(long mediumImageId)
          Removes the shopping item where mediumImageId = ? from the database.
static ShoppingItem removeBySmallImageId(long smallImageId)
          Removes the shopping item where smallImageId = ? from the database.
 void setPersistence(ShoppingItemPersistence persistence)
          Deprecated. As of 6.2.0
static ShoppingItem update(ShoppingItem shoppingItem)
           
static ShoppingItem update(ShoppingItem shoppingItem, ServiceContext serviceContext)
           
static ShoppingItem updateImpl(ShoppingItem shoppingItem)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShoppingItemUtil

public ShoppingItemUtil()
Method Detail

clearCache

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

clearCache

public static void clearCache(ShoppingItem shoppingItem)
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<ShoppingItem> findWithDynamicQuery(DynamicQuery dynamicQuery)
                                               throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

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

findWithDynamicQuery

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

update

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

update

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

findBySmallImageId

public static ShoppingItem findBySmallImageId(long smallImageId)
                                       throws SystemException,
                                              NoSuchItemException
Returns the shopping item where smallImageId = ? or throws a NoSuchItemException if it could not be found.

Parameters:
smallImageId - the small image ID
Returns:
the matching shopping item
Throws:
NoSuchItemException - if a matching shopping item could not be found
SystemException - if a system exception occurred

fetchBySmallImageId

public static ShoppingItem fetchBySmallImageId(long smallImageId)
                                        throws SystemException
Returns the shopping item where smallImageId = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
smallImageId - the small image ID
Returns:
the matching shopping item, or null if a matching shopping item could not be found
Throws:
SystemException - if a system exception occurred

fetchBySmallImageId

public static ShoppingItem fetchBySmallImageId(long smallImageId,
                                               boolean retrieveFromCache)
                                        throws SystemException
Returns the shopping item where smallImageId = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
smallImageId - the small image ID
retrieveFromCache - whether to use the finder cache
Returns:
the matching shopping item, or null if a matching shopping item could not be found
Throws:
SystemException - if a system exception occurred

removeBySmallImageId

public static ShoppingItem removeBySmallImageId(long smallImageId)
                                         throws SystemException,
                                                NoSuchItemException
Removes the shopping item where smallImageId = ? from the database.

Parameters:
smallImageId - the small image ID
Returns:
the shopping item that was removed
Throws:
SystemException - if a system exception occurred
NoSuchItemException

countBySmallImageId

public static int countBySmallImageId(long smallImageId)
                               throws SystemException
Returns the number of shopping items where smallImageId = ?.

Parameters:
smallImageId - the small image ID
Returns:
the number of matching shopping items
Throws:
SystemException - if a system exception occurred

findByMediumImageId

public static ShoppingItem findByMediumImageId(long mediumImageId)
                                        throws SystemException,
                                               NoSuchItemException
Returns the shopping item where mediumImageId = ? or throws a NoSuchItemException if it could not be found.

Parameters:
mediumImageId - the medium image ID
Returns:
the matching shopping item
Throws:
NoSuchItemException - if a matching shopping item could not be found
SystemException - if a system exception occurred

fetchByMediumImageId

public static ShoppingItem fetchByMediumImageId(long mediumImageId)
                                         throws SystemException
Returns the shopping item where mediumImageId = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
mediumImageId - the medium image ID
Returns:
the matching shopping item, or null if a matching shopping item could not be found
Throws:
SystemException - if a system exception occurred

fetchByMediumImageId

public static ShoppingItem fetchByMediumImageId(long mediumImageId,
                                                boolean retrieveFromCache)
                                         throws SystemException
Returns the shopping item where mediumImageId = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
mediumImageId - the medium image ID
retrieveFromCache - whether to use the finder cache
Returns:
the matching shopping item, or null if a matching shopping item could not be found
Throws:
SystemException - if a system exception occurred

removeByMediumImageId

public static ShoppingItem removeByMediumImageId(long mediumImageId)
                                          throws SystemException,
                                                 NoSuchItemException
Removes the shopping item where mediumImageId = ? from the database.

Parameters:
mediumImageId - the medium image ID
Returns:
the shopping item that was removed
Throws:
SystemException - if a system exception occurred
NoSuchItemException

countByMediumImageId

public static int countByMediumImageId(long mediumImageId)
                                throws SystemException
Returns the number of shopping items where mediumImageId = ?.

Parameters:
mediumImageId - the medium image ID
Returns:
the number of matching shopping items
Throws:
SystemException - if a system exception occurred

findByLargeImageId

public static ShoppingItem findByLargeImageId(long largeImageId)
                                       throws SystemException,
                                              NoSuchItemException
Returns the shopping item where largeImageId = ? or throws a NoSuchItemException if it could not be found.

Parameters:
largeImageId - the large image ID
Returns:
the matching shopping item
Throws:
NoSuchItemException - if a matching shopping item could not be found
SystemException - if a system exception occurred

fetchByLargeImageId

public static ShoppingItem fetchByLargeImageId(long largeImageId)
                                        throws SystemException
Returns the shopping item where largeImageId = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
largeImageId - the large image ID
Returns:
the matching shopping item, or null if a matching shopping item could not be found
Throws:
SystemException - if a system exception occurred

fetchByLargeImageId

public static ShoppingItem fetchByLargeImageId(long largeImageId,
                                               boolean retrieveFromCache)
                                        throws SystemException
Returns the shopping item where largeImageId = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
largeImageId - the large image ID
retrieveFromCache - whether to use the finder cache
Returns:
the matching shopping item, or null if a matching shopping item could not be found
Throws:
SystemException - if a system exception occurred

removeByLargeImageId

public static ShoppingItem removeByLargeImageId(long largeImageId)
                                         throws SystemException,
                                                NoSuchItemException
Removes the shopping item where largeImageId = ? from the database.

Parameters:
largeImageId - the large image ID
Returns:
the shopping item that was removed
Throws:
SystemException - if a system exception occurred
NoSuchItemException

countByLargeImageId

public static int countByLargeImageId(long largeImageId)
                               throws SystemException
Returns the number of shopping items where largeImageId = ?.

Parameters:
largeImageId - the large image ID
Returns:
the number of matching shopping items
Throws:
SystemException - if a system exception occurred

findByG_C

public static List<ShoppingItem> findByG_C(long groupId,
                                           long categoryId)
                                    throws SystemException
Returns all the shopping items where groupId = ? and categoryId = ?.

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

findByG_C

public static List<ShoppingItem> findByG_C(long groupId,
                                           long categoryId,
                                           int start,
                                           int end)
                                    throws SystemException
Returns a range of all the shopping items where groupId = ? and categoryId = ?.

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 ShoppingItemModelImpl. 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
categoryId - the category ID
start - the lower bound of the range of shopping items
end - the upper bound of the range of shopping items (not inclusive)
Returns:
the range of matching shopping items
Throws:
SystemException - if a system exception occurred

findByG_C

public static List<ShoppingItem> findByG_C(long groupId,
                                           long categoryId,
                                           int start,
                                           int end,
                                           OrderByComparator orderByComparator)
                                    throws SystemException
Returns an ordered range of all the shopping items where groupId = ? and categoryId = ?.

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 ShoppingItemModelImpl. 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
categoryId - the category ID
start - the lower bound of the range of shopping items
end - the upper bound of the range of shopping items (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching shopping items
Throws:
SystemException - if a system exception occurred

findByG_C_First

public static ShoppingItem findByG_C_First(long groupId,
                                           long categoryId,
                                           OrderByComparator orderByComparator)
                                    throws SystemException,
                                           NoSuchItemException
Returns the first shopping item in the ordered set where groupId = ? and categoryId = ?.

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

fetchByG_C_First

public static ShoppingItem fetchByG_C_First(long groupId,
                                            long categoryId,
                                            OrderByComparator orderByComparator)
                                     throws SystemException
Returns the first shopping item in the ordered set where groupId = ? and categoryId = ?.

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

findByG_C_Last

public static ShoppingItem findByG_C_Last(long groupId,
                                          long categoryId,
                                          OrderByComparator orderByComparator)
                                   throws SystemException,
                                          NoSuchItemException
Returns the last shopping item in the ordered set where groupId = ? and categoryId = ?.

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

fetchByG_C_Last

public static ShoppingItem fetchByG_C_Last(long groupId,
                                           long categoryId,
                                           OrderByComparator orderByComparator)
                                    throws SystemException
Returns the last shopping item in the ordered set where groupId = ? and categoryId = ?.

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

findByG_C_PrevAndNext

public static ShoppingItem[] findByG_C_PrevAndNext(long itemId,
                                                   long groupId,
                                                   long categoryId,
                                                   OrderByComparator orderByComparator)
                                            throws SystemException,
                                                   NoSuchItemException
Returns the shopping items before and after the current shopping item in the ordered set where groupId = ? and categoryId = ?.

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

filterFindByG_C

public static List<ShoppingItem> filterFindByG_C(long groupId,
                                                 long categoryId)
                                          throws SystemException
Returns all the shopping items that the user has permission to view where groupId = ? and categoryId = ?.

Parameters:
groupId - the group ID
categoryId - the category ID
Returns:
the matching shopping items that the user has permission to view
Throws:
SystemException - if a system exception occurred

filterFindByG_C

public static List<ShoppingItem> filterFindByG_C(long groupId,
                                                 long categoryId,
                                                 int start,
                                                 int end)
                                          throws SystemException
Returns a range of all the shopping items that the user has permission to view where groupId = ? and categoryId = ?.

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 ShoppingItemModelImpl. 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
categoryId - the category ID
start - the lower bound of the range of shopping items
end - the upper bound of the range of shopping items (not inclusive)
Returns:
the range of matching shopping items that the user has permission to view
Throws:
SystemException - if a system exception occurred

filterFindByG_C

public static List<ShoppingItem> filterFindByG_C(long groupId,
                                                 long categoryId,
                                                 int start,
                                                 int end,
                                                 OrderByComparator orderByComparator)
                                          throws SystemException
Returns an ordered range of all the shopping items that the user has permissions to view where groupId = ? and categoryId = ?.

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 ShoppingItemModelImpl. 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
categoryId - the category ID
start - the lower bound of the range of shopping items
end - the upper bound of the range of shopping items (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching shopping items that the user has permission to view
Throws:
SystemException - if a system exception occurred

filterFindByG_C_PrevAndNext

public static ShoppingItem[] filterFindByG_C_PrevAndNext(long itemId,
                                                         long groupId,
                                                         long categoryId,
                                                         OrderByComparator orderByComparator)
                                                  throws SystemException,
                                                         NoSuchItemException
Returns the shopping items before and after the current shopping item in the ordered set of shopping items that the user has permission to view where groupId = ? and categoryId = ?.

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

removeByG_C

public static void removeByG_C(long groupId,
                               long categoryId)
                        throws SystemException
Removes all the shopping items where groupId = ? and categoryId = ? from the database.

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

countByG_C

public static int countByG_C(long groupId,
                             long categoryId)
                      throws SystemException
Returns the number of shopping items where groupId = ? and categoryId = ?.

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

filterCountByG_C

public static int filterCountByG_C(long groupId,
                                   long categoryId)
                            throws SystemException
Returns the number of shopping items that the user has permission to view where groupId = ? and categoryId = ?.

Parameters:
groupId - the group ID
categoryId - the category ID
Returns:
the number of matching shopping items that the user has permission to view
Throws:
SystemException - if a system exception occurred

findByC_S

public static ShoppingItem findByC_S(long companyId,
                                     String sku)
                              throws SystemException,
                                     NoSuchItemException
Returns the shopping item where companyId = ? and sku = ? or throws a NoSuchItemException if it could not be found.

Parameters:
companyId - the company ID
sku - the sku
Returns:
the matching shopping item
Throws:
NoSuchItemException - if a matching shopping item could not be found
SystemException - if a system exception occurred

fetchByC_S

public static ShoppingItem fetchByC_S(long companyId,
                                      String sku)
                               throws SystemException
Returns the shopping item where companyId = ? and sku = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
companyId - the company ID
sku - the sku
Returns:
the matching shopping item, or null if a matching shopping item could not be found
Throws:
SystemException - if a system exception occurred

fetchByC_S

public static ShoppingItem fetchByC_S(long companyId,
                                      String sku,
                                      boolean retrieveFromCache)
                               throws SystemException
Returns the shopping item where companyId = ? and sku = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
companyId - the company ID
sku - the sku
retrieveFromCache - whether to use the finder cache
Returns:
the matching shopping item, or null if a matching shopping item could not be found
Throws:
SystemException - if a system exception occurred

removeByC_S

public static ShoppingItem removeByC_S(long companyId,
                                       String sku)
                                throws SystemException,
                                       NoSuchItemException
Removes the shopping item where companyId = ? and sku = ? from the database.

Parameters:
companyId - the company ID
sku - the sku
Returns:
the shopping item that was removed
Throws:
SystemException - if a system exception occurred
NoSuchItemException

countByC_S

public static int countByC_S(long companyId,
                             String sku)
                      throws SystemException
Returns the number of shopping items where companyId = ? and sku = ?.

Parameters:
companyId - the company ID
sku - the sku
Returns:
the number of matching shopping items
Throws:
SystemException - if a system exception occurred

cacheResult

public static void cacheResult(ShoppingItem shoppingItem)
Caches the shopping item in the entity cache if it is enabled.

Parameters:
shoppingItem - the shopping item

cacheResult

public static void cacheResult(List<ShoppingItem> shoppingItems)
Caches the shopping items in the entity cache if it is enabled.

Parameters:
shoppingItems - the shopping items

create

public static ShoppingItem create(long itemId)
Creates a new shopping item with the primary key. Does not add the shopping item to the database.

Parameters:
itemId - the primary key for the new shopping item
Returns:
the new shopping item

remove

public static ShoppingItem remove(long itemId)
                           throws SystemException,
                                  NoSuchItemException
Removes the shopping item with the primary key from the database. Also notifies the appropriate model listeners.

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

updateImpl

public static ShoppingItem updateImpl(ShoppingItem shoppingItem)
                               throws SystemException
Throws:
SystemException

findByPrimaryKey

public static ShoppingItem findByPrimaryKey(long itemId)
                                     throws SystemException,
                                            NoSuchItemException
Returns the shopping item with the primary key or throws a NoSuchItemException if it could not be found.

Parameters:
itemId - the primary key of the shopping item
Returns:
the shopping item
Throws:
NoSuchItemException - if a shopping item with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

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

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

findAll

public static List<ShoppingItem> findAll()
                                  throws SystemException
Returns all the shopping items.

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

findAll

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

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 ShoppingItemModelImpl. 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 items
end - the upper bound of the range of shopping items (not inclusive)
Returns:
the range of shopping items
Throws:
SystemException - if a system exception occurred

findAll

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

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 ShoppingItemModelImpl. 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 items
end - the upper bound of the range of shopping items (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of shopping items
Throws:
SystemException - if a system exception occurred

removeAll

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

Throws:
SystemException - if a system exception occurred

countAll

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

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

getPersistence

public static ShoppingItemPersistence getPersistence()

setPersistence

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


Liferay 6.2-ce-ga5