1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.shopping.service.persistence;
24  
25  
26  /**
27   * <a href="ShoppingCategoryUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       ShoppingCategoryPersistence
36   * @see       ShoppingCategoryPersistenceImpl
37   * @generated
38   */
39  public class ShoppingCategoryUtil {
40      public static void cacheResult(
41          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory) {
42          getPersistence().cacheResult(shoppingCategory);
43      }
44  
45      public static void cacheResult(
46          java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> shoppingCategories) {
47          getPersistence().cacheResult(shoppingCategories);
48      }
49  
50      public static void clearCache() {
51          getPersistence().clearCache();
52      }
53  
54      public static com.liferay.portlet.shopping.model.ShoppingCategory create(
55          long categoryId) {
56          return getPersistence().create(categoryId);
57      }
58  
59      public static com.liferay.portlet.shopping.model.ShoppingCategory remove(
60          long categoryId)
61          throws com.liferay.portal.SystemException,
62              com.liferay.portlet.shopping.NoSuchCategoryException {
63          return getPersistence().remove(categoryId);
64      }
65  
66      public static com.liferay.portlet.shopping.model.ShoppingCategory remove(
67          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory)
68          throws com.liferay.portal.SystemException {
69          return getPersistence().remove(shoppingCategory);
70      }
71  
72      /**
73       * @deprecated Use {@link #update(ShoppingCategory, boolean merge)}.
74       */
75      public static com.liferay.portlet.shopping.model.ShoppingCategory update(
76          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory)
77          throws com.liferay.portal.SystemException {
78          return getPersistence().update(shoppingCategory);
79      }
80  
81      /**
82       * Add, update, or merge, the entity. This method also calls the model
83       * listeners to trigger the proper events associated with adding, deleting,
84       * or updating an entity.
85       *
86       * @param  shoppingCategory the entity to add, update, or merge
87       * @param  merge boolean value for whether to merge the entity. The default
88       *         value is false. Setting merge to true is more expensive and
89       *         should only be true when shoppingCategory is transient. See
90       *         LEP-5473 for a detailed discussion of this method.
91       * @return the entity that was added, updated, or merged
92       */
93      public static com.liferay.portlet.shopping.model.ShoppingCategory update(
94          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory,
95          boolean merge) throws com.liferay.portal.SystemException {
96          return getPersistence().update(shoppingCategory, merge);
97      }
98  
99      public static com.liferay.portlet.shopping.model.ShoppingCategory updateImpl(
100         com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory,
101         boolean merge) throws com.liferay.portal.SystemException {
102         return getPersistence().updateImpl(shoppingCategory, merge);
103     }
104 
105     public static com.liferay.portlet.shopping.model.ShoppingCategory findByPrimaryKey(
106         long categoryId)
107         throws com.liferay.portal.SystemException,
108             com.liferay.portlet.shopping.NoSuchCategoryException {
109         return getPersistence().findByPrimaryKey(categoryId);
110     }
111 
112     public static com.liferay.portlet.shopping.model.ShoppingCategory fetchByPrimaryKey(
113         long categoryId) throws com.liferay.portal.SystemException {
114         return getPersistence().fetchByPrimaryKey(categoryId);
115     }
116 
117     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByGroupId(
118         long groupId) throws com.liferay.portal.SystemException {
119         return getPersistence().findByGroupId(groupId);
120     }
121 
122     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByGroupId(
123         long groupId, int start, int end)
124         throws com.liferay.portal.SystemException {
125         return getPersistence().findByGroupId(groupId, start, end);
126     }
127 
128     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByGroupId(
129         long groupId, int start, int end,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException {
132         return getPersistence().findByGroupId(groupId, start, end, obc);
133     }
134 
135     public static com.liferay.portlet.shopping.model.ShoppingCategory findByGroupId_First(
136         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portlet.shopping.NoSuchCategoryException {
139         return getPersistence().findByGroupId_First(groupId, obc);
140     }
141 
142     public static com.liferay.portlet.shopping.model.ShoppingCategory findByGroupId_Last(
143         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.SystemException,
145             com.liferay.portlet.shopping.NoSuchCategoryException {
146         return getPersistence().findByGroupId_Last(groupId, obc);
147     }
148 
149     public static com.liferay.portlet.shopping.model.ShoppingCategory[] findByGroupId_PrevAndNext(
150         long categoryId, long groupId,
151         com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException,
153             com.liferay.portlet.shopping.NoSuchCategoryException {
154         return getPersistence()
155                    .findByGroupId_PrevAndNext(categoryId, groupId, obc);
156     }
157 
158     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByG_P(
159         long groupId, long parentCategoryId)
160         throws com.liferay.portal.SystemException {
161         return getPersistence().findByG_P(groupId, parentCategoryId);
162     }
163 
164     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByG_P(
165         long groupId, long parentCategoryId, int start, int end)
166         throws com.liferay.portal.SystemException {
167         return getPersistence().findByG_P(groupId, parentCategoryId, start, end);
168     }
169 
170     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findByG_P(
171         long groupId, long parentCategoryId, int start, int end,
172         com.liferay.portal.kernel.util.OrderByComparator obc)
173         throws com.liferay.portal.SystemException {
174         return getPersistence()
175                    .findByG_P(groupId, parentCategoryId, start, end, obc);
176     }
177 
178     public static com.liferay.portlet.shopping.model.ShoppingCategory findByG_P_First(
179         long groupId, long parentCategoryId,
180         com.liferay.portal.kernel.util.OrderByComparator obc)
181         throws com.liferay.portal.SystemException,
182             com.liferay.portlet.shopping.NoSuchCategoryException {
183         return getPersistence().findByG_P_First(groupId, parentCategoryId, obc);
184     }
185 
186     public static com.liferay.portlet.shopping.model.ShoppingCategory findByG_P_Last(
187         long groupId, long parentCategoryId,
188         com.liferay.portal.kernel.util.OrderByComparator obc)
189         throws com.liferay.portal.SystemException,
190             com.liferay.portlet.shopping.NoSuchCategoryException {
191         return getPersistence().findByG_P_Last(groupId, parentCategoryId, obc);
192     }
193 
194     public static com.liferay.portlet.shopping.model.ShoppingCategory[] findByG_P_PrevAndNext(
195         long categoryId, long groupId, long parentCategoryId,
196         com.liferay.portal.kernel.util.OrderByComparator obc)
197         throws com.liferay.portal.SystemException,
198             com.liferay.portlet.shopping.NoSuchCategoryException {
199         return getPersistence()
200                    .findByG_P_PrevAndNext(categoryId, groupId,
201             parentCategoryId, obc);
202     }
203 
204     public static java.util.List<Object> findWithDynamicQuery(
205         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
206         throws com.liferay.portal.SystemException {
207         return getPersistence().findWithDynamicQuery(dynamicQuery);
208     }
209 
210     public static java.util.List<Object> findWithDynamicQuery(
211         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
212         int end) throws com.liferay.portal.SystemException {
213         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
214     }
215 
216     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findAll()
217         throws com.liferay.portal.SystemException {
218         return getPersistence().findAll();
219     }
220 
221     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findAll(
222         int start, int end) throws com.liferay.portal.SystemException {
223         return getPersistence().findAll(start, end);
224     }
225 
226     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> findAll(
227         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
228         throws com.liferay.portal.SystemException {
229         return getPersistence().findAll(start, end, obc);
230     }
231 
232     public static void removeByGroupId(long groupId)
233         throws com.liferay.portal.SystemException {
234         getPersistence().removeByGroupId(groupId);
235     }
236 
237     public static void removeByG_P(long groupId, long parentCategoryId)
238         throws com.liferay.portal.SystemException {
239         getPersistence().removeByG_P(groupId, parentCategoryId);
240     }
241 
242     public static void removeAll() throws com.liferay.portal.SystemException {
243         getPersistence().removeAll();
244     }
245 
246     public static int countByGroupId(long groupId)
247         throws com.liferay.portal.SystemException {
248         return getPersistence().countByGroupId(groupId);
249     }
250 
251     public static int countByG_P(long groupId, long parentCategoryId)
252         throws com.liferay.portal.SystemException {
253         return getPersistence().countByG_P(groupId, parentCategoryId);
254     }
255 
256     public static int countAll() throws com.liferay.portal.SystemException {
257         return getPersistence().countAll();
258     }
259 
260     public static ShoppingCategoryPersistence getPersistence() {
261         return _persistence;
262     }
263 
264     public void setPersistence(ShoppingCategoryPersistence persistence) {
265         _persistence = persistence;
266     }
267 
268     private static ShoppingCategoryPersistence _persistence;
269 }