001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.shopping.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    @ProviderType
026    public class ShoppingItemFinderUtil {
027            public static int countByG_C(long groupId,
028                    java.util.List<java.lang.Long> categoryIds)
029                    throws com.liferay.portal.kernel.exception.SystemException {
030                    return getFinder().countByG_C(groupId, categoryIds);
031            }
032    
033            public static int countByFeatured(long groupId, long[] categoryIds)
034                    throws com.liferay.portal.kernel.exception.SystemException {
035                    return getFinder().countByFeatured(groupId, categoryIds);
036            }
037    
038            public static int countByKeywords(long groupId, long[] categoryIds,
039                    java.lang.String keywords)
040                    throws com.liferay.portal.kernel.exception.SystemException {
041                    return getFinder().countByKeywords(groupId, categoryIds, keywords);
042            }
043    
044            public static int countBySale(long groupId, long[] categoryIds)
045                    throws com.liferay.portal.kernel.exception.SystemException {
046                    return getFinder().countBySale(groupId, categoryIds);
047            }
048    
049            public static int filterCountByG_C(long groupId,
050                    java.util.List<java.lang.Long> categoryIds)
051                    throws com.liferay.portal.kernel.exception.SystemException {
052                    return getFinder().filterCountByG_C(groupId, categoryIds);
053            }
054    
055            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByFeatured(
056                    long groupId, long[] categoryIds, int numOfItems)
057                    throws com.liferay.portal.kernel.exception.SystemException {
058                    return getFinder().findByFeatured(groupId, categoryIds, numOfItems);
059            }
060    
061            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByKeywords(
062                    long groupId, long[] categoryIds, java.lang.String keywords, int start,
063                    int end) throws com.liferay.portal.kernel.exception.SystemException {
064                    return getFinder()
065                                       .findByKeywords(groupId, categoryIds, keywords, start, end);
066            }
067    
068            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findBySale(
069                    long groupId, long[] categoryIds, int numOfItems)
070                    throws com.liferay.portal.kernel.exception.SystemException {
071                    return getFinder().findBySale(groupId, categoryIds, numOfItems);
072            }
073    
074            public static ShoppingItemFinder getFinder() {
075                    if (_finder == null) {
076                            _finder = (ShoppingItemFinder)PortalBeanLocatorUtil.locate(ShoppingItemFinder.class.getName());
077    
078                            ReferenceRegistry.registerReference(ShoppingItemFinderUtil.class,
079                                    "_finder");
080                    }
081    
082                    return _finder;
083            }
084    
085            public void setFinder(ShoppingItemFinder finder) {
086                    _finder = finder;
087    
088                    ReferenceRegistry.registerReference(ShoppingItemFinderUtil.class,
089                            "_finder");
090            }
091    
092            private static ShoppingItemFinder _finder;
093    }