1   /**
2    * Copyright (c) 2000-2007 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  import com.liferay.portal.kernel.util.GetterUtil;
26  import com.liferay.portal.kernel.util.Validator;
27  import com.liferay.portal.model.ModelListener;
28  import com.liferay.portal.util.PropsUtil;
29  
30  import org.apache.commons.logging.Log;
31  import org.apache.commons.logging.LogFactory;
32  
33  /**
34   * <a href="UserUtil.java.html"><b><i>View Source</i></b></a>
35   *
36   * @author Brian Wing Shun Chan
37   *
38   */
39  public class UserUtil {
40      public static com.liferay.portal.model.User create(long userId) {
41          return getPersistence().create(userId);
42      }
43  
44      public static com.liferay.portal.model.User remove(long userId)
45          throws com.liferay.portal.SystemException, 
46              com.liferay.portal.NoSuchUserException {
47          ModelListener listener = _getListener();
48  
49          if (listener != null) {
50              listener.onBeforeRemove(findByPrimaryKey(userId));
51          }
52  
53          com.liferay.portal.model.User user = getPersistence().remove(userId);
54  
55          if (listener != null) {
56              listener.onAfterRemove(user);
57          }
58  
59          return user;
60      }
61  
62      public static com.liferay.portal.model.User remove(
63          com.liferay.portal.model.User user)
64          throws com.liferay.portal.SystemException {
65          ModelListener listener = _getListener();
66  
67          if (listener != null) {
68              listener.onBeforeRemove(user);
69          }
70  
71          user = getPersistence().remove(user);
72  
73          if (listener != null) {
74              listener.onAfterRemove(user);
75          }
76  
77          return user;
78      }
79  
80      public static com.liferay.portal.model.User update(
81          com.liferay.portal.model.User user)
82          throws com.liferay.portal.SystemException {
83          ModelListener listener = _getListener();
84          boolean isNew = user.isNew();
85  
86          if (listener != null) {
87              if (isNew) {
88                  listener.onBeforeCreate(user);
89              }
90              else {
91                  listener.onBeforeUpdate(user);
92              }
93          }
94  
95          user = getPersistence().update(user);
96  
97          if (listener != null) {
98              if (isNew) {
99                  listener.onAfterCreate(user);
100             }
101             else {
102                 listener.onAfterUpdate(user);
103             }
104         }
105 
106         return user;
107     }
108 
109     public static com.liferay.portal.model.User update(
110         com.liferay.portal.model.User user, boolean merge)
111         throws com.liferay.portal.SystemException {
112         ModelListener listener = _getListener();
113         boolean isNew = user.isNew();
114 
115         if (listener != null) {
116             if (isNew) {
117                 listener.onBeforeCreate(user);
118             }
119             else {
120                 listener.onBeforeUpdate(user);
121             }
122         }
123 
124         user = getPersistence().update(user, merge);
125 
126         if (listener != null) {
127             if (isNew) {
128                 listener.onAfterCreate(user);
129             }
130             else {
131                 listener.onAfterUpdate(user);
132             }
133         }
134 
135         return user;
136     }
137 
138     public static com.liferay.portal.model.User findByPrimaryKey(long userId)
139         throws com.liferay.portal.SystemException, 
140             com.liferay.portal.NoSuchUserException {
141         return getPersistence().findByPrimaryKey(userId);
142     }
143 
144     public static com.liferay.portal.model.User fetchByPrimaryKey(long userId)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().fetchByPrimaryKey(userId);
147     }
148 
149     public static java.util.List findByCompanyId(long companyId)
150         throws com.liferay.portal.SystemException {
151         return getPersistence().findByCompanyId(companyId);
152     }
153 
154     public static java.util.List findByCompanyId(long companyId, int begin,
155         int end) throws com.liferay.portal.SystemException {
156         return getPersistence().findByCompanyId(companyId, begin, end);
157     }
158 
159     public static java.util.List findByCompanyId(long companyId, int begin,
160         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
161         throws com.liferay.portal.SystemException {
162         return getPersistence().findByCompanyId(companyId, begin, end, obc);
163     }
164 
165     public static com.liferay.portal.model.User findByCompanyId_First(
166         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
167         throws com.liferay.portal.SystemException, 
168             com.liferay.portal.NoSuchUserException {
169         return getPersistence().findByCompanyId_First(companyId, obc);
170     }
171 
172     public static com.liferay.portal.model.User findByCompanyId_Last(
173         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
174         throws com.liferay.portal.SystemException, 
175             com.liferay.portal.NoSuchUserException {
176         return getPersistence().findByCompanyId_Last(companyId, obc);
177     }
178 
179     public static com.liferay.portal.model.User[] findByCompanyId_PrevAndNext(
180         long userId, long companyId,
181         com.liferay.portal.kernel.util.OrderByComparator obc)
182         throws com.liferay.portal.SystemException, 
183             com.liferay.portal.NoSuchUserException {
184         return getPersistence().findByCompanyId_PrevAndNext(userId, companyId,
185             obc);
186     }
187 
188     public static com.liferay.portal.model.User findByContactId(long contactId)
189         throws com.liferay.portal.SystemException, 
190             com.liferay.portal.NoSuchUserException {
191         return getPersistence().findByContactId(contactId);
192     }
193 
194     public static com.liferay.portal.model.User fetchByContactId(long contactId)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().fetchByContactId(contactId);
197     }
198 
199     public static com.liferay.portal.model.User findByPortraitId(
200         long portraitId)
201         throws com.liferay.portal.SystemException, 
202             com.liferay.portal.NoSuchUserException {
203         return getPersistence().findByPortraitId(portraitId);
204     }
205 
206     public static com.liferay.portal.model.User fetchByPortraitId(
207         long portraitId) throws com.liferay.portal.SystemException {
208         return getPersistence().fetchByPortraitId(portraitId);
209     }
210 
211     public static com.liferay.portal.model.User findByC_U(long companyId,
212         long userId)
213         throws com.liferay.portal.SystemException, 
214             com.liferay.portal.NoSuchUserException {
215         return getPersistence().findByC_U(companyId, userId);
216     }
217 
218     public static com.liferay.portal.model.User fetchByC_U(long companyId,
219         long userId) throws com.liferay.portal.SystemException {
220         return getPersistence().fetchByC_U(companyId, userId);
221     }
222 
223     public static com.liferay.portal.model.User findByC_DU(long companyId,
224         boolean defaultUser)
225         throws com.liferay.portal.SystemException, 
226             com.liferay.portal.NoSuchUserException {
227         return getPersistence().findByC_DU(companyId, defaultUser);
228     }
229 
230     public static com.liferay.portal.model.User fetchByC_DU(long companyId,
231         boolean defaultUser) throws com.liferay.portal.SystemException {
232         return getPersistence().fetchByC_DU(companyId, defaultUser);
233     }
234 
235     public static java.util.List findByC_P(long companyId,
236         java.lang.String password) throws com.liferay.portal.SystemException {
237         return getPersistence().findByC_P(companyId, password);
238     }
239 
240     public static java.util.List findByC_P(long companyId,
241         java.lang.String password, int begin, int end)
242         throws com.liferay.portal.SystemException {
243         return getPersistence().findByC_P(companyId, password, begin, end);
244     }
245 
246     public static java.util.List findByC_P(long companyId,
247         java.lang.String password, int begin, int end,
248         com.liferay.portal.kernel.util.OrderByComparator obc)
249         throws com.liferay.portal.SystemException {
250         return getPersistence().findByC_P(companyId, password, begin, end, obc);
251     }
252 
253     public static com.liferay.portal.model.User findByC_P_First(
254         long companyId, java.lang.String password,
255         com.liferay.portal.kernel.util.OrderByComparator obc)
256         throws com.liferay.portal.SystemException, 
257             com.liferay.portal.NoSuchUserException {
258         return getPersistence().findByC_P_First(companyId, password, obc);
259     }
260 
261     public static com.liferay.portal.model.User findByC_P_Last(long companyId,
262         java.lang.String password,
263         com.liferay.portal.kernel.util.OrderByComparator obc)
264         throws com.liferay.portal.SystemException, 
265             com.liferay.portal.NoSuchUserException {
266         return getPersistence().findByC_P_Last(companyId, password, obc);
267     }
268 
269     public static com.liferay.portal.model.User[] findByC_P_PrevAndNext(
270         long userId, long companyId, java.lang.String password,
271         com.liferay.portal.kernel.util.OrderByComparator obc)
272         throws com.liferay.portal.SystemException, 
273             com.liferay.portal.NoSuchUserException {
274         return getPersistence().findByC_P_PrevAndNext(userId, companyId,
275             password, obc);
276     }
277 
278     public static com.liferay.portal.model.User findByC_SN(long companyId,
279         java.lang.String screenName)
280         throws com.liferay.portal.SystemException, 
281             com.liferay.portal.NoSuchUserException {
282         return getPersistence().findByC_SN(companyId, screenName);
283     }
284 
285     public static com.liferay.portal.model.User fetchByC_SN(long companyId,
286         java.lang.String screenName) throws com.liferay.portal.SystemException {
287         return getPersistence().fetchByC_SN(companyId, screenName);
288     }
289 
290     public static com.liferay.portal.model.User findByC_EA(long companyId,
291         java.lang.String emailAddress)
292         throws com.liferay.portal.SystemException, 
293             com.liferay.portal.NoSuchUserException {
294         return getPersistence().findByC_EA(companyId, emailAddress);
295     }
296 
297     public static com.liferay.portal.model.User fetchByC_EA(long companyId,
298         java.lang.String emailAddress)
299         throws com.liferay.portal.SystemException {
300         return getPersistence().fetchByC_EA(companyId, emailAddress);
301     }
302 
303     public static java.util.List findWithDynamicQuery(
304         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
305         throws com.liferay.portal.SystemException {
306         return getPersistence().findWithDynamicQuery(queryInitializer);
307     }
308 
309     public static java.util.List findWithDynamicQuery(
310         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
311         int begin, int end) throws com.liferay.portal.SystemException {
312         return getPersistence().findWithDynamicQuery(queryInitializer, begin,
313             end);
314     }
315 
316     public static java.util.List findAll()
317         throws com.liferay.portal.SystemException {
318         return getPersistence().findAll();
319     }
320 
321     public static java.util.List findAll(int begin, int end)
322         throws com.liferay.portal.SystemException {
323         return getPersistence().findAll(begin, end);
324     }
325 
326     public static java.util.List findAll(int begin, int end,
327         com.liferay.portal.kernel.util.OrderByComparator obc)
328         throws com.liferay.portal.SystemException {
329         return getPersistence().findAll(begin, end, obc);
330     }
331 
332     public static void removeByCompanyId(long companyId)
333         throws com.liferay.portal.SystemException {
334         getPersistence().removeByCompanyId(companyId);
335     }
336 
337     public static void removeByContactId(long contactId)
338         throws com.liferay.portal.SystemException, 
339             com.liferay.portal.NoSuchUserException {
340         getPersistence().removeByContactId(contactId);
341     }
342 
343     public static void removeByPortraitId(long portraitId)
344         throws com.liferay.portal.SystemException, 
345             com.liferay.portal.NoSuchUserException {
346         getPersistence().removeByPortraitId(portraitId);
347     }
348 
349     public static void removeByC_U(long companyId, long userId)
350         throws com.liferay.portal.SystemException, 
351             com.liferay.portal.NoSuchUserException {
352         getPersistence().removeByC_U(companyId, userId);
353     }
354 
355     public static void removeByC_DU(long companyId, boolean defaultUser)
356         throws com.liferay.portal.SystemException, 
357             com.liferay.portal.NoSuchUserException {
358         getPersistence().removeByC_DU(companyId, defaultUser);
359     }
360 
361     public static void removeByC_P(long companyId, java.lang.String password)
362         throws com.liferay.portal.SystemException {
363         getPersistence().removeByC_P(companyId, password);
364     }
365 
366     public static void removeByC_SN(long companyId, java.lang.String screenName)
367         throws com.liferay.portal.SystemException, 
368             com.liferay.portal.NoSuchUserException {
369         getPersistence().removeByC_SN(companyId, screenName);
370     }
371 
372     public static void removeByC_EA(long companyId,
373         java.lang.String emailAddress)
374         throws com.liferay.portal.SystemException, 
375             com.liferay.portal.NoSuchUserException {
376         getPersistence().removeByC_EA(companyId, emailAddress);
377     }
378 
379     public static void removeAll() throws com.liferay.portal.SystemException {
380         getPersistence().removeAll();
381     }
382 
383     public static int countByCompanyId(long companyId)
384         throws com.liferay.portal.SystemException {
385         return getPersistence().countByCompanyId(companyId);
386     }
387 
388     public static int countByContactId(long contactId)
389         throws com.liferay.portal.SystemException {
390         return getPersistence().countByContactId(contactId);
391     }
392 
393     public static int countByPortraitId(long portraitId)
394         throws com.liferay.portal.SystemException {
395         return getPersistence().countByPortraitId(portraitId);
396     }
397 
398     public static int countByC_U(long companyId, long userId)
399         throws com.liferay.portal.SystemException {
400         return getPersistence().countByC_U(companyId, userId);
401     }
402 
403     public static int countByC_DU(long companyId, boolean defaultUser)
404         throws com.liferay.portal.SystemException {
405         return getPersistence().countByC_DU(companyId, defaultUser);
406     }
407 
408     public static int countByC_P(long companyId, java.lang.String password)
409         throws com.liferay.portal.SystemException {
410         return getPersistence().countByC_P(companyId, password);
411     }
412 
413     public static int countByC_SN(long companyId, java.lang.String screenName)
414         throws com.liferay.portal.SystemException {
415         return getPersistence().countByC_SN(companyId, screenName);
416     }
417 
418     public static int countByC_EA(long companyId, java.lang.String emailAddress)
419         throws com.liferay.portal.SystemException {
420         return getPersistence().countByC_EA(companyId, emailAddress);
421     }
422 
423     public static int countAll() throws com.liferay.portal.SystemException {
424         return getPersistence().countAll();
425     }
426 
427     public static java.util.List getGroups(long pk)
428         throws com.liferay.portal.SystemException, 
429             com.liferay.portal.NoSuchUserException {
430         return getPersistence().getGroups(pk);
431     }
432 
433     public static java.util.List getGroups(long pk, int begin, int end)
434         throws com.liferay.portal.SystemException, 
435             com.liferay.portal.NoSuchUserException {
436         return getPersistence().getGroups(pk, begin, end);
437     }
438 
439     public static java.util.List getGroups(long pk, int begin, int end,
440         com.liferay.portal.kernel.util.OrderByComparator obc)
441         throws com.liferay.portal.SystemException, 
442             com.liferay.portal.NoSuchUserException {
443         return getPersistence().getGroups(pk, begin, end, obc);
444     }
445 
446     public static int getGroupsSize(long pk)
447         throws com.liferay.portal.SystemException {
448         return getPersistence().getGroupsSize(pk);
449     }
450 
451     public static boolean containsGroup(long pk, long groupPK)
452         throws com.liferay.portal.SystemException {
453         return getPersistence().containsGroup(pk, groupPK);
454     }
455 
456     public static boolean containsGroups(long pk)
457         throws com.liferay.portal.SystemException {
458         return getPersistence().containsGroups(pk);
459     }
460 
461     public static void addGroup(long pk, long groupPK)
462         throws com.liferay.portal.SystemException, 
463             com.liferay.portal.NoSuchGroupException, 
464             com.liferay.portal.NoSuchUserException {
465         getPersistence().addGroup(pk, groupPK);
466     }
467 
468     public static void addGroup(long pk, com.liferay.portal.model.Group group)
469         throws com.liferay.portal.SystemException, 
470             com.liferay.portal.NoSuchGroupException, 
471             com.liferay.portal.NoSuchUserException {
472         getPersistence().addGroup(pk, group);
473     }
474 
475     public static void addGroups(long pk, long[] groupPKs)
476         throws com.liferay.portal.SystemException, 
477             com.liferay.portal.NoSuchGroupException, 
478             com.liferay.portal.NoSuchUserException {
479         getPersistence().addGroups(pk, groupPKs);
480     }
481 
482     public static void addGroups(long pk, java.util.List groups)
483         throws com.liferay.portal.SystemException, 
484             com.liferay.portal.NoSuchGroupException, 
485             com.liferay.portal.NoSuchUserException {
486         getPersistence().addGroups(pk, groups);
487     }
488 
489     public static void clearGroups(long pk)
490         throws com.liferay.portal.SystemException, 
491             com.liferay.portal.NoSuchUserException {
492         getPersistence().clearGroups(pk);
493     }
494 
495     public static void removeGroup(long pk, long groupPK)
496         throws com.liferay.portal.SystemException, 
497             com.liferay.portal.NoSuchGroupException, 
498             com.liferay.portal.NoSuchUserException {
499         getPersistence().removeGroup(pk, groupPK);
500     }
501 
502     public static void removeGroup(long pk, com.liferay.portal.model.Group group)
503         throws com.liferay.portal.SystemException, 
504             com.liferay.portal.NoSuchGroupException, 
505             com.liferay.portal.NoSuchUserException {
506         getPersistence().removeGroup(pk, group);
507     }
508 
509     public static void removeGroups(long pk, long[] groupPKs)
510         throws com.liferay.portal.SystemException, 
511             com.liferay.portal.NoSuchGroupException, 
512             com.liferay.portal.NoSuchUserException {
513         getPersistence().removeGroups(pk, groupPKs);
514     }
515 
516     public static void removeGroups(long pk, java.util.List groups)
517         throws com.liferay.portal.SystemException, 
518             com.liferay.portal.NoSuchGroupException, 
519             com.liferay.portal.NoSuchUserException {
520         getPersistence().removeGroups(pk, groups);
521     }
522 
523     public static void setGroups(long pk, long[] groupPKs)
524         throws com.liferay.portal.SystemException, 
525             com.liferay.portal.NoSuchGroupException, 
526             com.liferay.portal.NoSuchUserException {
527         getPersistence().setGroups(pk, groupPKs);
528     }
529 
530     public static void setGroups(long pk, java.util.List groups)
531         throws com.liferay.portal.SystemException, 
532             com.liferay.portal.NoSuchGroupException, 
533             com.liferay.portal.NoSuchUserException {
534         getPersistence().setGroups(pk, groups);
535     }
536 
537     public static java.util.List getOrganizations(long pk)
538         throws com.liferay.portal.SystemException, 
539             com.liferay.portal.NoSuchUserException {
540         return getPersistence().getOrganizations(pk);
541     }
542 
543     public static java.util.List getOrganizations(long pk, int begin, int end)
544         throws com.liferay.portal.SystemException, 
545             com.liferay.portal.NoSuchUserException {
546         return getPersistence().getOrganizations(pk, begin, end);
547     }
548 
549     public static java.util.List getOrganizations(long pk, int begin, int end,
550         com.liferay.portal.kernel.util.OrderByComparator obc)
551         throws com.liferay.portal.SystemException, 
552             com.liferay.portal.NoSuchUserException {
553         return getPersistence().getOrganizations(pk, begin, end, obc);
554     }
555 
556     public static int getOrganizationsSize(long pk)
557         throws com.liferay.portal.SystemException {
558         return getPersistence().getOrganizationsSize(pk);
559     }
560 
561     public static boolean containsOrganization(long pk, long organizationPK)
562         throws com.liferay.portal.SystemException {
563         return getPersistence().containsOrganization(pk, organizationPK);
564     }
565 
566     public static boolean containsOrganizations(long pk)
567         throws com.liferay.portal.SystemException {
568         return getPersistence().containsOrganizations(pk);
569     }
570 
571     public static void addOrganization(long pk, long organizationPK)
572         throws com.liferay.portal.SystemException, 
573             com.liferay.portal.NoSuchOrganizationException, 
574             com.liferay.portal.NoSuchUserException {
575         getPersistence().addOrganization(pk, organizationPK);
576     }
577 
578     public static void addOrganization(long pk,
579         com.liferay.portal.model.Organization organization)
580         throws com.liferay.portal.SystemException, 
581             com.liferay.portal.NoSuchOrganizationException, 
582             com.liferay.portal.NoSuchUserException {
583         getPersistence().addOrganization(pk, organization);
584     }
585 
586     public static void addOrganizations(long pk, long[] organizationPKs)
587         throws com.liferay.portal.SystemException, 
588             com.liferay.portal.NoSuchOrganizationException, 
589             com.liferay.portal.NoSuchUserException {
590         getPersistence().addOrganizations(pk, organizationPKs);
591     }
592 
593     public static void addOrganizations(long pk, java.util.List organizations)
594         throws com.liferay.portal.SystemException, 
595             com.liferay.portal.NoSuchOrganizationException, 
596             com.liferay.portal.NoSuchUserException {
597         getPersistence().addOrganizations(pk, organizations);
598     }
599 
600     public static void clearOrganizations(long pk)
601         throws com.liferay.portal.SystemException, 
602             com.liferay.portal.NoSuchUserException {
603         getPersistence().clearOrganizations(pk);
604     }
605 
606     public static void removeOrganization(long pk, long organizationPK)
607         throws com.liferay.portal.SystemException, 
608             com.liferay.portal.NoSuchOrganizationException, 
609             com.liferay.portal.NoSuchUserException {
610         getPersistence().removeOrganization(pk, organizationPK);
611     }
612 
613     public static void removeOrganization(long pk,
614         com.liferay.portal.model.Organization organization)
615         throws com.liferay.portal.SystemException, 
616             com.liferay.portal.NoSuchOrganizationException, 
617             com.liferay.portal.NoSuchUserException {
618         getPersistence().removeOrganization(pk, organization);
619     }
620 
621     public static void removeOrganizations(long pk, long[] organizationPKs)
622         throws com.liferay.portal.SystemException, 
623             com.liferay.portal.NoSuchOrganizationException, 
624             com.liferay.portal.NoSuchUserException {
625         getPersistence().removeOrganizations(pk, organizationPKs);
626     }
627 
628     public static void removeOrganizations(long pk, java.util.List organizations)
629         throws com.liferay.portal.SystemException, 
630             com.liferay.portal.NoSuchOrganizationException, 
631             com.liferay.portal.NoSuchUserException {
632         getPersistence().removeOrganizations(pk, organizations);
633     }
634 
635     public static void setOrganizations(long pk, long[] organizationPKs)
636         throws com.liferay.portal.SystemException, 
637             com.liferay.portal.NoSuchOrganizationException, 
638             com.liferay.portal.NoSuchUserException {
639         getPersistence().setOrganizations(pk, organizationPKs);
640     }
641 
642     public static void setOrganizations(long pk, java.util.List organizations)
643         throws com.liferay.portal.SystemException, 
644             com.liferay.portal.NoSuchOrganizationException, 
645             com.liferay.portal.NoSuchUserException {
646         getPersistence().setOrganizations(pk, organizations);
647     }
648 
649     public static java.util.List getPermissions(long pk)
650         throws com.liferay.portal.SystemException, 
651             com.liferay.portal.NoSuchUserException {
652         return getPersistence().getPermissions(pk);
653     }
654 
655     public static java.util.List getPermissions(long pk, int begin, int end)
656         throws com.liferay.portal.SystemException, 
657             com.liferay.portal.NoSuchUserException {
658         return getPersistence().getPermissions(pk, begin, end);
659     }
660 
661     public static java.util.List getPermissions(long pk, int begin, int end,
662         com.liferay.portal.kernel.util.OrderByComparator obc)
663         throws com.liferay.portal.SystemException, 
664             com.liferay.portal.NoSuchUserException {
665         return getPersistence().getPermissions(pk, begin, end, obc);
666     }
667 
668     public static int getPermissionsSize(long pk)
669         throws com.liferay.portal.SystemException {
670         return getPersistence().getPermissionsSize(pk);
671     }
672 
673     public static boolean containsPermission(long pk, long permissionPK)
674         throws com.liferay.portal.SystemException {
675         return getPersistence().containsPermission(pk, permissionPK);
676     }
677 
678     public static boolean containsPermissions(long pk)
679         throws com.liferay.portal.SystemException {
680         return getPersistence().containsPermissions(pk);
681     }
682 
683     public static void addPermission(long pk, long permissionPK)
684         throws com.liferay.portal.SystemException, 
685             com.liferay.portal.NoSuchPermissionException, 
686             com.liferay.portal.NoSuchUserException {
687         getPersistence().addPermission(pk, permissionPK);
688     }
689 
690     public static void addPermission(long pk,
691         com.liferay.portal.model.Permission permission)
692         throws com.liferay.portal.SystemException, 
693             com.liferay.portal.NoSuchPermissionException, 
694             com.liferay.portal.NoSuchUserException {
695         getPersistence().addPermission(pk, permission);
696     }
697 
698     public static void addPermissions(long pk, long[] permissionPKs)
699         throws com.liferay.portal.SystemException, 
700             com.liferay.portal.NoSuchPermissionException, 
701             com.liferay.portal.NoSuchUserException {
702         getPersistence().addPermissions(pk, permissionPKs);
703     }
704 
705     public static void addPermissions(long pk, java.util.List permissions)
706         throws com.liferay.portal.SystemException, 
707             com.liferay.portal.NoSuchPermissionException, 
708             com.liferay.portal.NoSuchUserException {
709         getPersistence().addPermissions(pk, permissions);
710     }
711 
712     public static void clearPermissions(long pk)
713         throws com.liferay.portal.SystemException, 
714             com.liferay.portal.NoSuchUserException {
715         getPersistence().clearPermissions(pk);
716     }
717 
718     public static void removePermission(long pk, long permissionPK)
719         throws com.liferay.portal.SystemException, 
720             com.liferay.portal.NoSuchPermissionException, 
721             com.liferay.portal.NoSuchUserException {
722         getPersistence().removePermission(pk, permissionPK);
723     }
724 
725     public static void removePermission(long pk,
726         com.liferay.portal.model.Permission permission)
727         throws com.liferay.portal.SystemException, 
728             com.liferay.portal.NoSuchPermissionException, 
729             com.liferay.portal.NoSuchUserException {
730         getPersistence().removePermission(pk, permission);
731     }
732 
733     public static void removePermissions(long pk, long[] permissionPKs)
734         throws com.liferay.portal.SystemException, 
735             com.liferay.portal.NoSuchPermissionException, 
736             com.liferay.portal.NoSuchUserException {
737         getPersistence().removePermissions(pk, permissionPKs);
738     }
739 
740     public static void removePermissions(long pk, java.util.List permissions)
741         throws com.liferay.portal.SystemException, 
742             com.liferay.portal.NoSuchPermissionException, 
743             com.liferay.portal.NoSuchUserException {
744         getPersistence().removePermissions(pk, permissions);
745     }
746 
747     public static void setPermissions(long pk, long[] permissionPKs)
748         throws com.liferay.portal.SystemException, 
749             com.liferay.portal.NoSuchPermissionException, 
750             com.liferay.portal.NoSuchUserException {
751         getPersistence().setPermissions(pk, permissionPKs);
752     }
753 
754     public static void setPermissions(long pk, java.util.List permissions)
755         throws com.liferay.portal.SystemException, 
756             com.liferay.portal.NoSuchPermissionException, 
757             com.liferay.portal.NoSuchUserException {
758         getPersistence().setPermissions(pk, permissions);
759     }
760 
761     public static java.util.List getRoles(long pk)
762         throws com.liferay.portal.SystemException, 
763             com.liferay.portal.NoSuchUserException {
764         return getPersistence().getRoles(pk);
765     }
766 
767     public static java.util.List getRoles(long pk, int begin, int end)
768         throws com.liferay.portal.SystemException, 
769             com.liferay.portal.NoSuchUserException {
770         return getPersistence().getRoles(pk, begin, end);
771     }
772 
773     public static java.util.List getRoles(long pk, int begin, int end,
774         com.liferay.portal.kernel.util.OrderByComparator obc)
775         throws com.liferay.portal.SystemException, 
776             com.liferay.portal.NoSuchUserException {
777         return getPersistence().getRoles(pk, begin, end, obc);
778     }
779 
780     public static int getRolesSize(long pk)
781         throws com.liferay.portal.SystemException {
782         return getPersistence().getRolesSize(pk);
783     }
784 
785     public static boolean containsRole(long pk, long rolePK)
786         throws com.liferay.portal.SystemException {
787         return getPersistence().containsRole(pk, rolePK);
788     }
789 
790     public static boolean containsRoles(long pk)
791         throws com.liferay.portal.SystemException {
792         return getPersistence().containsRoles(pk);
793     }
794 
795     public static void addRole(long pk, long rolePK)
796         throws com.liferay.portal.SystemException, 
797             com.liferay.portal.NoSuchRoleException, 
798             com.liferay.portal.NoSuchUserException {
799         getPersistence().addRole(pk, rolePK);
800     }
801 
802     public static void addRole(long pk, com.liferay.portal.model.Role role)
803         throws com.liferay.portal.SystemException, 
804             com.liferay.portal.NoSuchRoleException, 
805             com.liferay.portal.NoSuchUserException {
806         getPersistence().addRole(pk, role);
807     }
808 
809     public static void addRoles(long pk, long[] rolePKs)
810         throws com.liferay.portal.SystemException, 
811             com.liferay.portal.NoSuchRoleException, 
812             com.liferay.portal.NoSuchUserException {
813         getPersistence().addRoles(pk, rolePKs);
814     }
815 
816     public static void addRoles(long pk, java.util.List roles)
817         throws com.liferay.portal.SystemException, 
818             com.liferay.portal.NoSuchRoleException, 
819             com.liferay.portal.NoSuchUserException {
820         getPersistence().addRoles(pk, roles);
821     }
822 
823     public static void clearRoles(long pk)
824         throws com.liferay.portal.SystemException, 
825             com.liferay.portal.NoSuchUserException {
826         getPersistence().clearRoles(pk);
827     }
828 
829     public static void removeRole(long pk, long rolePK)
830         throws com.liferay.portal.SystemException, 
831             com.liferay.portal.NoSuchRoleException, 
832             com.liferay.portal.NoSuchUserException {
833         getPersistence().removeRole(pk, rolePK);
834     }
835 
836     public static void removeRole(long pk, com.liferay.portal.model.Role role)
837         throws com.liferay.portal.SystemException, 
838             com.liferay.portal.NoSuchRoleException, 
839             com.liferay.portal.NoSuchUserException {
840         getPersistence().removeRole(pk, role);
841     }
842 
843     public static void removeRoles(long pk, long[] rolePKs)
844         throws com.liferay.portal.SystemException, 
845             com.liferay.portal.NoSuchRoleException, 
846             com.liferay.portal.NoSuchUserException {
847         getPersistence().removeRoles(pk, rolePKs);
848     }
849 
850     public static void removeRoles(long pk, java.util.List roles)
851         throws com.liferay.portal.SystemException, 
852             com.liferay.portal.NoSuchRoleException, 
853             com.liferay.portal.NoSuchUserException {
854         getPersistence().removeRoles(pk, roles);
855     }
856 
857     public static void setRoles(long pk, long[] rolePKs)
858         throws com.liferay.portal.SystemException, 
859             com.liferay.portal.NoSuchRoleException, 
860             com.liferay.portal.NoSuchUserException {
861         getPersistence().setRoles(pk, rolePKs);
862     }
863 
864     public static void setRoles(long pk, java.util.List roles)
865         throws com.liferay.portal.SystemException, 
866             com.liferay.portal.NoSuchRoleException, 
867             com.liferay.portal.NoSuchUserException {
868         getPersistence().setRoles(pk, roles);
869     }
870 
871     public static java.util.List getUserGroups(long pk)
872         throws com.liferay.portal.SystemException, 
873             com.liferay.portal.NoSuchUserException {
874         return getPersistence().getUserGroups(pk);
875     }
876 
877     public static java.util.List getUserGroups(long pk, int begin, int end)
878         throws com.liferay.portal.SystemException, 
879             com.liferay.portal.NoSuchUserException {
880         return getPersistence().getUserGroups(pk, begin, end);
881     }
882 
883     public static java.util.List getUserGroups(long pk, int begin, int end,
884         com.liferay.portal.kernel.util.OrderByComparator obc)
885         throws com.liferay.portal.SystemException, 
886             com.liferay.portal.NoSuchUserException {
887         return getPersistence().getUserGroups(pk, begin, end, obc);
888     }
889 
890     public static int getUserGroupsSize(long pk)
891         throws com.liferay.portal.SystemException {
892         return getPersistence().getUserGroupsSize(pk);
893     }
894 
895     public static boolean containsUserGroup(long pk, long userGroupPK)
896         throws com.liferay.portal.SystemException {
897         return getPersistence().containsUserGroup(pk, userGroupPK);
898     }
899 
900     public static boolean containsUserGroups(long pk)
901         throws com.liferay.portal.SystemException {
902         return getPersistence().containsUserGroups(pk);
903     }
904 
905     public static void addUserGroup(long pk, long userGroupPK)
906         throws com.liferay.portal.SystemException, 
907             com.liferay.portal.NoSuchUserException, 
908             com.liferay.portal.NoSuchUserGroupException {
909         getPersistence().addUserGroup(pk, userGroupPK);
910     }
911 
912     public static void addUserGroup(long pk,
913         com.liferay.portal.model.UserGroup userGroup)
914         throws com.liferay.portal.SystemException, 
915             com.liferay.portal.NoSuchUserException, 
916             com.liferay.portal.NoSuchUserGroupException {
917         getPersistence().addUserGroup(pk, userGroup);
918     }
919 
920     public static void addUserGroups(long pk, long[] userGroupPKs)
921         throws com.liferay.portal.SystemException, 
922             com.liferay.portal.NoSuchUserException, 
923             com.liferay.portal.NoSuchUserGroupException {
924         getPersistence().addUserGroups(pk, userGroupPKs);
925     }
926 
927     public static void addUserGroups(long pk, java.util.List userGroups)
928         throws com.liferay.portal.SystemException, 
929             com.liferay.portal.NoSuchUserException, 
930             com.liferay.portal.NoSuchUserGroupException {
931         getPersistence().addUserGroups(pk, userGroups);
932     }
933 
934     public static void clearUserGroups(long pk)
935         throws com.liferay.portal.SystemException, 
936             com.liferay.portal.NoSuchUserException {
937         getPersistence().clearUserGroups(pk);
938     }
939 
940     public static void removeUserGroup(long pk, long userGroupPK)
941         throws com.liferay.portal.SystemException, 
942             com.liferay.portal.NoSuchUserException, 
943             com.liferay.portal.NoSuchUserGroupException {
944         getPersistence().removeUserGroup(pk, userGroupPK);
945     }
946 
947     public static void removeUserGroup(long pk,
948         com.liferay.portal.model.UserGroup userGroup)
949         throws com.liferay.portal.SystemException, 
950             com.liferay.portal.NoSuchUserException, 
951             com.liferay.portal.NoSuchUserGroupException {
952         getPersistence().removeUserGroup(pk, userGroup);
953     }
954 
955     public static void removeUserGroups(long pk, long[] userGroupPKs)
956         throws com.liferay.portal.SystemException, 
957             com.liferay.portal.NoSuchUserException, 
958             com.liferay.portal.NoSuchUserGroupException {
959         getPersistence().removeUserGroups(pk, userGroupPKs);
960     }
961 
962     public static void removeUserGroups(long pk, java.util.List userGroups)
963         throws com.liferay.portal.SystemException, 
964             com.liferay.portal.NoSuchUserException, 
965             com.liferay.portal.NoSuchUserGroupException {
966         getPersistence().removeUserGroups(pk, userGroups);
967     }
968 
969     public static void setUserGroups(long pk, long[] userGroupPKs)
970         throws com.liferay.portal.SystemException, 
971             com.liferay.portal.NoSuchUserException, 
972             com.liferay.portal.NoSuchUserGroupException {
973         getPersistence().setUserGroups(pk, userGroupPKs);
974     }
975 
976     public static void setUserGroups(long pk, java.util.List userGroups)
977         throws com.liferay.portal.SystemException, 
978             com.liferay.portal.NoSuchUserException, 
979             com.liferay.portal.NoSuchUserGroupException {
980         getPersistence().setUserGroups(pk, userGroups);
981     }
982 
983     public static UserPersistence getPersistence() {
984         return _getUtil()._persistence;
985     }
986 
987     public void setPersistence(UserPersistence persistence) {
988         _persistence = persistence;
989     }
990 
991     private static UserUtil _getUtil() {
992         if (_util == null) {
993             _util = (UserUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
994         }
995 
996         return _util;
997     }
998 
999     private static ModelListener _getListener() {
1000        if (Validator.isNotNull(_LISTENER)) {
1001            try {
1002                return (ModelListener)Class.forName(_LISTENER).newInstance();
1003            }
1004            catch (Exception e) {
1005                _log.error(e);
1006            }
1007        }
1008
1009        return null;
1010    }
1011
1012    private static final String _UTIL = UserUtil.class.getName();
1013    private static final String _LISTENER = GetterUtil.getString(PropsUtil.get(
1014                "value.object.listener.com.liferay.portal.model.User"));
1015    private static Log _log = LogFactory.getLog(UserUtil.class);
1016    private static UserUtil _util;
1017    private UserPersistence _persistence;
1018}