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