001    /**
002     * Copyright (c) 2000-present 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                    return getFinder().countByG_C(groupId, categoryIds);
030            }
031    
032            public static int countByFeatured(long groupId, long[] categoryIds) {
033                    return getFinder().countByFeatured(groupId, categoryIds);
034            }
035    
036            public static int countByKeywords(long groupId, long[] categoryIds,
037                    java.lang.String keywords) {
038                    return getFinder().countByKeywords(groupId, categoryIds, keywords);
039            }
040    
041            public static int countBySale(long groupId, long[] categoryIds) {
042                    return getFinder().countBySale(groupId, categoryIds);
043            }
044    
045            public static int filterCountByG_C(long groupId,
046                    java.util.List<java.lang.Long> categoryIds) {
047                    return getFinder().filterCountByG_C(groupId, categoryIds);
048            }
049    
050            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByFeatured(
051                    long groupId, long[] categoryIds, int numOfItems) {
052                    return getFinder().findByFeatured(groupId, categoryIds, numOfItems);
053            }
054    
055            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByKeywords(
056                    long groupId, long[] categoryIds, java.lang.String keywords, int start,
057                    int end) {
058                    return getFinder()
059                                       .findByKeywords(groupId, categoryIds, keywords, start, end);
060            }
061    
062            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findBySale(
063                    long groupId, long[] categoryIds, int numOfItems) {
064                    return getFinder().findBySale(groupId, categoryIds, numOfItems);
065            }
066    
067            public static ShoppingItemFinder getFinder() {
068                    if (_finder == null) {
069                            _finder = (ShoppingItemFinder)PortalBeanLocatorUtil.locate(ShoppingItemFinder.class.getName());
070    
071                            ReferenceRegistry.registerReference(ShoppingItemFinderUtil.class,
072                                    "_finder");
073                    }
074    
075                    return _finder;
076            }
077    
078            public void setFinder(ShoppingItemFinder finder) {
079                    _finder = finder;
080    
081                    ReferenceRegistry.registerReference(ShoppingItemFinderUtil.class,
082                            "_finder");
083            }
084    
085            private static ShoppingItemFinder _finder;
086    }