1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="OrganizationUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class OrganizationUtil {
29      public static void cacheResult(
30          com.liferay.portal.model.Organization organization) {
31          getPersistence().cacheResult(organization);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portal.model.Organization> organizations) {
36          getPersistence().cacheResult(organizations);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portal.model.Organization create(
44          long organizationId) {
45          return getPersistence().create(organizationId);
46      }
47  
48      public static com.liferay.portal.model.Organization remove(
49          long organizationId)
50          throws com.liferay.portal.NoSuchOrganizationException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(organizationId);
53      }
54  
55      public static com.liferay.portal.model.Organization remove(
56          com.liferay.portal.model.Organization organization)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(organization);
59      }
60  
61      /**
62       * @deprecated Use <code>update(Organization organization, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.Organization update(
65          com.liferay.portal.model.Organization organization)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(organization);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        organization the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when organization is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.Organization update(
84          com.liferay.portal.model.Organization organization, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(organization, merge);
87      }
88  
89      public static com.liferay.portal.model.Organization updateImpl(
90          com.liferay.portal.model.Organization organization, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(organization, merge);
93      }
94  
95      public static com.liferay.portal.model.Organization findByPrimaryKey(
96          long organizationId)
97          throws com.liferay.portal.NoSuchOrganizationException,
98              com.liferay.portal.SystemException {
99          return getPersistence().findByPrimaryKey(organizationId);
100     }
101 
102     public static com.liferay.portal.model.Organization fetchByPrimaryKey(
103         long organizationId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(organizationId);
105     }
106 
107     public static java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
108         long companyId) throws com.liferay.portal.SystemException {
109         return getPersistence().findByCompanyId(companyId);
110     }
111 
112     public static java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
113         long companyId, int start, int end)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().findByCompanyId(companyId, start, end);
116     }
117 
118     public static java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
119         long companyId, int start, int end,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByCompanyId(companyId, start, end, obc);
123     }
124 
125     public static com.liferay.portal.model.Organization findByCompanyId_First(
126         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.NoSuchOrganizationException,
128             com.liferay.portal.SystemException {
129         return getPersistence().findByCompanyId_First(companyId, obc);
130     }
131 
132     public static com.liferay.portal.model.Organization findByCompanyId_Last(
133         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.NoSuchOrganizationException,
135             com.liferay.portal.SystemException {
136         return getPersistence().findByCompanyId_Last(companyId, obc);
137     }
138 
139     public static com.liferay.portal.model.Organization[] findByCompanyId_PrevAndNext(
140         long organizationId, long companyId,
141         com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.NoSuchOrganizationException,
143             com.liferay.portal.SystemException {
144         return getPersistence()
145                    .findByCompanyId_PrevAndNext(organizationId, companyId, obc);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.Organization> findByLocations(
149         long companyId) throws com.liferay.portal.SystemException {
150         return getPersistence().findByLocations(companyId);
151     }
152 
153     public static java.util.List<com.liferay.portal.model.Organization> findByLocations(
154         long companyId, int start, int end)
155         throws com.liferay.portal.SystemException {
156         return getPersistence().findByLocations(companyId, start, end);
157     }
158 
159     public static java.util.List<com.liferay.portal.model.Organization> findByLocations(
160         long companyId, int start, int end,
161         com.liferay.portal.kernel.util.OrderByComparator obc)
162         throws com.liferay.portal.SystemException {
163         return getPersistence().findByLocations(companyId, start, end, obc);
164     }
165 
166     public static com.liferay.portal.model.Organization findByLocations_First(
167         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
168         throws com.liferay.portal.NoSuchOrganizationException,
169             com.liferay.portal.SystemException {
170         return getPersistence().findByLocations_First(companyId, obc);
171     }
172 
173     public static com.liferay.portal.model.Organization findByLocations_Last(
174         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
175         throws com.liferay.portal.NoSuchOrganizationException,
176             com.liferay.portal.SystemException {
177         return getPersistence().findByLocations_Last(companyId, obc);
178     }
179 
180     public static com.liferay.portal.model.Organization[] findByLocations_PrevAndNext(
181         long organizationId, long companyId,
182         com.liferay.portal.kernel.util.OrderByComparator obc)
183         throws com.liferay.portal.NoSuchOrganizationException,
184             com.liferay.portal.SystemException {
185         return getPersistence()
186                    .findByLocations_PrevAndNext(organizationId, companyId, obc);
187     }
188 
189     public static java.util.List<com.liferay.portal.model.Organization> findByC_P(
190         long companyId, long parentOrganizationId)
191         throws com.liferay.portal.SystemException {
192         return getPersistence().findByC_P(companyId, parentOrganizationId);
193     }
194 
195     public static java.util.List<com.liferay.portal.model.Organization> findByC_P(
196         long companyId, long parentOrganizationId, int start, int end)
197         throws com.liferay.portal.SystemException {
198         return getPersistence()
199                    .findByC_P(companyId, parentOrganizationId, start, end);
200     }
201 
202     public static java.util.List<com.liferay.portal.model.Organization> findByC_P(
203         long companyId, long parentOrganizationId, int start, int end,
204         com.liferay.portal.kernel.util.OrderByComparator obc)
205         throws com.liferay.portal.SystemException {
206         return getPersistence()
207                    .findByC_P(companyId, parentOrganizationId, start, end, obc);
208     }
209 
210     public static com.liferay.portal.model.Organization findByC_P_First(
211         long companyId, long parentOrganizationId,
212         com.liferay.portal.kernel.util.OrderByComparator obc)
213         throws com.liferay.portal.NoSuchOrganizationException,
214             com.liferay.portal.SystemException {
215         return getPersistence()
216                    .findByC_P_First(companyId, parentOrganizationId, obc);
217     }
218 
219     public static com.liferay.portal.model.Organization findByC_P_Last(
220         long companyId, long parentOrganizationId,
221         com.liferay.portal.kernel.util.OrderByComparator obc)
222         throws com.liferay.portal.NoSuchOrganizationException,
223             com.liferay.portal.SystemException {
224         return getPersistence()
225                    .findByC_P_Last(companyId, parentOrganizationId, obc);
226     }
227 
228     public static com.liferay.portal.model.Organization[] findByC_P_PrevAndNext(
229         long organizationId, long companyId, long parentOrganizationId,
230         com.liferay.portal.kernel.util.OrderByComparator obc)
231         throws com.liferay.portal.NoSuchOrganizationException,
232             com.liferay.portal.SystemException {
233         return getPersistence()
234                    .findByC_P_PrevAndNext(organizationId, companyId,
235             parentOrganizationId, obc);
236     }
237 
238     public static com.liferay.portal.model.Organization findByC_N(
239         long companyId, java.lang.String name)
240         throws com.liferay.portal.NoSuchOrganizationException,
241             com.liferay.portal.SystemException {
242         return getPersistence().findByC_N(companyId, name);
243     }
244 
245     public static com.liferay.portal.model.Organization fetchByC_N(
246         long companyId, java.lang.String name)
247         throws com.liferay.portal.SystemException {
248         return getPersistence().fetchByC_N(companyId, name);
249     }
250 
251     public static com.liferay.portal.model.Organization fetchByC_N(
252         long companyId, java.lang.String name, boolean retrieveFromCache)
253         throws com.liferay.portal.SystemException {
254         return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
255     }
256 
257     public static java.util.List<Object> findWithDynamicQuery(
258         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
259         throws com.liferay.portal.SystemException {
260         return getPersistence().findWithDynamicQuery(dynamicQuery);
261     }
262 
263     public static java.util.List<Object> findWithDynamicQuery(
264         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
265         int end) throws com.liferay.portal.SystemException {
266         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
267     }
268 
269     public static java.util.List<com.liferay.portal.model.Organization> findAll()
270         throws com.liferay.portal.SystemException {
271         return getPersistence().findAll();
272     }
273 
274     public static java.util.List<com.liferay.portal.model.Organization> findAll(
275         int start, int end) throws com.liferay.portal.SystemException {
276         return getPersistence().findAll(start, end);
277     }
278 
279     public static java.util.List<com.liferay.portal.model.Organization> findAll(
280         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
281         throws com.liferay.portal.SystemException {
282         return getPersistence().findAll(start, end, obc);
283     }
284 
285     public static void removeByCompanyId(long companyId)
286         throws com.liferay.portal.SystemException {
287         getPersistence().removeByCompanyId(companyId);
288     }
289 
290     public static void removeByLocations(long companyId)
291         throws com.liferay.portal.SystemException {
292         getPersistence().removeByLocations(companyId);
293     }
294 
295     public static void removeByC_P(long companyId, long parentOrganizationId)
296         throws com.liferay.portal.SystemException {
297         getPersistence().removeByC_P(companyId, parentOrganizationId);
298     }
299 
300     public static void removeByC_N(long companyId, java.lang.String name)
301         throws com.liferay.portal.NoSuchOrganizationException,
302             com.liferay.portal.SystemException {
303         getPersistence().removeByC_N(companyId, name);
304     }
305 
306     public static void removeAll() throws com.liferay.portal.SystemException {
307         getPersistence().removeAll();
308     }
309 
310     public static int countByCompanyId(long companyId)
311         throws com.liferay.portal.SystemException {
312         return getPersistence().countByCompanyId(companyId);
313     }
314 
315     public static int countByLocations(long companyId)
316         throws com.liferay.portal.SystemException {
317         return getPersistence().countByLocations(companyId);
318     }
319 
320     public static int countByC_P(long companyId, long parentOrganizationId)
321         throws com.liferay.portal.SystemException {
322         return getPersistence().countByC_P(companyId, parentOrganizationId);
323     }
324 
325     public static int countByC_N(long companyId, java.lang.String name)
326         throws com.liferay.portal.SystemException {
327         return getPersistence().countByC_N(companyId, name);
328     }
329 
330     public static int countAll() throws com.liferay.portal.SystemException {
331         return getPersistence().countAll();
332     }
333 
334     public static java.util.List<com.liferay.portal.model.Group> getGroups(
335         long pk) throws com.liferay.portal.SystemException {
336         return getPersistence().getGroups(pk);
337     }
338 
339     public static java.util.List<com.liferay.portal.model.Group> getGroups(
340         long pk, int start, int end) throws com.liferay.portal.SystemException {
341         return getPersistence().getGroups(pk, start, end);
342     }
343 
344     public static java.util.List<com.liferay.portal.model.Group> getGroups(
345         long pk, int start, int end,
346         com.liferay.portal.kernel.util.OrderByComparator obc)
347         throws com.liferay.portal.SystemException {
348         return getPersistence().getGroups(pk, start, end, obc);
349     }
350 
351     public static int getGroupsSize(long pk)
352         throws com.liferay.portal.SystemException {
353         return getPersistence().getGroupsSize(pk);
354     }
355 
356     public static boolean containsGroup(long pk, long groupPK)
357         throws com.liferay.portal.SystemException {
358         return getPersistence().containsGroup(pk, groupPK);
359     }
360 
361     public static boolean containsGroups(long pk)
362         throws com.liferay.portal.SystemException {
363         return getPersistence().containsGroups(pk);
364     }
365 
366     public static void addGroup(long pk, long groupPK)
367         throws com.liferay.portal.SystemException {
368         getPersistence().addGroup(pk, groupPK);
369     }
370 
371     public static void addGroup(long pk, com.liferay.portal.model.Group group)
372         throws com.liferay.portal.SystemException {
373         getPersistence().addGroup(pk, group);
374     }
375 
376     public static void addGroups(long pk, long[] groupPKs)
377         throws com.liferay.portal.SystemException {
378         getPersistence().addGroups(pk, groupPKs);
379     }
380 
381     public static void addGroups(long pk,
382         java.util.List<com.liferay.portal.model.Group> groups)
383         throws com.liferay.portal.SystemException {
384         getPersistence().addGroups(pk, groups);
385     }
386 
387     public static void clearGroups(long pk)
388         throws com.liferay.portal.SystemException {
389         getPersistence().clearGroups(pk);
390     }
391 
392     public static void removeGroup(long pk, long groupPK)
393         throws com.liferay.portal.SystemException {
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         getPersistence().removeGroup(pk, group);
400     }
401 
402     public static void removeGroups(long pk, long[] groupPKs)
403         throws com.liferay.portal.SystemException {
404         getPersistence().removeGroups(pk, groupPKs);
405     }
406 
407     public static void removeGroups(long pk,
408         java.util.List<com.liferay.portal.model.Group> groups)
409         throws com.liferay.portal.SystemException {
410         getPersistence().removeGroups(pk, groups);
411     }
412 
413     public static void setGroups(long pk, long[] groupPKs)
414         throws com.liferay.portal.SystemException {
415         getPersistence().setGroups(pk, groupPKs);
416     }
417 
418     public static void setGroups(long pk,
419         java.util.List<com.liferay.portal.model.Group> groups)
420         throws com.liferay.portal.SystemException {
421         getPersistence().setGroups(pk, groups);
422     }
423 
424     public static java.util.List<com.liferay.portal.model.User> getUsers(
425         long pk) throws com.liferay.portal.SystemException {
426         return getPersistence().getUsers(pk);
427     }
428 
429     public static java.util.List<com.liferay.portal.model.User> getUsers(
430         long pk, int start, int end) throws com.liferay.portal.SystemException {
431         return getPersistence().getUsers(pk, start, end);
432     }
433 
434     public static java.util.List<com.liferay.portal.model.User> getUsers(
435         long pk, int start, int end,
436         com.liferay.portal.kernel.util.OrderByComparator obc)
437         throws com.liferay.portal.SystemException {
438         return getPersistence().getUsers(pk, start, end, obc);
439     }
440 
441     public static int getUsersSize(long pk)
442         throws com.liferay.portal.SystemException {
443         return getPersistence().getUsersSize(pk);
444     }
445 
446     public static boolean containsUser(long pk, long userPK)
447         throws com.liferay.portal.SystemException {
448         return getPersistence().containsUser(pk, userPK);
449     }
450 
451     public static boolean containsUsers(long pk)
452         throws com.liferay.portal.SystemException {
453         return getPersistence().containsUsers(pk);
454     }
455 
456     public static void addUser(long pk, long userPK)
457         throws com.liferay.portal.SystemException {
458         getPersistence().addUser(pk, userPK);
459     }
460 
461     public static void addUser(long pk, com.liferay.portal.model.User user)
462         throws com.liferay.portal.SystemException {
463         getPersistence().addUser(pk, user);
464     }
465 
466     public static void addUsers(long pk, long[] userPKs)
467         throws com.liferay.portal.SystemException {
468         getPersistence().addUsers(pk, userPKs);
469     }
470 
471     public static void addUsers(long pk,
472         java.util.List<com.liferay.portal.model.User> users)
473         throws com.liferay.portal.SystemException {
474         getPersistence().addUsers(pk, users);
475     }
476 
477     public static void clearUsers(long pk)
478         throws com.liferay.portal.SystemException {
479         getPersistence().clearUsers(pk);
480     }
481 
482     public static void removeUser(long pk, long userPK)
483         throws com.liferay.portal.SystemException {
484         getPersistence().removeUser(pk, userPK);
485     }
486 
487     public static void removeUser(long pk, com.liferay.portal.model.User user)
488         throws com.liferay.portal.SystemException {
489         getPersistence().removeUser(pk, user);
490     }
491 
492     public static void removeUsers(long pk, long[] userPKs)
493         throws com.liferay.portal.SystemException {
494         getPersistence().removeUsers(pk, userPKs);
495     }
496 
497     public static void removeUsers(long pk,
498         java.util.List<com.liferay.portal.model.User> users)
499         throws com.liferay.portal.SystemException {
500         getPersistence().removeUsers(pk, users);
501     }
502 
503     public static void setUsers(long pk, long[] userPKs)
504         throws com.liferay.portal.SystemException {
505         getPersistence().setUsers(pk, userPKs);
506     }
507 
508     public static void setUsers(long pk,
509         java.util.List<com.liferay.portal.model.User> users)
510         throws com.liferay.portal.SystemException {
511         getPersistence().setUsers(pk, users);
512     }
513 
514     public static void rebuildTree(long companyId, boolean force)
515         throws com.liferay.portal.SystemException {
516         getPersistence().rebuildTree(companyId, force);
517     }
518 
519     public static OrganizationPersistence getPersistence() {
520         return _persistence;
521     }
522 
523     public void setPersistence(OrganizationPersistence persistence) {
524         _persistence = persistence;
525     }
526 
527     private static OrganizationPersistence _persistence;
528 }