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.portal.service.persistence;
24  
25  import com.liferay.portal.SystemException;
26  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
27  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
28  import com.liferay.portal.model.UserGroup;
29  
30  import java.util.List;
31  
32  /**
33   * <a href="UserGroupUtil.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be
37   * overwritten the next time is generated.
38   * </p>
39   *
40   * @author    Brian Wing Shun Chan
41   * @see       UserGroupPersistence
42   * @see       UserGroupPersistenceImpl
43   * @generated
44   */
45  public class UserGroupUtil {
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
48       */
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
55       */
56      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().findWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
65          int start, int end) throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
71       */
72      public static UserGroup remove(UserGroup userGroup)
73          throws SystemException {
74          return getPersistence().remove(userGroup);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
79       */
80      public static UserGroup update(UserGroup userGroup, boolean merge)
81          throws SystemException {
82          return getPersistence().update(userGroup, merge);
83      }
84  
85      public static void cacheResult(com.liferay.portal.model.UserGroup userGroup) {
86          getPersistence().cacheResult(userGroup);
87      }
88  
89      public static void cacheResult(
90          java.util.List<com.liferay.portal.model.UserGroup> userGroups) {
91          getPersistence().cacheResult(userGroups);
92      }
93  
94      public static com.liferay.portal.model.UserGroup create(long userGroupId) {
95          return getPersistence().create(userGroupId);
96      }
97  
98      public static com.liferay.portal.model.UserGroup remove(long userGroupId)
99          throws com.liferay.portal.NoSuchUserGroupException,
100             com.liferay.portal.SystemException {
101         return getPersistence().remove(userGroupId);
102     }
103 
104     /**
105      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
106      */
107     public static com.liferay.portal.model.UserGroup update(
108         com.liferay.portal.model.UserGroup userGroup)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().update(userGroup);
111     }
112 
113     public static com.liferay.portal.model.UserGroup updateImpl(
114         com.liferay.portal.model.UserGroup userGroup, boolean merge)
115         throws com.liferay.portal.SystemException {
116         return getPersistence().updateImpl(userGroup, merge);
117     }
118 
119     public static com.liferay.portal.model.UserGroup findByPrimaryKey(
120         long userGroupId)
121         throws com.liferay.portal.NoSuchUserGroupException,
122             com.liferay.portal.SystemException {
123         return getPersistence().findByPrimaryKey(userGroupId);
124     }
125 
126     public static com.liferay.portal.model.UserGroup fetchByPrimaryKey(
127         long userGroupId) throws com.liferay.portal.SystemException {
128         return getPersistence().fetchByPrimaryKey(userGroupId);
129     }
130 
131     public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
132         long companyId) throws com.liferay.portal.SystemException {
133         return getPersistence().findByCompanyId(companyId);
134     }
135 
136     public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
137         long companyId, int start, int end)
138         throws com.liferay.portal.SystemException {
139         return getPersistence().findByCompanyId(companyId, start, end);
140     }
141 
142     public static java.util.List<com.liferay.portal.model.UserGroup> findByCompanyId(
143         long companyId, int start, int end,
144         com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().findByCompanyId(companyId, start, end, obc);
147     }
148 
149     public static com.liferay.portal.model.UserGroup findByCompanyId_First(
150         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.NoSuchUserGroupException,
152             com.liferay.portal.SystemException {
153         return getPersistence().findByCompanyId_First(companyId, obc);
154     }
155 
156     public static com.liferay.portal.model.UserGroup findByCompanyId_Last(
157         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
158         throws com.liferay.portal.NoSuchUserGroupException,
159             com.liferay.portal.SystemException {
160         return getPersistence().findByCompanyId_Last(companyId, obc);
161     }
162 
163     public static com.liferay.portal.model.UserGroup[] findByCompanyId_PrevAndNext(
164         long userGroupId, long companyId,
165         com.liferay.portal.kernel.util.OrderByComparator obc)
166         throws com.liferay.portal.NoSuchUserGroupException,
167             com.liferay.portal.SystemException {
168         return getPersistence()
169                    .findByCompanyId_PrevAndNext(userGroupId, companyId, obc);
170     }
171 
172     public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
173         long companyId, long parentUserGroupId)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().findByC_P(companyId, parentUserGroupId);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
179         long companyId, long parentUserGroupId, int start, int end)
180         throws com.liferay.portal.SystemException {
181         return getPersistence()
182                    .findByC_P(companyId, parentUserGroupId, start, end);
183     }
184 
185     public static java.util.List<com.liferay.portal.model.UserGroup> findByC_P(
186         long companyId, long parentUserGroupId, int start, int end,
187         com.liferay.portal.kernel.util.OrderByComparator obc)
188         throws com.liferay.portal.SystemException {
189         return getPersistence()
190                    .findByC_P(companyId, parentUserGroupId, start, end, obc);
191     }
192 
193     public static com.liferay.portal.model.UserGroup findByC_P_First(
194         long companyId, long parentUserGroupId,
195         com.liferay.portal.kernel.util.OrderByComparator obc)
196         throws com.liferay.portal.NoSuchUserGroupException,
197             com.liferay.portal.SystemException {
198         return getPersistence()
199                    .findByC_P_First(companyId, parentUserGroupId, obc);
200     }
201 
202     public static com.liferay.portal.model.UserGroup findByC_P_Last(
203         long companyId, long parentUserGroupId,
204         com.liferay.portal.kernel.util.OrderByComparator obc)
205         throws com.liferay.portal.NoSuchUserGroupException,
206             com.liferay.portal.SystemException {
207         return getPersistence().findByC_P_Last(companyId, parentUserGroupId, obc);
208     }
209 
210     public static com.liferay.portal.model.UserGroup[] findByC_P_PrevAndNext(
211         long userGroupId, long companyId, long parentUserGroupId,
212         com.liferay.portal.kernel.util.OrderByComparator obc)
213         throws com.liferay.portal.NoSuchUserGroupException,
214             com.liferay.portal.SystemException {
215         return getPersistence()
216                    .findByC_P_PrevAndNext(userGroupId, companyId,
217             parentUserGroupId, obc);
218     }
219 
220     public static com.liferay.portal.model.UserGroup findByC_N(long companyId,
221         java.lang.String name)
222         throws com.liferay.portal.NoSuchUserGroupException,
223             com.liferay.portal.SystemException {
224         return getPersistence().findByC_N(companyId, name);
225     }
226 
227     public static com.liferay.portal.model.UserGroup fetchByC_N(
228         long companyId, java.lang.String name)
229         throws com.liferay.portal.SystemException {
230         return getPersistence().fetchByC_N(companyId, name);
231     }
232 
233     public static com.liferay.portal.model.UserGroup fetchByC_N(
234         long companyId, java.lang.String name, boolean retrieveFromCache)
235         throws com.liferay.portal.SystemException {
236         return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
237     }
238 
239     public static java.util.List<com.liferay.portal.model.UserGroup> findAll()
240         throws com.liferay.portal.SystemException {
241         return getPersistence().findAll();
242     }
243 
244     public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
245         int start, int end) throws com.liferay.portal.SystemException {
246         return getPersistence().findAll(start, end);
247     }
248 
249     public static java.util.List<com.liferay.portal.model.UserGroup> findAll(
250         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
251         throws com.liferay.portal.SystemException {
252         return getPersistence().findAll(start, end, obc);
253     }
254 
255     public static void removeByCompanyId(long companyId)
256         throws com.liferay.portal.SystemException {
257         getPersistence().removeByCompanyId(companyId);
258     }
259 
260     public static void removeByC_P(long companyId, long parentUserGroupId)
261         throws com.liferay.portal.SystemException {
262         getPersistence().removeByC_P(companyId, parentUserGroupId);
263     }
264 
265     public static void removeByC_N(long companyId, java.lang.String name)
266         throws com.liferay.portal.NoSuchUserGroupException,
267             com.liferay.portal.SystemException {
268         getPersistence().removeByC_N(companyId, name);
269     }
270 
271     public static void removeAll() throws com.liferay.portal.SystemException {
272         getPersistence().removeAll();
273     }
274 
275     public static int countByCompanyId(long companyId)
276         throws com.liferay.portal.SystemException {
277         return getPersistence().countByCompanyId(companyId);
278     }
279 
280     public static int countByC_P(long companyId, long parentUserGroupId)
281         throws com.liferay.portal.SystemException {
282         return getPersistence().countByC_P(companyId, parentUserGroupId);
283     }
284 
285     public static int countByC_N(long companyId, java.lang.String name)
286         throws com.liferay.portal.SystemException {
287         return getPersistence().countByC_N(companyId, name);
288     }
289 
290     public static int countAll() throws com.liferay.portal.SystemException {
291         return getPersistence().countAll();
292     }
293 
294     public static java.util.List<com.liferay.portal.model.User> getUsers(
295         long pk) throws com.liferay.portal.SystemException {
296         return getPersistence().getUsers(pk);
297     }
298 
299     public static java.util.List<com.liferay.portal.model.User> getUsers(
300         long pk, int start, int end) throws com.liferay.portal.SystemException {
301         return getPersistence().getUsers(pk, start, end);
302     }
303 
304     public static java.util.List<com.liferay.portal.model.User> getUsers(
305         long pk, int start, int end,
306         com.liferay.portal.kernel.util.OrderByComparator obc)
307         throws com.liferay.portal.SystemException {
308         return getPersistence().getUsers(pk, start, end, obc);
309     }
310 
311     public static int getUsersSize(long pk)
312         throws com.liferay.portal.SystemException {
313         return getPersistence().getUsersSize(pk);
314     }
315 
316     public static boolean containsUser(long pk, long userPK)
317         throws com.liferay.portal.SystemException {
318         return getPersistence().containsUser(pk, userPK);
319     }
320 
321     public static boolean containsUsers(long pk)
322         throws com.liferay.portal.SystemException {
323         return getPersistence().containsUsers(pk);
324     }
325 
326     public static void addUser(long pk, long userPK)
327         throws com.liferay.portal.SystemException {
328         getPersistence().addUser(pk, userPK);
329     }
330 
331     public static void addUser(long pk, com.liferay.portal.model.User user)
332         throws com.liferay.portal.SystemException {
333         getPersistence().addUser(pk, user);
334     }
335 
336     public static void addUsers(long pk, long[] userPKs)
337         throws com.liferay.portal.SystemException {
338         getPersistence().addUsers(pk, userPKs);
339     }
340 
341     public static void addUsers(long pk,
342         java.util.List<com.liferay.portal.model.User> users)
343         throws com.liferay.portal.SystemException {
344         getPersistence().addUsers(pk, users);
345     }
346 
347     public static void clearUsers(long pk)
348         throws com.liferay.portal.SystemException {
349         getPersistence().clearUsers(pk);
350     }
351 
352     public static void removeUser(long pk, long userPK)
353         throws com.liferay.portal.SystemException {
354         getPersistence().removeUser(pk, userPK);
355     }
356 
357     public static void removeUser(long pk, com.liferay.portal.model.User user)
358         throws com.liferay.portal.SystemException {
359         getPersistence().removeUser(pk, user);
360     }
361 
362     public static void removeUsers(long pk, long[] userPKs)
363         throws com.liferay.portal.SystemException {
364         getPersistence().removeUsers(pk, userPKs);
365     }
366 
367     public static void removeUsers(long pk,
368         java.util.List<com.liferay.portal.model.User> users)
369         throws com.liferay.portal.SystemException {
370         getPersistence().removeUsers(pk, users);
371     }
372 
373     public static void setUsers(long pk, long[] userPKs)
374         throws com.liferay.portal.SystemException {
375         getPersistence().setUsers(pk, userPKs);
376     }
377 
378     public static void setUsers(long pk,
379         java.util.List<com.liferay.portal.model.User> users)
380         throws com.liferay.portal.SystemException {
381         getPersistence().setUsers(pk, users);
382     }
383 
384     public static UserGroupPersistence getPersistence() {
385         if (_persistence == null) {
386             _persistence = (UserGroupPersistence)PortalBeanLocatorUtil.locate(UserGroupPersistence.class.getName());
387         }
388 
389         return _persistence;
390     }
391 
392     public void setPersistence(UserGroupPersistence persistence) {
393         _persistence = persistence;
394     }
395 
396     private static UserGroupPersistence _persistence;
397 }