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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    public class ShoppingItemFinderUtil {
024            public static int countByG_C(long groupId,
025                    java.util.List<java.lang.Long> categoryIds)
026                    throws com.liferay.portal.kernel.exception.SystemException {
027                    return getFinder().countByG_C(groupId, categoryIds);
028            }
029    
030            public static int countByFeatured(long groupId, long[] categoryIds)
031                    throws com.liferay.portal.kernel.exception.SystemException {
032                    return getFinder().countByFeatured(groupId, categoryIds);
033            }
034    
035            public static int countByKeywords(long groupId, long[] categoryIds,
036                    java.lang.String keywords)
037                    throws com.liferay.portal.kernel.exception.SystemException {
038                    return getFinder().countByKeywords(groupId, categoryIds, keywords);
039            }
040    
041            public static int countBySale(long groupId, long[] categoryIds)
042                    throws com.liferay.portal.kernel.exception.SystemException {
043                    return getFinder().countBySale(groupId, categoryIds);
044            }
045    
046            public static int filterCountByG_C(long groupId,
047                    java.util.List<java.lang.Long> categoryIds)
048                    throws com.liferay.portal.kernel.exception.SystemException {
049                    return getFinder().filterCountByG_C(groupId, categoryIds);
050            }
051    
052            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByFeatured(
053                    long groupId, long[] categoryIds, int numOfItems)
054                    throws com.liferay.portal.kernel.exception.SystemException {
055                    return getFinder().findByFeatured(groupId, categoryIds, numOfItems);
056            }
057    
058            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByKeywords(
059                    long groupId, long[] categoryIds, java.lang.String keywords, int start,
060                    int end) throws com.liferay.portal.kernel.exception.SystemException {
061                    return getFinder()
062                                       .findByKeywords(groupId, categoryIds, keywords, start, end);
063            }
064    
065            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findBySale(
066                    long groupId, long[] categoryIds, int numOfItems)
067                    throws com.liferay.portal.kernel.exception.SystemException {
068                    return getFinder().findBySale(groupId, categoryIds, numOfItems);
069            }
070    
071            public static ShoppingItemFinder getFinder() {
072                    if (_finder == null) {
073                            _finder = (ShoppingItemFinder)PortalBeanLocatorUtil.locate(ShoppingItemFinder.class.getName());
074    
075                            ReferenceRegistry.registerReference(ShoppingItemFinderUtil.class,
076                                    "_finder");
077                    }
078    
079                    return _finder;
080            }
081    
082            public void setFinder(ShoppingItemFinder finder) {
083                    _finder = finder;
084    
085                    ReferenceRegistry.registerReference(ShoppingItemFinderUtil.class,
086                            "_finder");
087            }
088    
089            private static ShoppingItemFinder _finder;
090    }