001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }