1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  import com.liferay.portal.NoSuchUserIdMapperException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.BeanReference;
28  import com.liferay.portal.kernel.cache.CacheRegistry;
29  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
30  import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
31  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
32  import com.liferay.portal.kernel.dao.orm.FinderPath;
33  import com.liferay.portal.kernel.dao.orm.Query;
34  import com.liferay.portal.kernel.dao.orm.QueryPos;
35  import com.liferay.portal.kernel.dao.orm.QueryUtil;
36  import com.liferay.portal.kernel.dao.orm.Session;
37  import com.liferay.portal.kernel.log.Log;
38  import com.liferay.portal.kernel.log.LogFactoryUtil;
39  import com.liferay.portal.kernel.util.GetterUtil;
40  import com.liferay.portal.kernel.util.OrderByComparator;
41  import com.liferay.portal.kernel.util.StringPool;
42  import com.liferay.portal.kernel.util.StringUtil;
43  import com.liferay.portal.kernel.util.Validator;
44  import com.liferay.portal.model.ModelListener;
45  import com.liferay.portal.model.UserIdMapper;
46  import com.liferay.portal.model.impl.UserIdMapperImpl;
47  import com.liferay.portal.model.impl.UserIdMapperModelImpl;
48  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
49  
50  import java.util.ArrayList;
51  import java.util.Collections;
52  import java.util.List;
53  
54  /**
55   * <a href="UserIdMapperPersistenceImpl.java.html"><b><i>View Source</i></b></a>
56   *
57   * <p>
58   * ServiceBuilder generated this class. Modifications in this class will be
59   * overwritten the next time is generated.
60   * </p>
61   *
62   * @author    Brian Wing Shun Chan
63   * @see       UserIdMapperPersistence
64   * @see       UserIdMapperUtil
65   * @generated
66   */
67  public class UserIdMapperPersistenceImpl extends BasePersistenceImpl
68      implements UserIdMapperPersistence {
69      public static final String FINDER_CLASS_NAME_ENTITY = UserIdMapperImpl.class.getName();
70      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
71          ".List";
72      public static final FinderPath FINDER_PATH_FIND_BY_USERID = new FinderPath(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
73              UserIdMapperModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
74              "findByUserId", new String[] { Long.class.getName() });
75      public static final FinderPath FINDER_PATH_FIND_BY_OBC_USERID = new FinderPath(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
76              UserIdMapperModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
77              "findByUserId",
78              new String[] {
79                  Long.class.getName(),
80                  
81              "java.lang.Integer", "java.lang.Integer",
82                  "com.liferay.portal.kernel.util.OrderByComparator"
83              });
84      public static final FinderPath FINDER_PATH_COUNT_BY_USERID = new FinderPath(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
85              UserIdMapperModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
86              "countByUserId", new String[] { Long.class.getName() });
87      public static final FinderPath FINDER_PATH_FETCH_BY_U_T = new FinderPath(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
88              UserIdMapperModelImpl.FINDER_CACHE_ENABLED,
89              FINDER_CLASS_NAME_ENTITY, "fetchByU_T",
90              new String[] { Long.class.getName(), String.class.getName() });
91      public static final FinderPath FINDER_PATH_COUNT_BY_U_T = new FinderPath(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
92              UserIdMapperModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
93              "countByU_T",
94              new String[] { Long.class.getName(), String.class.getName() });
95      public static final FinderPath FINDER_PATH_FETCH_BY_T_E = new FinderPath(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
96              UserIdMapperModelImpl.FINDER_CACHE_ENABLED,
97              FINDER_CLASS_NAME_ENTITY, "fetchByT_E",
98              new String[] { String.class.getName(), String.class.getName() });
99      public static final FinderPath FINDER_PATH_COUNT_BY_T_E = new FinderPath(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
100             UserIdMapperModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
101             "countByT_E",
102             new String[] { String.class.getName(), String.class.getName() });
103     public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
104             UserIdMapperModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
105             "findAll", new String[0]);
106     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
107             UserIdMapperModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
108             "countAll", new String[0]);
109 
110     public void cacheResult(UserIdMapper userIdMapper) {
111         EntityCacheUtil.putResult(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
112             UserIdMapperImpl.class, userIdMapper.getPrimaryKey(), userIdMapper);
113 
114         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_U_T,
115             new Object[] {
116                 new Long(userIdMapper.getUserId()),
117                 
118             userIdMapper.getType()
119             }, userIdMapper);
120 
121         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_T_E,
122             new Object[] {
123                 userIdMapper.getType(),
124                 
125             userIdMapper.getExternalUserId()
126             }, userIdMapper);
127     }
128 
129     public void cacheResult(List<UserIdMapper> userIdMappers) {
130         for (UserIdMapper userIdMapper : userIdMappers) {
131             if (EntityCacheUtil.getResult(
132                         UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
133                         UserIdMapperImpl.class, userIdMapper.getPrimaryKey(),
134                         this) == null) {
135                 cacheResult(userIdMapper);
136             }
137         }
138     }
139 
140     public void clearCache() {
141         CacheRegistry.clear(UserIdMapperImpl.class.getName());
142         EntityCacheUtil.clearCache(UserIdMapperImpl.class.getName());
143         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
144         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
145     }
146 
147     public UserIdMapper create(long userIdMapperId) {
148         UserIdMapper userIdMapper = new UserIdMapperImpl();
149 
150         userIdMapper.setNew(true);
151         userIdMapper.setPrimaryKey(userIdMapperId);
152 
153         return userIdMapper;
154     }
155 
156     public UserIdMapper remove(long userIdMapperId)
157         throws NoSuchUserIdMapperException, SystemException {
158         Session session = null;
159 
160         try {
161             session = openSession();
162 
163             UserIdMapper userIdMapper = (UserIdMapper)session.get(UserIdMapperImpl.class,
164                     new Long(userIdMapperId));
165 
166             if (userIdMapper == null) {
167                 if (_log.isWarnEnabled()) {
168                     _log.warn("No UserIdMapper exists with the primary key " +
169                         userIdMapperId);
170                 }
171 
172                 throw new NoSuchUserIdMapperException(
173                     "No UserIdMapper exists with the primary key " +
174                     userIdMapperId);
175             }
176 
177             return remove(userIdMapper);
178         }
179         catch (NoSuchUserIdMapperException nsee) {
180             throw nsee;
181         }
182         catch (Exception e) {
183             throw processException(e);
184         }
185         finally {
186             closeSession(session);
187         }
188     }
189 
190     public UserIdMapper remove(UserIdMapper userIdMapper)
191         throws SystemException {
192         for (ModelListener<UserIdMapper> listener : listeners) {
193             listener.onBeforeRemove(userIdMapper);
194         }
195 
196         userIdMapper = removeImpl(userIdMapper);
197 
198         for (ModelListener<UserIdMapper> listener : listeners) {
199             listener.onAfterRemove(userIdMapper);
200         }
201 
202         return userIdMapper;
203     }
204 
205     protected UserIdMapper removeImpl(UserIdMapper userIdMapper)
206         throws SystemException {
207         userIdMapper = toUnwrappedModel(userIdMapper);
208 
209         Session session = null;
210 
211         try {
212             session = openSession();
213 
214             if (userIdMapper.isCachedModel() || BatchSessionUtil.isEnabled()) {
215                 Object staleObject = session.get(UserIdMapperImpl.class,
216                         userIdMapper.getPrimaryKeyObj());
217 
218                 if (staleObject != null) {
219                     session.evict(staleObject);
220                 }
221             }
222 
223             session.delete(userIdMapper);
224 
225             session.flush();
226         }
227         catch (Exception e) {
228             throw processException(e);
229         }
230         finally {
231             closeSession(session);
232         }
233 
234         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
235 
236         UserIdMapperModelImpl userIdMapperModelImpl = (UserIdMapperModelImpl)userIdMapper;
237 
238         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_U_T,
239             new Object[] {
240                 new Long(userIdMapperModelImpl.getOriginalUserId()),
241                 
242             userIdMapperModelImpl.getOriginalType()
243             });
244 
245         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_T_E,
246             new Object[] {
247                 userIdMapperModelImpl.getOriginalType(),
248                 
249             userIdMapperModelImpl.getOriginalExternalUserId()
250             });
251 
252         EntityCacheUtil.removeResult(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
253             UserIdMapperImpl.class, userIdMapper.getPrimaryKey());
254 
255         return userIdMapper;
256     }
257 
258     /**
259      * @deprecated Use {@link #update(UserIdMapper, boolean merge)}.
260      */
261     public UserIdMapper update(UserIdMapper userIdMapper)
262         throws SystemException {
263         if (_log.isWarnEnabled()) {
264             _log.warn(
265                 "Using the deprecated update(UserIdMapper userIdMapper) method. Use update(UserIdMapper userIdMapper, boolean merge) instead.");
266         }
267 
268         return update(userIdMapper, false);
269     }
270 
271     /**
272      * Add, update, or merge, the entity. This method also calls the model
273      * listeners to trigger the proper events associated with adding, deleting,
274      * or updating an entity.
275      *
276      * @param  userIdMapper the entity to add, update, or merge
277      * @param  merge boolean value for whether to merge the entity. The default
278      *         value is false. Setting merge to true is more expensive and
279      *         should only be true when userIdMapper is transient. See
280      *         LEP-5473 for a detailed discussion of this method.
281      * @return the entity that was added, updated, or merged
282      */
283     public UserIdMapper update(UserIdMapper userIdMapper, boolean merge)
284         throws SystemException {
285         boolean isNew = userIdMapper.isNew();
286 
287         for (ModelListener<UserIdMapper> listener : listeners) {
288             if (isNew) {
289                 listener.onBeforeCreate(userIdMapper);
290             }
291             else {
292                 listener.onBeforeUpdate(userIdMapper);
293             }
294         }
295 
296         userIdMapper = updateImpl(userIdMapper, merge);
297 
298         for (ModelListener<UserIdMapper> listener : listeners) {
299             if (isNew) {
300                 listener.onAfterCreate(userIdMapper);
301             }
302             else {
303                 listener.onAfterUpdate(userIdMapper);
304             }
305         }
306 
307         return userIdMapper;
308     }
309 
310     public UserIdMapper updateImpl(
311         com.liferay.portal.model.UserIdMapper userIdMapper, boolean merge)
312         throws SystemException {
313         userIdMapper = toUnwrappedModel(userIdMapper);
314 
315         boolean isNew = userIdMapper.isNew();
316 
317         UserIdMapperModelImpl userIdMapperModelImpl = (UserIdMapperModelImpl)userIdMapper;
318 
319         Session session = null;
320 
321         try {
322             session = openSession();
323 
324             BatchSessionUtil.update(session, userIdMapper, merge);
325 
326             userIdMapper.setNew(false);
327         }
328         catch (Exception e) {
329             throw processException(e);
330         }
331         finally {
332             closeSession(session);
333         }
334 
335         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
336 
337         EntityCacheUtil.putResult(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
338             UserIdMapperImpl.class, userIdMapper.getPrimaryKey(), userIdMapper);
339 
340         if (!isNew &&
341                 ((userIdMapper.getUserId() != userIdMapperModelImpl.getOriginalUserId()) ||
342                 !Validator.equals(userIdMapper.getType(),
343                     userIdMapperModelImpl.getOriginalType()))) {
344             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_U_T,
345                 new Object[] {
346                     new Long(userIdMapperModelImpl.getOriginalUserId()),
347                     
348                 userIdMapperModelImpl.getOriginalType()
349                 });
350         }
351 
352         if (isNew ||
353                 ((userIdMapper.getUserId() != userIdMapperModelImpl.getOriginalUserId()) ||
354                 !Validator.equals(userIdMapper.getType(),
355                     userIdMapperModelImpl.getOriginalType()))) {
356             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_U_T,
357                 new Object[] {
358                     new Long(userIdMapper.getUserId()),
359                     
360                 userIdMapper.getType()
361                 }, userIdMapper);
362         }
363 
364         if (!isNew &&
365                 (!Validator.equals(userIdMapper.getType(),
366                     userIdMapperModelImpl.getOriginalType()) ||
367                 !Validator.equals(userIdMapper.getExternalUserId(),
368                     userIdMapperModelImpl.getOriginalExternalUserId()))) {
369             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_T_E,
370                 new Object[] {
371                     userIdMapperModelImpl.getOriginalType(),
372                     
373                 userIdMapperModelImpl.getOriginalExternalUserId()
374                 });
375         }
376 
377         if (isNew ||
378                 (!Validator.equals(userIdMapper.getType(),
379                     userIdMapperModelImpl.getOriginalType()) ||
380                 !Validator.equals(userIdMapper.getExternalUserId(),
381                     userIdMapperModelImpl.getOriginalExternalUserId()))) {
382             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_T_E,
383                 new Object[] {
384                     userIdMapper.getType(),
385                     
386                 userIdMapper.getExternalUserId()
387                 }, userIdMapper);
388         }
389 
390         return userIdMapper;
391     }
392 
393     protected UserIdMapper toUnwrappedModel(UserIdMapper userIdMapper) {
394         if (userIdMapper instanceof UserIdMapperImpl) {
395             return userIdMapper;
396         }
397 
398         UserIdMapperImpl userIdMapperImpl = new UserIdMapperImpl();
399 
400         userIdMapperImpl.setNew(userIdMapper.isNew());
401         userIdMapperImpl.setPrimaryKey(userIdMapper.getPrimaryKey());
402 
403         userIdMapperImpl.setUserIdMapperId(userIdMapper.getUserIdMapperId());
404         userIdMapperImpl.setUserId(userIdMapper.getUserId());
405         userIdMapperImpl.setType(userIdMapper.getType());
406         userIdMapperImpl.setDescription(userIdMapper.getDescription());
407         userIdMapperImpl.setExternalUserId(userIdMapper.getExternalUserId());
408 
409         return userIdMapperImpl;
410     }
411 
412     public UserIdMapper findByPrimaryKey(long userIdMapperId)
413         throws NoSuchUserIdMapperException, SystemException {
414         UserIdMapper userIdMapper = fetchByPrimaryKey(userIdMapperId);
415 
416         if (userIdMapper == null) {
417             if (_log.isWarnEnabled()) {
418                 _log.warn("No UserIdMapper exists with the primary key " +
419                     userIdMapperId);
420             }
421 
422             throw new NoSuchUserIdMapperException(
423                 "No UserIdMapper exists with the primary key " +
424                 userIdMapperId);
425         }
426 
427         return userIdMapper;
428     }
429 
430     public UserIdMapper fetchByPrimaryKey(long userIdMapperId)
431         throws SystemException {
432         UserIdMapper userIdMapper = (UserIdMapper)EntityCacheUtil.getResult(UserIdMapperModelImpl.ENTITY_CACHE_ENABLED,
433                 UserIdMapperImpl.class, userIdMapperId, this);
434 
435         if (userIdMapper == null) {
436             Session session = null;
437 
438             try {
439                 session = openSession();
440 
441                 userIdMapper = (UserIdMapper)session.get(UserIdMapperImpl.class,
442                         new Long(userIdMapperId));
443             }
444             catch (Exception e) {
445                 throw processException(e);
446             }
447             finally {
448                 if (userIdMapper != null) {
449                     cacheResult(userIdMapper);
450                 }
451 
452                 closeSession(session);
453             }
454         }
455 
456         return userIdMapper;
457     }
458 
459     public List<UserIdMapper> findByUserId(long userId)
460         throws SystemException {
461         Object[] finderArgs = new Object[] { new Long(userId) };
462 
463         List<UserIdMapper> list = (List<UserIdMapper>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_USERID,
464                 finderArgs, this);
465 
466         if (list == null) {
467             Session session = null;
468 
469             try {
470                 session = openSession();
471 
472                 StringBuilder query = new StringBuilder();
473 
474                 query.append(
475                     "SELECT userIdMapper FROM UserIdMapper userIdMapper WHERE ");
476 
477                 query.append("userIdMapper.userId = ?");
478 
479                 query.append(" ");
480 
481                 Query q = session.createQuery(query.toString());
482 
483                 QueryPos qPos = QueryPos.getInstance(q);
484 
485                 qPos.add(userId);
486 
487                 list = q.list();
488             }
489             catch (Exception e) {
490                 throw processException(e);
491             }
492             finally {
493                 if (list == null) {
494                     list = new ArrayList<UserIdMapper>();
495                 }
496 
497                 cacheResult(list);
498 
499                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_USERID,
500                     finderArgs, list);
501 
502                 closeSession(session);
503             }
504         }
505 
506         return list;
507     }
508 
509     public List<UserIdMapper> findByUserId(long userId, int start, int end)
510         throws SystemException {
511         return findByUserId(userId, start, end, null);
512     }
513 
514     public List<UserIdMapper> findByUserId(long userId, int start, int end,
515         OrderByComparator obc) throws SystemException {
516         Object[] finderArgs = new Object[] {
517                 new Long(userId),
518                 
519                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
520             };
521 
522         List<UserIdMapper> list = (List<UserIdMapper>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_USERID,
523                 finderArgs, this);
524 
525         if (list == null) {
526             Session session = null;
527 
528             try {
529                 session = openSession();
530 
531                 StringBuilder query = new StringBuilder();
532 
533                 query.append(
534                     "SELECT userIdMapper FROM UserIdMapper userIdMapper WHERE ");
535 
536                 query.append("userIdMapper.userId = ?");
537 
538                 query.append(" ");
539 
540                 if (obc != null) {
541                     query.append("ORDER BY ");
542 
543                     String[] orderByFields = obc.getOrderByFields();
544 
545                     for (int i = 0; i < orderByFields.length; i++) {
546                         query.append("userIdMapper.");
547                         query.append(orderByFields[i]);
548 
549                         if (obc.isAscending()) {
550                             query.append(" ASC");
551                         }
552                         else {
553                             query.append(" DESC");
554                         }
555 
556                         if ((i + 1) < orderByFields.length) {
557                             query.append(", ");
558                         }
559                     }
560                 }
561 
562                 Query q = session.createQuery(query.toString());
563 
564                 QueryPos qPos = QueryPos.getInstance(q);
565 
566                 qPos.add(userId);
567 
568                 list = (List<UserIdMapper>)QueryUtil.list(q, getDialect(),
569                         start, end);
570             }
571             catch (Exception e) {
572                 throw processException(e);
573             }
574             finally {
575                 if (list == null) {
576                     list = new ArrayList<UserIdMapper>();
577                 }
578 
579                 cacheResult(list);
580 
581                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_USERID,
582                     finderArgs, list);
583 
584                 closeSession(session);
585             }
586         }
587 
588         return list;
589     }
590 
591     public UserIdMapper findByUserId_First(long userId, OrderByComparator obc)
592         throws NoSuchUserIdMapperException, SystemException {
593         List<UserIdMapper> list = findByUserId(userId, 0, 1, obc);
594 
595         if (list.isEmpty()) {
596             StringBuilder msg = new StringBuilder();
597 
598             msg.append("No UserIdMapper exists with the key {");
599 
600             msg.append("userId=" + userId);
601 
602             msg.append(StringPool.CLOSE_CURLY_BRACE);
603 
604             throw new NoSuchUserIdMapperException(msg.toString());
605         }
606         else {
607             return list.get(0);
608         }
609     }
610 
611     public UserIdMapper findByUserId_Last(long userId, OrderByComparator obc)
612         throws NoSuchUserIdMapperException, SystemException {
613         int count = countByUserId(userId);
614 
615         List<UserIdMapper> list = findByUserId(userId, count - 1, count, obc);
616 
617         if (list.isEmpty()) {
618             StringBuilder msg = new StringBuilder();
619 
620             msg.append("No UserIdMapper exists with the key {");
621 
622             msg.append("userId=" + userId);
623 
624             msg.append(StringPool.CLOSE_CURLY_BRACE);
625 
626             throw new NoSuchUserIdMapperException(msg.toString());
627         }
628         else {
629             return list.get(0);
630         }
631     }
632 
633     public UserIdMapper[] findByUserId_PrevAndNext(long userIdMapperId,
634         long userId, OrderByComparator obc)
635         throws NoSuchUserIdMapperException, SystemException {
636         UserIdMapper userIdMapper = findByPrimaryKey(userIdMapperId);
637 
638         int count = countByUserId(userId);
639 
640         Session session = null;
641 
642         try {
643             session = openSession();
644 
645             StringBuilder query = new StringBuilder();
646 
647             query.append(
648                 "SELECT userIdMapper FROM UserIdMapper userIdMapper WHERE ");
649 
650             query.append("userIdMapper.userId = ?");
651 
652             query.append(" ");
653 
654             if (obc != null) {
655                 query.append("ORDER BY ");
656 
657                 String[] orderByFields = obc.getOrderByFields();
658 
659                 for (int i = 0; i < orderByFields.length; i++) {
660                     query.append("userIdMapper.");
661                     query.append(orderByFields[i]);
662 
663                     if (obc.isAscending()) {
664                         query.append(" ASC");
665                     }
666                     else {
667                         query.append(" DESC");
668                     }
669 
670                     if ((i + 1) < orderByFields.length) {
671                         query.append(", ");
672                     }
673                 }
674             }
675 
676             Query q = session.createQuery(query.toString());
677 
678             QueryPos qPos = QueryPos.getInstance(q);
679 
680             qPos.add(userId);
681 
682             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
683                     userIdMapper);
684 
685             UserIdMapper[] array = new UserIdMapperImpl[3];
686 
687             array[0] = (UserIdMapper)objArray[0];
688             array[1] = (UserIdMapper)objArray[1];
689             array[2] = (UserIdMapper)objArray[2];
690 
691             return array;
692         }
693         catch (Exception e) {
694             throw processException(e);
695         }
696         finally {
697             closeSession(session);
698         }
699     }
700 
701     public UserIdMapper findByU_T(long userId, String type)
702         throws NoSuchUserIdMapperException, SystemException {
703         UserIdMapper userIdMapper = fetchByU_T(userId, type);
704 
705         if (userIdMapper == null) {
706             StringBuilder msg = new StringBuilder();
707 
708             msg.append("No UserIdMapper exists with the key {");
709 
710             msg.append("userId=" + userId);
711 
712             msg.append(", ");
713             msg.append("type=" + type);
714 
715             msg.append(StringPool.CLOSE_CURLY_BRACE);
716 
717             if (_log.isWarnEnabled()) {
718                 _log.warn(msg.toString());
719             }
720 
721             throw new NoSuchUserIdMapperException(msg.toString());
722         }
723 
724         return userIdMapper;
725     }
726 
727     public UserIdMapper fetchByU_T(long userId, String type)
728         throws SystemException {
729         return fetchByU_T(userId, type, true);
730     }
731 
732     public UserIdMapper fetchByU_T(long userId, String type,
733         boolean retrieveFromCache) throws SystemException {
734         Object[] finderArgs = new Object[] { new Long(userId), type };
735 
736         Object result = null;
737 
738         if (retrieveFromCache) {
739             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_U_T,
740                     finderArgs, this);
741         }
742 
743         if (result == null) {
744             Session session = null;
745 
746             try {
747                 session = openSession();
748 
749                 StringBuilder query = new StringBuilder();
750 
751                 query.append(
752                     "SELECT userIdMapper FROM UserIdMapper userIdMapper WHERE ");
753 
754                 query.append("userIdMapper.userId = ?");
755 
756                 query.append(" AND ");
757 
758                 if (type == null) {
759                     query.append("userIdMapper.type IS NULL");
760                 }
761                 else {
762                     query.append("userIdMapper.type = ?");
763                 }
764 
765                 query.append(" ");
766 
767                 Query q = session.createQuery(query.toString());
768 
769                 QueryPos qPos = QueryPos.getInstance(q);
770 
771                 qPos.add(userId);
772 
773                 if (type != null) {
774                     qPos.add(type);
775                 }
776 
777                 List<UserIdMapper> list = q.list();
778 
779                 result = list;
780 
781                 UserIdMapper userIdMapper = null;
782 
783                 if (list.isEmpty()) {
784                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_U_T,
785                         finderArgs, list);
786                 }
787                 else {
788                     userIdMapper = list.get(0);
789 
790                     cacheResult(userIdMapper);
791 
792                     if ((userIdMapper.getUserId() != userId) ||
793                             (userIdMapper.getType() == null) ||
794                             !userIdMapper.getType().equals(type)) {
795                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_U_T,
796                             finderArgs, userIdMapper);
797                     }
798                 }
799 
800                 return userIdMapper;
801             }
802             catch (Exception e) {
803                 throw processException(e);
804             }
805             finally {
806                 if (result == null) {
807                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_U_T,
808                         finderArgs, new ArrayList<UserIdMapper>());
809                 }
810 
811                 closeSession(session);
812             }
813         }
814         else {
815             if (result instanceof List<?>) {
816                 return null;
817             }
818             else {
819                 return (UserIdMapper)result;
820             }
821         }
822     }
823 
824     public UserIdMapper findByT_E(String type, String externalUserId)
825         throws NoSuchUserIdMapperException, SystemException {
826         UserIdMapper userIdMapper = fetchByT_E(type, externalUserId);
827 
828         if (userIdMapper == null) {
829             StringBuilder msg = new StringBuilder();
830 
831             msg.append("No UserIdMapper exists with the key {");
832 
833             msg.append("type=" + type);
834 
835             msg.append(", ");
836             msg.append("externalUserId=" + externalUserId);
837 
838             msg.append(StringPool.CLOSE_CURLY_BRACE);
839 
840             if (_log.isWarnEnabled()) {
841                 _log.warn(msg.toString());
842             }
843 
844             throw new NoSuchUserIdMapperException(msg.toString());
845         }
846 
847         return userIdMapper;
848     }
849 
850     public UserIdMapper fetchByT_E(String type, String externalUserId)
851         throws SystemException {
852         return fetchByT_E(type, externalUserId, true);
853     }
854 
855     public UserIdMapper fetchByT_E(String type, String externalUserId,
856         boolean retrieveFromCache) throws SystemException {
857         Object[] finderArgs = new Object[] { type, externalUserId };
858 
859         Object result = null;
860 
861         if (retrieveFromCache) {
862             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_T_E,
863                     finderArgs, this);
864         }
865 
866         if (result == null) {
867             Session session = null;
868 
869             try {
870                 session = openSession();
871 
872                 StringBuilder query = new StringBuilder();
873 
874                 query.append(
875                     "SELECT userIdMapper FROM UserIdMapper userIdMapper WHERE ");
876 
877                 if (type == null) {
878                     query.append("userIdMapper.type IS NULL");
879                 }
880                 else {
881                     query.append("userIdMapper.type = ?");
882                 }
883 
884                 query.append(" AND ");
885 
886                 if (externalUserId == null) {
887                     query.append("userIdMapper.externalUserId IS NULL");
888                 }
889                 else {
890                     query.append("userIdMapper.externalUserId = ?");
891                 }
892 
893                 query.append(" ");
894 
895                 Query q = session.createQuery(query.toString());
896 
897                 QueryPos qPos = QueryPos.getInstance(q);
898 
899                 if (type != null) {
900                     qPos.add(type);
901                 }
902 
903                 if (externalUserId != null) {
904                     qPos.add(externalUserId);
905                 }
906 
907                 List<UserIdMapper> list = q.list();
908 
909                 result = list;
910 
911                 UserIdMapper userIdMapper = null;
912 
913                 if (list.isEmpty()) {
914                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_T_E,
915                         finderArgs, list);
916                 }
917                 else {
918                     userIdMapper = list.get(0);
919 
920                     cacheResult(userIdMapper);
921 
922                     if ((userIdMapper.getType() == null) ||
923                             !userIdMapper.getType().equals(type) ||
924                             (userIdMapper.getExternalUserId() == null) ||
925                             !userIdMapper.getExternalUserId()
926                                              .equals(externalUserId)) {
927                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_T_E,
928                             finderArgs, userIdMapper);
929                     }
930                 }
931 
932                 return userIdMapper;
933             }
934             catch (Exception e) {
935                 throw processException(e);
936             }
937             finally {
938                 if (result == null) {
939                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_T_E,
940                         finderArgs, new ArrayList<UserIdMapper>());
941                 }
942 
943                 closeSession(session);
944             }
945         }
946         else {
947             if (result instanceof List<?>) {
948                 return null;
949             }
950             else {
951                 return (UserIdMapper)result;
952             }
953         }
954     }
955 
956     public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
957         throws SystemException {
958         Session session = null;
959 
960         try {
961             session = openSession();
962 
963             dynamicQuery.compile(session);
964 
965             return dynamicQuery.list();
966         }
967         catch (Exception e) {
968             throw processException(e);
969         }
970         finally {
971             closeSession(session);
972         }
973     }
974 
975     public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
976         int start, int end) throws SystemException {
977         Session session = null;
978 
979         try {
980             session = openSession();
981 
982             dynamicQuery.setLimit(start, end);
983 
984             dynamicQuery.compile(session);
985 
986             return dynamicQuery.list();
987         }
988         catch (Exception e) {
989             throw processException(e);
990         }
991         finally {
992             closeSession(session);
993         }
994     }
995 
996     public List<UserIdMapper> findAll() throws SystemException {
997         return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
998     }
999 
1000    public List<UserIdMapper> findAll(int start, int end)
1001        throws SystemException {
1002        return findAll(start, end, null);
1003    }
1004
1005    public List<UserIdMapper> findAll(int start, int end, OrderByComparator obc)
1006        throws SystemException {
1007        Object[] finderArgs = new Object[] {
1008                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1009            };
1010
1011        List<UserIdMapper> list = (List<UserIdMapper>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1012                finderArgs, this);
1013
1014        if (list == null) {
1015            Session session = null;
1016
1017            try {
1018                session = openSession();
1019
1020                StringBuilder query = new StringBuilder();
1021
1022                query.append(
1023                    "SELECT userIdMapper FROM UserIdMapper userIdMapper ");
1024
1025                if (obc != null) {
1026                    query.append("ORDER BY ");
1027
1028                    String[] orderByFields = obc.getOrderByFields();
1029
1030                    for (int i = 0; i < orderByFields.length; i++) {
1031                        query.append("userIdMapper.");
1032                        query.append(orderByFields[i]);
1033
1034                        if (obc.isAscending()) {
1035                            query.append(" ASC");
1036                        }
1037                        else {
1038                            query.append(" DESC");
1039                        }
1040
1041                        if ((i + 1) < orderByFields.length) {
1042                            query.append(", ");
1043                        }
1044                    }
1045                }
1046
1047                Query q = session.createQuery(query.toString());
1048
1049                if (obc == null) {
1050                    list = (List<UserIdMapper>)QueryUtil.list(q, getDialect(),
1051                            start, end, false);
1052
1053                    Collections.sort(list);
1054                }
1055                else {
1056                    list = (List<UserIdMapper>)QueryUtil.list(q, getDialect(),
1057                            start, end);
1058                }
1059            }
1060            catch (Exception e) {
1061                throw processException(e);
1062            }
1063            finally {
1064                if (list == null) {
1065                    list = new ArrayList<UserIdMapper>();
1066                }
1067
1068                cacheResult(list);
1069
1070                FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1071
1072                closeSession(session);
1073            }
1074        }
1075
1076        return list;
1077    }
1078
1079    public void removeByUserId(long userId) throws SystemException {
1080        for (UserIdMapper userIdMapper : findByUserId(userId)) {
1081            remove(userIdMapper);
1082        }
1083    }
1084
1085    public void removeByU_T(long userId, String type)
1086        throws NoSuchUserIdMapperException, SystemException {
1087        UserIdMapper userIdMapper = findByU_T(userId, type);
1088
1089        remove(userIdMapper);
1090    }
1091
1092    public void removeByT_E(String type, String externalUserId)
1093        throws NoSuchUserIdMapperException, SystemException {
1094        UserIdMapper userIdMapper = findByT_E(type, externalUserId);
1095
1096        remove(userIdMapper);
1097    }
1098
1099    public void removeAll() throws SystemException {
1100        for (UserIdMapper userIdMapper : findAll()) {
1101            remove(userIdMapper);
1102        }
1103    }
1104
1105    public int countByUserId(long userId) throws SystemException {
1106        Object[] finderArgs = new Object[] { new Long(userId) };
1107
1108        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_USERID,
1109                finderArgs, this);
1110
1111        if (count == null) {
1112            Session session = null;
1113
1114            try {
1115                session = openSession();
1116
1117                StringBuilder query = new StringBuilder();
1118
1119                query.append("SELECT COUNT(userIdMapper) ");
1120                query.append("FROM UserIdMapper userIdMapper WHERE ");
1121
1122                query.append("userIdMapper.userId = ?");
1123
1124                query.append(" ");
1125
1126                Query q = session.createQuery(query.toString());
1127
1128                QueryPos qPos = QueryPos.getInstance(q);
1129
1130                qPos.add(userId);
1131
1132                count = (Long)q.uniqueResult();
1133            }
1134            catch (Exception e) {
1135                throw processException(e);
1136            }
1137            finally {
1138                if (count == null) {
1139                    count = Long.valueOf(0);
1140                }
1141
1142                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERID,
1143                    finderArgs, count);
1144
1145                closeSession(session);
1146            }
1147        }
1148
1149        return count.intValue();
1150    }
1151
1152    public int countByU_T(long userId, String type) throws SystemException {
1153        Object[] finderArgs = new Object[] { new Long(userId), type };
1154
1155        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_U_T,
1156                finderArgs, this);
1157
1158        if (count == null) {
1159            Session session = null;
1160
1161            try {
1162                session = openSession();
1163
1164                StringBuilder query = new StringBuilder();
1165
1166                query.append("SELECT COUNT(userIdMapper) ");
1167                query.append("FROM UserIdMapper userIdMapper WHERE ");
1168
1169                query.append("userIdMapper.userId = ?");
1170
1171                query.append(" AND ");
1172
1173                if (type == null) {
1174                    query.append("userIdMapper.type IS NULL");
1175                }
1176                else {
1177                    query.append("userIdMapper.type = ?");
1178                }
1179
1180                query.append(" ");
1181
1182                Query q = session.createQuery(query.toString());
1183
1184                QueryPos qPos = QueryPos.getInstance(q);
1185
1186                qPos.add(userId);
1187
1188                if (type != null) {
1189                    qPos.add(type);
1190                }
1191
1192                count = (Long)q.uniqueResult();
1193            }
1194            catch (Exception e) {
1195                throw processException(e);
1196            }
1197            finally {
1198                if (count == null) {
1199                    count = Long.valueOf(0);
1200                }
1201
1202                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_U_T, finderArgs,
1203                    count);
1204
1205                closeSession(session);
1206            }
1207        }
1208
1209        return count.intValue();
1210    }
1211
1212    public int countByT_E(String type, String externalUserId)
1213        throws SystemException {
1214        Object[] finderArgs = new Object[] { type, externalUserId };
1215
1216        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_T_E,
1217                finderArgs, this);
1218
1219        if (count == null) {
1220            Session session = null;
1221
1222            try {
1223                session = openSession();
1224
1225                StringBuilder query = new StringBuilder();
1226
1227                query.append("SELECT COUNT(userIdMapper) ");
1228                query.append("FROM UserIdMapper userIdMapper WHERE ");
1229
1230                if (type == null) {
1231                    query.append("userIdMapper.type IS NULL");
1232                }
1233                else {
1234                    query.append("userIdMapper.type = ?");
1235                }
1236
1237                query.append(" AND ");
1238
1239                if (externalUserId == null) {
1240                    query.append("userIdMapper.externalUserId IS NULL");
1241                }
1242                else {
1243                    query.append("userIdMapper.externalUserId = ?");
1244                }
1245
1246                query.append(" ");
1247
1248                Query q = session.createQuery(query.toString());
1249
1250                QueryPos qPos = QueryPos.getInstance(q);
1251
1252                if (type != null) {
1253                    qPos.add(type);
1254                }
1255
1256                if (externalUserId != null) {
1257                    qPos.add(externalUserId);
1258                }
1259
1260                count = (Long)q.uniqueResult();
1261            }
1262            catch (Exception e) {
1263                throw processException(e);
1264            }
1265            finally {
1266                if (count == null) {
1267                    count = Long.valueOf(0);
1268                }
1269
1270                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_T_E, finderArgs,
1271                    count);
1272
1273                closeSession(session);
1274            }
1275        }
1276
1277        return count.intValue();
1278    }
1279
1280    public int countAll() throws SystemException {
1281        Object[] finderArgs = new Object[0];
1282
1283        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1284                finderArgs, this);
1285
1286        if (count == null) {
1287            Session session = null;
1288
1289            try {
1290                session = openSession();
1291
1292                Query q = session.createQuery(
1293                        "SELECT COUNT(userIdMapper) FROM UserIdMapper userIdMapper");
1294
1295                count = (Long)q.uniqueResult();
1296            }
1297            catch (Exception e) {
1298                throw processException(e);
1299            }
1300            finally {
1301                if (count == null) {
1302                    count = Long.valueOf(0);
1303                }
1304
1305                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1306                    count);
1307
1308                closeSession(session);
1309            }
1310        }
1311
1312        return count.intValue();
1313    }
1314
1315    public void afterPropertiesSet() {
1316        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1317                    com.liferay.portal.util.PropsUtil.get(
1318                        "value.object.listener.com.liferay.portal.model.UserIdMapper")));
1319
1320        if (listenerClassNames.length > 0) {
1321            try {
1322                List<ModelListener<UserIdMapper>> listenersList = new ArrayList<ModelListener<UserIdMapper>>();
1323
1324                for (String listenerClassName : listenerClassNames) {
1325                    listenersList.add((ModelListener<UserIdMapper>)Class.forName(
1326                            listenerClassName).newInstance());
1327                }
1328
1329                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1330            }
1331            catch (Exception e) {
1332                _log.error(e);
1333            }
1334        }
1335    }
1336
1337    @BeanReference(name = "com.liferay.portal.service.persistence.AccountPersistence.impl")
1338    protected com.liferay.portal.service.persistence.AccountPersistence accountPersistence;
1339    @BeanReference(name = "com.liferay.portal.service.persistence.AddressPersistence.impl")
1340    protected com.liferay.portal.service.persistence.AddressPersistence addressPersistence;
1341    @BeanReference(name = "com.liferay.portal.service.persistence.BrowserTrackerPersistence.impl")
1342    protected com.liferay.portal.service.persistence.BrowserTrackerPersistence browserTrackerPersistence;
1343    @BeanReference(name = "com.liferay.portal.service.persistence.ClassNamePersistence.impl")
1344    protected com.liferay.portal.service.persistence.ClassNamePersistence classNamePersistence;
1345    @BeanReference(name = "com.liferay.portal.service.persistence.CompanyPersistence.impl")
1346    protected com.liferay.portal.service.persistence.CompanyPersistence companyPersistence;
1347    @BeanReference(name = "com.liferay.portal.service.persistence.ContactPersistence.impl")
1348    protected com.liferay.portal.service.persistence.ContactPersistence contactPersistence;
1349    @BeanReference(name = "com.liferay.portal.service.persistence.CountryPersistence.impl")
1350    protected com.liferay.portal.service.persistence.CountryPersistence countryPersistence;
1351    @BeanReference(name = "com.liferay.portal.service.persistence.EmailAddressPersistence.impl")
1352    protected com.liferay.portal.service.persistence.EmailAddressPersistence emailAddressPersistence;
1353    @BeanReference(name = "com.liferay.portal.service.persistence.GroupPersistence.impl")
1354    protected com.liferay.portal.service.persistence.GroupPersistence groupPersistence;
1355    @BeanReference(name = "com.liferay.portal.service.persistence.ImagePersistence.impl")
1356    protected com.liferay.portal.service.persistence.ImagePersistence imagePersistence;
1357    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutPersistence.impl")
1358    protected com.liferay.portal.service.persistence.LayoutPersistence layoutPersistence;
1359    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutSetPersistence.impl")
1360    protected com.liferay.portal.service.persistence.LayoutSetPersistence layoutSetPersistence;
1361    @BeanReference(name = "com.liferay.portal.service.persistence.ListTypePersistence.impl")
1362    protected com.liferay.portal.service.persistence.ListTypePersistence listTypePersistence;
1363    @BeanReference(name = "com.liferay.portal.service.persistence.LockPersistence.impl")
1364    protected com.liferay.portal.service.persistence.LockPersistence lockPersistence;
1365    @BeanReference(name = "com.liferay.portal.service.persistence.MembershipRequestPersistence.impl")
1366    protected com.liferay.portal.service.persistence.MembershipRequestPersistence membershipRequestPersistence;
1367    @BeanReference(name = "com.liferay.portal.service.persistence.OrganizationPersistence.impl")
1368    protected com.liferay.portal.service.persistence.OrganizationPersistence organizationPersistence;
1369    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupPermissionPersistence.impl")
1370    protected com.liferay.portal.service.persistence.OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1371    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupRolePersistence.impl")
1372    protected com.liferay.portal.service.persistence.OrgGroupRolePersistence orgGroupRolePersistence;
1373    @BeanReference(name = "com.liferay.portal.service.persistence.OrgLaborPersistence.impl")
1374    protected com.liferay.portal.service.persistence.OrgLaborPersistence orgLaborPersistence;
1375    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyPersistence.impl")
1376    protected com.liferay.portal.service.persistence.PasswordPolicyPersistence passwordPolicyPersistence;
1377    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyRelPersistence.impl")
1378    protected com.liferay.portal.service.persistence.PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1379    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordTrackerPersistence.impl")
1380    protected com.liferay.portal.service.persistence.PasswordTrackerPersistence passwordTrackerPersistence;
1381    @BeanReference(name = "com.liferay.portal.service.persistence.PermissionPersistence.impl")
1382    protected com.liferay.portal.service.persistence.PermissionPersistence permissionPersistence;
1383    @BeanReference(name = "com.liferay.portal.service.persistence.PhonePersistence.impl")
1384    protected com.liferay.portal.service.persistence.PhonePersistence phonePersistence;
1385    @BeanReference(name = "com.liferay.portal.service.persistence.PluginSettingPersistence.impl")
1386    protected com.liferay.portal.service.persistence.PluginSettingPersistence pluginSettingPersistence;
1387    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPersistence.impl")
1388    protected com.liferay.portal.service.persistence.PortletPersistence portletPersistence;
1389    @BeanReference(name = "com.liferay.portal.service.persistence.PortletItemPersistence.impl")
1390    protected com.liferay.portal.service.persistence.PortletItemPersistence portletItemPersistence;
1391    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesPersistence.impl")
1392    protected com.liferay.portal.service.persistence.PortletPreferencesPersistence portletPreferencesPersistence;
1393    @BeanReference(name = "com.liferay.portal.service.persistence.RegionPersistence.impl")
1394    protected com.liferay.portal.service.persistence.RegionPersistence regionPersistence;
1395    @BeanReference(name = "com.liferay.portal.service.persistence.ReleasePersistence.impl")
1396    protected com.liferay.portal.service.persistence.ReleasePersistence releasePersistence;
1397    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
1398    protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
1399    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceActionPersistence.impl")
1400    protected com.liferay.portal.service.persistence.ResourceActionPersistence resourceActionPersistence;
1401    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceCodePersistence.impl")
1402    protected com.liferay.portal.service.persistence.ResourceCodePersistence resourceCodePersistence;
1403    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePermissionPersistence.impl")
1404    protected com.liferay.portal.service.persistence.ResourcePermissionPersistence resourcePermissionPersistence;
1405    @BeanReference(name = "com.liferay.portal.service.persistence.RolePersistence.impl")
1406    protected com.liferay.portal.service.persistence.RolePersistence rolePersistence;
1407    @BeanReference(name = "com.liferay.portal.service.persistence.ServiceComponentPersistence.impl")
1408    protected com.liferay.portal.service.persistence.ServiceComponentPersistence serviceComponentPersistence;
1409    @BeanReference(name = "com.liferay.portal.service.persistence.ShardPersistence.impl")
1410    protected com.liferay.portal.service.persistence.ShardPersistence shardPersistence;
1411    @BeanReference(name = "com.liferay.portal.service.persistence.SubscriptionPersistence.impl")
1412    protected com.liferay.portal.service.persistence.SubscriptionPersistence subscriptionPersistence;
1413    @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
1414    protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
1415    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupPersistence.impl")
1416    protected com.liferay.portal.service.persistence.UserGroupPersistence userGroupPersistence;
1417    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupGroupRolePersistence.impl")
1418    protected com.liferay.portal.service.persistence.UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1419    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupRolePersistence.impl")
1420    protected com.liferay.portal.service.persistence.UserGroupRolePersistence userGroupRolePersistence;
1421    @BeanReference(name = "com.liferay.portal.service.persistence.UserIdMapperPersistence.impl")
1422    protected com.liferay.portal.service.persistence.UserIdMapperPersistence userIdMapperPersistence;
1423    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPersistence.impl")
1424    protected com.liferay.portal.service.persistence.UserTrackerPersistence userTrackerPersistence;
1425    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPathPersistence.impl")
1426    protected com.liferay.portal.service.persistence.UserTrackerPathPersistence userTrackerPathPersistence;
1427    @BeanReference(name = "com.liferay.portal.service.persistence.WebDAVPropsPersistence.impl")
1428    protected com.liferay.portal.service.persistence.WebDAVPropsPersistence webDAVPropsPersistence;
1429    @BeanReference(name = "com.liferay.portal.service.persistence.WebsitePersistence.impl")
1430    protected com.liferay.portal.service.persistence.WebsitePersistence websitePersistence;
1431    private static Log _log = LogFactoryUtil.getLog(UserIdMapperPersistenceImpl.class);
1432}