1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portlet.shopping.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  
21  import com.liferay.portlet.shopping.model.ShoppingCategory;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="ShoppingCategoryUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       ShoppingCategoryPersistence
35   * @see       ShoppingCategoryPersistenceImpl
36   * @generated
37   */
38  public class ShoppingCategoryUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
48       */
49      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
50          throws SystemException {
51          return getPersistence().findWithDynamicQuery(dynamicQuery);
52      }
53  
54      /**
55       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
56       */
57      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
58          int start, int end) throws SystemException {
59          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
60      }
61  
62      /**
63       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
64       */
65      public static ShoppingCategory remove(ShoppingCategory shoppingCategory)
66          throws SystemException {
67          return getPersistence().remove(shoppingCategory);
68      }
69  
70      /**
71       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
72       */
73      public static ShoppingCategory update(ShoppingCategory shoppingCategory,
74          boolean merge) throws SystemException {
75          return getPersistence().update(shoppingCategory, merge);
76      }
77  
78      public static void cacheResult(
79          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory) {
80          getPersistence().cacheResult(shoppingCategory);
81      }
82  
83      public static void cacheResult(
84          java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> shoppingCategories) {
85          getPersistence().cacheResult(shoppingCategories);
86      }
87  
88      public static com.liferay.portlet.shopping.model.ShoppingCategory create(
89          long categoryId) {
90          return getPersistence().create(categoryId);
91      }
92  
93      public static com.liferay.portlet.shopping.model.ShoppingCategory remove(
94          long categoryId)
95          throws com.liferay.portal.SystemException,
96              com.liferay.portlet.shopping.NoSuchCategoryException {
97          return getPersistence().remove(categoryId);
98      }
99  
100     /**
101      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
102      */
103     public static com.liferay.portlet.shopping.model.ShoppingCategory update(
104         com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory)
105         throws com.liferay.portal.SystemException {
106         return getPersistence().update(shoppingCategory);
107     }
108 
109     public static com.liferay.portlet.shopping.model.ShoppingCategory updateImpl(
110         com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory,
111         boolean merge) throws com.liferay.portal.SystemException {
112         return getPersistence().updateImpl(shoppingCategory, merge);
113     }
114 
115     public static com.liferay.portlet.shopping.model.ShoppingCategory findByPrimaryKey(
116         long categoryId)
117         throws com.liferay.portal.SystemException,
118             com.liferay.portlet.shopping.NoSuchCategoryException {
119         return getPersistence().findByPrimaryKey(categoryId);
120     }
121 
122     public static com.liferay.portlet.shopping.model.ShoppingCategory fetchByPrimaryKey(
123         long categoryId) throws com.liferay.portal.SystemException {
124         return getPersistence().fetchByPrimaryKey(categoryId);
125     }
126 
127     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByGroupId(
128         long groupId) throws com.liferay.portal.SystemException {
129         return getPersistence().findByGroupId(groupId);
130     }
131 
132     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByGroupId(
133         long groupId, int start, int end)
134         throws com.liferay.portal.SystemException {
135         return getPersistence().findByGroupId(groupId, start, end);
136     }
137 
138     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByGroupId(
139         long groupId, int start, int end,
140         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
141         throws com.liferay.portal.SystemException {
142         return getPersistence()
143                    .findByGroupId(groupId, start, end, orderByComparator);
144     }
145 
146     public static com.liferay.portlet.shopping.model.ShoppingCategory findByGroupId_First(
147         long groupId,
148         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
149         throws com.liferay.portal.SystemException,
150             com.liferay.portlet.shopping.NoSuchCategoryException {
151         return getPersistence().findByGroupId_First(groupId, orderByComparator);
152     }
153 
154     public static com.liferay.portlet.shopping.model.ShoppingCategory findByGroupId_Last(
155         long groupId,
156         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
157         throws com.liferay.portal.SystemException,
158             com.liferay.portlet.shopping.NoSuchCategoryException {
159         return getPersistence().findByGroupId_Last(groupId, orderByComparator);
160     }
161 
162     public static com.liferay.portlet.shopping.model.ShoppingCategory[] findByGroupId_PrevAndNext(
163         long categoryId, long groupId,
164         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165         throws com.liferay.portal.SystemException,
166             com.liferay.portlet.shopping.NoSuchCategoryException {
167         return getPersistence()
168                    .findByGroupId_PrevAndNext(categoryId, groupId,
169             orderByComparator);
170     }
171 
172     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByG_P(
173         long groupId, long parentCategoryId)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().findByG_P(groupId, parentCategoryId);
176     }
177 
178     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByG_P(
179         long groupId, long parentCategoryId, int start, int end)
180         throws com.liferay.portal.SystemException {
181         return getPersistence().findByG_P(groupId, parentCategoryId, start, end);
182     }
183 
184     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByG_P(
185         long groupId, long parentCategoryId, int start, int end,
186         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
187         throws com.liferay.portal.SystemException {
188         return getPersistence()
189                    .findByG_P(groupId, parentCategoryId, start, end,
190             orderByComparator);
191     }
192 
193     public static com.liferay.portlet.shopping.model.ShoppingCategory findByG_P_First(
194         long groupId, long parentCategoryId,
195         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
196         throws com.liferay.portal.SystemException,
197             com.liferay.portlet.shopping.NoSuchCategoryException {
198         return getPersistence()
199                    .findByG_P_First(groupId, parentCategoryId, orderByComparator);
200     }
201 
202     public static com.liferay.portlet.shopping.model.ShoppingCategory findByG_P_Last(
203         long groupId, long parentCategoryId,
204         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
205         throws com.liferay.portal.SystemException,
206             com.liferay.portlet.shopping.NoSuchCategoryException {
207         return getPersistence()
208                    .findByG_P_Last(groupId, parentCategoryId, orderByComparator);
209     }
210 
211     public static com.liferay.portlet.shopping.model.ShoppingCategory[] findByG_P_PrevAndNext(
212         long categoryId, long groupId, long parentCategoryId,
213         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
214         throws com.liferay.portal.SystemException,
215             com.liferay.portlet.shopping.NoSuchCategoryException {
216         return getPersistence()
217                    .findByG_P_PrevAndNext(categoryId, groupId,
218             parentCategoryId, orderByComparator);
219     }
220 
221     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findAll()
222         throws com.liferay.portal.SystemException {
223         return getPersistence().findAll();
224     }
225 
226     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findAll(
227         int start, int end) throws com.liferay.portal.SystemException {
228         return getPersistence().findAll(start, end);
229     }
230 
231     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findAll(
232         int start, int end,
233         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
234         throws com.liferay.portal.SystemException {
235         return getPersistence().findAll(start, end, orderByComparator);
236     }
237 
238     public static void removeByGroupId(long groupId)
239         throws com.liferay.portal.SystemException {
240         getPersistence().removeByGroupId(groupId);
241     }
242 
243     public static void removeByG_P(long groupId, long parentCategoryId)
244         throws com.liferay.portal.SystemException {
245         getPersistence().removeByG_P(groupId, parentCategoryId);
246     }
247 
248     public static void removeAll() throws com.liferay.portal.SystemException {
249         getPersistence().removeAll();
250     }
251 
252     public static int countByGroupId(long groupId)
253         throws com.liferay.portal.SystemException {
254         return getPersistence().countByGroupId(groupId);
255     }
256 
257     public static int countByG_P(long groupId, long parentCategoryId)
258         throws com.liferay.portal.SystemException {
259         return getPersistence().countByG_P(groupId, parentCategoryId);
260     }
261 
262     public static int countAll() throws com.liferay.portal.SystemException {
263         return getPersistence().countAll();
264     }
265 
266     public static ShoppingCategoryPersistence getPersistence() {
267         if (_persistence == null) {
268             _persistence = (ShoppingCategoryPersistence)PortalBeanLocatorUtil.locate(ShoppingCategoryPersistence.class.getName());
269         }
270 
271         return _persistence;
272     }
273 
274     public void setPersistence(ShoppingCategoryPersistence persistence) {
275         _persistence = persistence;
276     }
277 
278     private static ShoppingCategoryPersistence _persistence;
279 }