1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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  /**
26   * <a href="OrganizationUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class OrganizationUtil {
32      public static com.liferay.portal.model.Organization create(
33          long organizationId) {
34          return getPersistence().create(organizationId);
35      }
36  
37      public static com.liferay.portal.model.Organization remove(
38          long organizationId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portal.NoSuchOrganizationException {
41          return getPersistence().remove(organizationId);
42      }
43  
44      public static com.liferay.portal.model.Organization remove(
45          com.liferay.portal.model.Organization organization)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(organization);
48      }
49  
50      /**
51       * @deprecated Use <code>update(Organization organization, boolean merge)</code>.
52       */
53      public static com.liferay.portal.model.Organization update(
54          com.liferay.portal.model.Organization organization)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(organization);
57      }
58  
59      /**
60       * Add, update, or merge, the entity. This method also calls the model
61       * listeners to trigger the proper events associated with adding, deleting,
62       * or updating an entity.
63       *
64       * @param        organization the entity to add, update, or merge
65       * @param        merge boolean value for whether to merge the entity. The
66       *                default value is false. Setting merge to true is more
67       *                expensive and should only be true when organization is
68       *                transient. See LEP-5473 for a detailed discussion of this
69       *                method.
70       * @return        true if the portlet can be displayed via Ajax
71       */
72      public static com.liferay.portal.model.Organization update(
73          com.liferay.portal.model.Organization organization, boolean merge)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(organization, merge);
76      }
77  
78      public static com.liferay.portal.model.Organization updateImpl(
79          com.liferay.portal.model.Organization organization, boolean merge)
80          throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(organization, merge);
82      }
83  
84      public static com.liferay.portal.model.Organization findByPrimaryKey(
85          long organizationId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portal.NoSuchOrganizationException {
88          return getPersistence().findByPrimaryKey(organizationId);
89      }
90  
91      public static com.liferay.portal.model.Organization fetchByPrimaryKey(
92          long organizationId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(organizationId);
94      }
95  
96      public static java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
97          long companyId) throws com.liferay.portal.SystemException {
98          return getPersistence().findByCompanyId(companyId);
99      }
100 
101     public static java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
102         long companyId, int begin, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByCompanyId(companyId, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
108         long companyId, int begin, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByCompanyId(companyId, begin, end, obc);
112     }
113 
114     public static com.liferay.portal.model.Organization findByCompanyId_First(
115         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException,
117             com.liferay.portal.NoSuchOrganizationException {
118         return getPersistence().findByCompanyId_First(companyId, obc);
119     }
120 
121     public static com.liferay.portal.model.Organization findByCompanyId_Last(
122         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.SystemException,
124             com.liferay.portal.NoSuchOrganizationException {
125         return getPersistence().findByCompanyId_Last(companyId, obc);
126     }
127 
128     public static com.liferay.portal.model.Organization[] findByCompanyId_PrevAndNext(
129         long organizationId, long companyId,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portal.NoSuchOrganizationException {
133         return getPersistence()
134                    .findByCompanyId_PrevAndNext(organizationId, companyId, obc);
135     }
136 
137     public static java.util.List<com.liferay.portal.model.Organization> findByLocations(
138         long companyId) throws com.liferay.portal.SystemException {
139         return getPersistence().findByLocations(companyId);
140     }
141 
142     public static java.util.List<com.liferay.portal.model.Organization> findByLocations(
143         long companyId, int begin, int end)
144         throws com.liferay.portal.SystemException {
145         return getPersistence().findByLocations(companyId, begin, end);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.Organization> findByLocations(
149         long companyId, int begin, int end,
150         com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.SystemException {
152         return getPersistence().findByLocations(companyId, begin, end, obc);
153     }
154 
155     public static com.liferay.portal.model.Organization findByLocations_First(
156         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
157         throws com.liferay.portal.SystemException,
158             com.liferay.portal.NoSuchOrganizationException {
159         return getPersistence().findByLocations_First(companyId, obc);
160     }
161 
162     public static com.liferay.portal.model.Organization findByLocations_Last(
163         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
164         throws com.liferay.portal.SystemException,
165             com.liferay.portal.NoSuchOrganizationException {
166         return getPersistence().findByLocations_Last(companyId, obc);
167     }
168 
169     public static com.liferay.portal.model.Organization[] findByLocations_PrevAndNext(
170         long organizationId, long companyId,
171         com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.SystemException,
173             com.liferay.portal.NoSuchOrganizationException {
174         return getPersistence()
175                    .findByLocations_PrevAndNext(organizationId, companyId, obc);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.Organization> findByC_P(
179         long companyId, long parentOrganizationId)
180         throws com.liferay.portal.SystemException {
181         return getPersistence().findByC_P(companyId, parentOrganizationId);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.Organization> findByC_P(
185         long companyId, long parentOrganizationId, int begin, int end)
186         throws com.liferay.portal.SystemException {
187         return getPersistence()
188                    .findByC_P(companyId, parentOrganizationId, begin, end);
189     }
190 
191     public static java.util.List<com.liferay.portal.model.Organization> findByC_P(
192         long companyId, long parentOrganizationId, int begin, int end,
193         com.liferay.portal.kernel.util.OrderByComparator obc)
194         throws com.liferay.portal.SystemException {
195         return getPersistence()
196                    .findByC_P(companyId, parentOrganizationId, begin, end, obc);
197     }
198 
199     public static com.liferay.portal.model.Organization findByC_P_First(
200         long companyId, long parentOrganizationId,
201         com.liferay.portal.kernel.util.OrderByComparator obc)
202         throws com.liferay.portal.SystemException,
203             com.liferay.portal.NoSuchOrganizationException {
204         return getPersistence()
205                    .findByC_P_First(companyId, parentOrganizationId, obc);
206     }
207 
208     public static com.liferay.portal.model.Organization findByC_P_Last(
209         long companyId, long parentOrganizationId,
210         com.liferay.portal.kernel.util.OrderByComparator obc)
211         throws com.liferay.portal.SystemException,
212             com.liferay.portal.NoSuchOrganizationException {
213         return getPersistence()
214                    .findByC_P_Last(companyId, parentOrganizationId, obc);
215     }
216 
217     public static com.liferay.portal.model.Organization[] findByC_P_PrevAndNext(
218         long organizationId, long companyId, long parentOrganizationId,
219         com.liferay.portal.kernel.util.OrderByComparator obc)
220         throws com.liferay.portal.SystemException,
221             com.liferay.portal.NoSuchOrganizationException {
222         return getPersistence()
223                    .findByC_P_PrevAndNext(organizationId, companyId,
224             parentOrganizationId, obc);
225     }
226 
227     public static com.liferay.portal.model.Organization findByC_N(
228         long companyId, java.lang.String name)
229         throws com.liferay.portal.SystemException,
230             com.liferay.portal.NoSuchOrganizationException {
231         return getPersistence().findByC_N(companyId, name);
232     }
233 
234     public static com.liferay.portal.model.Organization fetchByC_N(
235         long companyId, java.lang.String name)
236         throws com.liferay.portal.SystemException {
237         return getPersistence().fetchByC_N(companyId, name);
238     }
239 
240     public static java.util.List<com.liferay.portal.model.Organization> findWithDynamicQuery(
241         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
242         throws com.liferay.portal.SystemException {
243         return getPersistence().findWithDynamicQuery(queryInitializer);
244     }
245 
246     public static java.util.List<com.liferay.portal.model.Organization> findWithDynamicQuery(
247         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
248         int begin, int end) throws com.liferay.portal.SystemException {
249         return getPersistence()
250                    .findWithDynamicQuery(queryInitializer, begin, end);
251     }
252 
253     public static java.util.List<com.liferay.portal.model.Organization> findAll()
254         throws com.liferay.portal.SystemException {
255         return getPersistence().findAll();
256     }
257 
258     public static java.util.List<com.liferay.portal.model.Organization> findAll(
259         int begin, int end) throws com.liferay.portal.SystemException {
260         return getPersistence().findAll(begin, end);
261     }
262 
263     public static java.util.List<com.liferay.portal.model.Organization> findAll(
264         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
265         throws com.liferay.portal.SystemException {
266         return getPersistence().findAll(begin, end, obc);
267     }
268 
269     public static void removeByCompanyId(long companyId)
270         throws com.liferay.portal.SystemException {
271         getPersistence().removeByCompanyId(companyId);
272     }
273 
274     public static void removeByLocations(long companyId)
275         throws com.liferay.portal.SystemException {
276         getPersistence().removeByLocations(companyId);
277     }
278 
279     public static void removeByC_P(long companyId, long parentOrganizationId)
280         throws com.liferay.portal.SystemException {
281         getPersistence().removeByC_P(companyId, parentOrganizationId);
282     }
283 
284     public static void removeByC_N(long companyId, java.lang.String name)
285         throws com.liferay.portal.SystemException,
286             com.liferay.portal.NoSuchOrganizationException {
287         getPersistence().removeByC_N(companyId, name);
288     }
289 
290     public static void removeAll() throws com.liferay.portal.SystemException {
291         getPersistence().removeAll();
292     }
293 
294     public static int countByCompanyId(long companyId)
295         throws com.liferay.portal.SystemException {
296         return getPersistence().countByCompanyId(companyId);
297     }
298 
299     public static int countByLocations(long companyId)
300         throws com.liferay.portal.SystemException {
301         return getPersistence().countByLocations(companyId);
302     }
303 
304     public static int countByC_P(long companyId, long parentOrganizationId)
305         throws com.liferay.portal.SystemException {
306         return getPersistence().countByC_P(companyId, parentOrganizationId);
307     }
308 
309     public static int countByC_N(long companyId, java.lang.String name)
310         throws com.liferay.portal.SystemException {
311         return getPersistence().countByC_N(companyId, name);
312     }
313 
314     public static int countAll() throws com.liferay.portal.SystemException {
315         return getPersistence().countAll();
316     }
317 
318     public static java.util.List<com.liferay.portal.model.Group> getGroups(
319         long pk)
320         throws com.liferay.portal.SystemException,
321             com.liferay.portal.NoSuchOrganizationException {
322         return getPersistence().getGroups(pk);
323     }
324 
325     public static java.util.List<com.liferay.portal.model.Group> getGroups(
326         long pk, int begin, int end)
327         throws com.liferay.portal.SystemException,
328             com.liferay.portal.NoSuchOrganizationException {
329         return getPersistence().getGroups(pk, begin, end);
330     }
331 
332     public static java.util.List<com.liferay.portal.model.Group> getGroups(
333         long pk, int begin, int end,
334         com.liferay.portal.kernel.util.OrderByComparator obc)
335         throws com.liferay.portal.SystemException,
336             com.liferay.portal.NoSuchOrganizationException {
337         return getPersistence().getGroups(pk, begin, end, obc);
338     }
339 
340     public static int getGroupsSize(long pk)
341         throws com.liferay.portal.SystemException {
342         return getPersistence().getGroupsSize(pk);
343     }
344 
345     public static boolean containsGroup(long pk, long groupPK)
346         throws com.liferay.portal.SystemException {
347         return getPersistence().containsGroup(pk, groupPK);
348     }
349 
350     public static boolean containsGroups(long pk)
351         throws com.liferay.portal.SystemException {
352         return getPersistence().containsGroups(pk);
353     }
354 
355     public static void addGroup(long pk, long groupPK)
356         throws com.liferay.portal.SystemException,
357             com.liferay.portal.NoSuchGroupException,
358             com.liferay.portal.NoSuchOrganizationException {
359         getPersistence().addGroup(pk, groupPK);
360     }
361 
362     public static void addGroup(long pk, com.liferay.portal.model.Group group)
363         throws com.liferay.portal.SystemException,
364             com.liferay.portal.NoSuchGroupException,
365             com.liferay.portal.NoSuchOrganizationException {
366         getPersistence().addGroup(pk, group);
367     }
368 
369     public static void addGroups(long pk, long[] groupPKs)
370         throws com.liferay.portal.SystemException,
371             com.liferay.portal.NoSuchGroupException,
372             com.liferay.portal.NoSuchOrganizationException {
373         getPersistence().addGroups(pk, groupPKs);
374     }
375 
376     public static void addGroups(long pk,
377         java.util.List<com.liferay.portal.model.Group> groups)
378         throws com.liferay.portal.SystemException,
379             com.liferay.portal.NoSuchGroupException,
380             com.liferay.portal.NoSuchOrganizationException {
381         getPersistence().addGroups(pk, groups);
382     }
383 
384     public static void clearGroups(long pk)
385         throws com.liferay.portal.SystemException,
386             com.liferay.portal.NoSuchOrganizationException {
387         getPersistence().clearGroups(pk);
388     }
389 
390     public static void removeGroup(long pk, long groupPK)
391         throws com.liferay.portal.SystemException,
392             com.liferay.portal.NoSuchGroupException,
393             com.liferay.portal.NoSuchOrganizationException {
394         getPersistence().removeGroup(pk, groupPK);
395     }
396 
397     public static void removeGroup(long pk, com.liferay.portal.model.Group group)
398         throws com.liferay.portal.SystemException,
399             com.liferay.portal.NoSuchGroupException,
400             com.liferay.portal.NoSuchOrganizationException {
401         getPersistence().removeGroup(pk, group);
402     }
403 
404     public static void removeGroups(long pk, long[] groupPKs)
405         throws com.liferay.portal.SystemException,
406             com.liferay.portal.NoSuchGroupException,
407             com.liferay.portal.NoSuchOrganizationException {
408         getPersistence().removeGroups(pk, groupPKs);
409     }
410 
411     public static void removeGroups(long pk,
412         java.util.List<com.liferay.portal.model.Group> groups)
413         throws com.liferay.portal.SystemException,
414             com.liferay.portal.NoSuchGroupException,
415             com.liferay.portal.NoSuchOrganizationException {
416         getPersistence().removeGroups(pk, groups);
417     }
418 
419     public static void setGroups(long pk, long[] groupPKs)
420         throws com.liferay.portal.SystemException,
421             com.liferay.portal.NoSuchGroupException,
422             com.liferay.portal.NoSuchOrganizationException {
423         getPersistence().setGroups(pk, groupPKs);
424     }
425 
426     public static void setGroups(long pk,
427         java.util.List<com.liferay.portal.model.Group> groups)
428         throws com.liferay.portal.SystemException,
429             com.liferay.portal.NoSuchGroupException,
430             com.liferay.portal.NoSuchOrganizationException {
431         getPersistence().setGroups(pk, groups);
432     }
433 
434     public static java.util.List<com.liferay.portal.model.User> getUsers(
435         long pk)
436         throws com.liferay.portal.SystemException,
437             com.liferay.portal.NoSuchOrganizationException {
438         return getPersistence().getUsers(pk);
439     }
440 
441     public static java.util.List<com.liferay.portal.model.User> getUsers(
442         long pk, int begin, int end)
443         throws com.liferay.portal.SystemException,
444             com.liferay.portal.NoSuchOrganizationException {
445         return getPersistence().getUsers(pk, begin, end);
446     }
447 
448     public static java.util.List<com.liferay.portal.model.User> getUsers(
449         long pk, int begin, int end,
450         com.liferay.portal.kernel.util.OrderByComparator obc)
451         throws com.liferay.portal.SystemException,
452             com.liferay.portal.NoSuchOrganizationException {
453         return getPersistence().getUsers(pk, begin, end, obc);
454     }
455 
456     public static int getUsersSize(long pk)
457         throws com.liferay.portal.SystemException {
458         return getPersistence().getUsersSize(pk);
459     }
460 
461     public static boolean containsUser(long pk, long userPK)
462         throws com.liferay.portal.SystemException {
463         return getPersistence().containsUser(pk, userPK);
464     }
465 
466     public static boolean containsUsers(long pk)
467         throws com.liferay.portal.SystemException {
468         return getPersistence().containsUsers(pk);
469     }
470 
471     public static void addUser(long pk, long userPK)
472         throws com.liferay.portal.SystemException,
473             com.liferay.portal.NoSuchOrganizationException,
474             com.liferay.portal.NoSuchUserException {
475         getPersistence().addUser(pk, userPK);
476     }
477 
478     public static void addUser(long pk, com.liferay.portal.model.User user)
479         throws com.liferay.portal.SystemException,
480             com.liferay.portal.NoSuchOrganizationException,
481             com.liferay.portal.NoSuchUserException {
482         getPersistence().addUser(pk, user);
483     }
484 
485     public static void addUsers(long pk, long[] userPKs)
486         throws com.liferay.portal.SystemException,
487             com.liferay.portal.NoSuchOrganizationException,
488             com.liferay.portal.NoSuchUserException {
489         getPersistence().addUsers(pk, userPKs);
490     }
491 
492     public static void addUsers(long pk,
493         java.util.List<com.liferay.portal.model.User> users)
494         throws com.liferay.portal.SystemException,
495             com.liferay.portal.NoSuchOrganizationException,
496             com.liferay.portal.NoSuchUserException {
497         getPersistence().addUsers(pk, users);
498     }
499 
500     public static void clearUsers(long pk)
501         throws com.liferay.portal.SystemException,
502             com.liferay.portal.NoSuchOrganizationException {
503         getPersistence().clearUsers(pk);
504     }
505 
506     public static void removeUser(long pk, long userPK)
507         throws com.liferay.portal.SystemException,
508             com.liferay.portal.NoSuchOrganizationException,
509             com.liferay.portal.NoSuchUserException {
510         getPersistence().removeUser(pk, userPK);
511     }
512 
513     public static void removeUser(long pk, com.liferay.portal.model.User user)
514         throws com.liferay.portal.SystemException,
515             com.liferay.portal.NoSuchOrganizationException,
516             com.liferay.portal.NoSuchUserException {
517         getPersistence().removeUser(pk, user);
518     }
519 
520     public static void removeUsers(long pk, long[] userPKs)
521         throws com.liferay.portal.SystemException,
522             com.liferay.portal.NoSuchOrganizationException,
523             com.liferay.portal.NoSuchUserException {
524         getPersistence().removeUsers(pk, userPKs);
525     }
526 
527     public static void removeUsers(long pk,
528         java.util.List<com.liferay.portal.model.User> users)
529         throws com.liferay.portal.SystemException,
530             com.liferay.portal.NoSuchOrganizationException,
531             com.liferay.portal.NoSuchUserException {
532         getPersistence().removeUsers(pk, users);
533     }
534 
535     public static void setUsers(long pk, long[] userPKs)
536         throws com.liferay.portal.SystemException,
537             com.liferay.portal.NoSuchOrganizationException,
538             com.liferay.portal.NoSuchUserException {
539         getPersistence().setUsers(pk, userPKs);
540     }
541 
542     public static void setUsers(long pk,
543         java.util.List<com.liferay.portal.model.User> users)
544         throws com.liferay.portal.SystemException,
545             com.liferay.portal.NoSuchOrganizationException,
546             com.liferay.portal.NoSuchUserException {
547         getPersistence().setUsers(pk, users);
548     }
549 
550     public static OrganizationPersistence getPersistence() {
551         return _getUtil()._persistence;
552     }
553 
554     public void setPersistence(OrganizationPersistence persistence) {
555         _persistence = persistence;
556     }
557 
558     private static OrganizationUtil _getUtil() {
559         if (_util == null) {
560             _util = (OrganizationUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
561         }
562 
563         return _util;
564     }
565 
566     private static final String _UTIL = OrganizationUtil.class.getName();
567     private static OrganizationUtil _util;
568     private OrganizationPersistence _persistence;
569 }