1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.NoSuchImageException;
18  import com.liferay.portal.NoSuchModelException;
19  import com.liferay.portal.kernel.annotation.BeanReference;
20  import com.liferay.portal.kernel.cache.CacheRegistry;
21  import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
22  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
23  import com.liferay.portal.kernel.dao.orm.FinderPath;
24  import com.liferay.portal.kernel.dao.orm.Query;
25  import com.liferay.portal.kernel.dao.orm.QueryPos;
26  import com.liferay.portal.kernel.dao.orm.QueryUtil;
27  import com.liferay.portal.kernel.dao.orm.Session;
28  import com.liferay.portal.kernel.exception.SystemException;
29  import com.liferay.portal.kernel.log.Log;
30  import com.liferay.portal.kernel.log.LogFactoryUtil;
31  import com.liferay.portal.kernel.util.GetterUtil;
32  import com.liferay.portal.kernel.util.OrderByComparator;
33  import com.liferay.portal.kernel.util.StringBundler;
34  import com.liferay.portal.kernel.util.StringPool;
35  import com.liferay.portal.kernel.util.StringUtil;
36  import com.liferay.portal.model.Image;
37  import com.liferay.portal.model.ModelListener;
38  import com.liferay.portal.model.impl.ImageImpl;
39  import com.liferay.portal.model.impl.ImageModelImpl;
40  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
41  
42  import java.io.Serializable;
43  
44  import java.util.ArrayList;
45  import java.util.Collections;
46  import java.util.List;
47  
48  /**
49   * <a href="ImagePersistenceImpl.java.html"><b><i>View Source</i></b></a>
50   *
51   * <p>
52   * ServiceBuilder generated this class. Modifications in this class will be
53   * overwritten the next time is generated.
54   * </p>
55   *
56   * @author    Brian Wing Shun Chan
57   * @see       ImagePersistence
58   * @see       ImageUtil
59   * @generated
60   */
61  public class ImagePersistenceImpl extends BasePersistenceImpl<Image>
62      implements ImagePersistence {
63      public static final String FINDER_CLASS_NAME_ENTITY = ImageImpl.class.getName();
64      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
65          ".List";
66      public static final FinderPath FINDER_PATH_FIND_BY_SIZE = new FinderPath(ImageModelImpl.ENTITY_CACHE_ENABLED,
67              ImageModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
68              "findBySize", new String[] { Integer.class.getName() });
69      public static final FinderPath FINDER_PATH_FIND_BY_OBC_SIZE = new FinderPath(ImageModelImpl.ENTITY_CACHE_ENABLED,
70              ImageModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
71              "findBySize",
72              new String[] {
73                  Integer.class.getName(),
74                  
75              "java.lang.Integer", "java.lang.Integer",
76                  "com.liferay.portal.kernel.util.OrderByComparator"
77              });
78      public static final FinderPath FINDER_PATH_COUNT_BY_SIZE = new FinderPath(ImageModelImpl.ENTITY_CACHE_ENABLED,
79              ImageModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
80              "countBySize", new String[] { Integer.class.getName() });
81      public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(ImageModelImpl.ENTITY_CACHE_ENABLED,
82              ImageModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
83              "findAll", new String[0]);
84      public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ImageModelImpl.ENTITY_CACHE_ENABLED,
85              ImageModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
86              "countAll", new String[0]);
87  
88      public void cacheResult(Image image) {
89          EntityCacheUtil.putResult(ImageModelImpl.ENTITY_CACHE_ENABLED,
90              ImageImpl.class, image.getPrimaryKey(), image);
91      }
92  
93      public void cacheResult(List<Image> images) {
94          for (Image image : images) {
95              if (EntityCacheUtil.getResult(ImageModelImpl.ENTITY_CACHE_ENABLED,
96                          ImageImpl.class, image.getPrimaryKey(), this) == null) {
97                  cacheResult(image);
98              }
99          }
100     }
101 
102     public void clearCache() {
103         CacheRegistry.clear(ImageImpl.class.getName());
104         EntityCacheUtil.clearCache(ImageImpl.class.getName());
105         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
106         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
107     }
108 
109     public Image create(long imageId) {
110         Image image = new ImageImpl();
111 
112         image.setNew(true);
113         image.setPrimaryKey(imageId);
114 
115         return image;
116     }
117 
118     public Image remove(Serializable primaryKey)
119         throws NoSuchModelException, SystemException {
120         return remove(((Long)primaryKey).longValue());
121     }
122 
123     public Image remove(long imageId)
124         throws NoSuchImageException, SystemException {
125         Session session = null;
126 
127         try {
128             session = openSession();
129 
130             Image image = (Image)session.get(ImageImpl.class, new Long(imageId));
131 
132             if (image == null) {
133                 if (_log.isWarnEnabled()) {
134                     _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + imageId);
135                 }
136 
137                 throw new NoSuchImageException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
138                     imageId);
139             }
140 
141             return remove(image);
142         }
143         catch (NoSuchImageException nsee) {
144             throw nsee;
145         }
146         catch (Exception e) {
147             throw processException(e);
148         }
149         finally {
150             closeSession(session);
151         }
152     }
153 
154     public Image remove(Image image) throws SystemException {
155         for (ModelListener<Image> listener : listeners) {
156             listener.onBeforeRemove(image);
157         }
158 
159         image = removeImpl(image);
160 
161         for (ModelListener<Image> listener : listeners) {
162             listener.onAfterRemove(image);
163         }
164 
165         return image;
166     }
167 
168     protected Image removeImpl(Image image) throws SystemException {
169         image = toUnwrappedModel(image);
170 
171         Session session = null;
172 
173         try {
174             session = openSession();
175 
176             if (image.isCachedModel() || BatchSessionUtil.isEnabled()) {
177                 Object staleObject = session.get(ImageImpl.class,
178                         image.getPrimaryKeyObj());
179 
180                 if (staleObject != null) {
181                     session.evict(staleObject);
182                 }
183             }
184 
185             session.delete(image);
186 
187             session.flush();
188         }
189         catch (Exception e) {
190             throw processException(e);
191         }
192         finally {
193             closeSession(session);
194         }
195 
196         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
197 
198         EntityCacheUtil.removeResult(ImageModelImpl.ENTITY_CACHE_ENABLED,
199             ImageImpl.class, image.getPrimaryKey());
200 
201         return image;
202     }
203 
204     public Image updateImpl(com.liferay.portal.model.Image image, boolean merge)
205         throws SystemException {
206         image = toUnwrappedModel(image);
207 
208         Session session = null;
209 
210         try {
211             session = openSession();
212 
213             BatchSessionUtil.update(session, image, merge);
214 
215             image.setNew(false);
216         }
217         catch (Exception e) {
218             throw processException(e);
219         }
220         finally {
221             closeSession(session);
222         }
223 
224         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
225 
226         EntityCacheUtil.putResult(ImageModelImpl.ENTITY_CACHE_ENABLED,
227             ImageImpl.class, image.getPrimaryKey(), image);
228 
229         return image;
230     }
231 
232     protected Image toUnwrappedModel(Image image) {
233         if (image instanceof ImageImpl) {
234             return image;
235         }
236 
237         ImageImpl imageImpl = new ImageImpl();
238 
239         imageImpl.setNew(image.isNew());
240         imageImpl.setPrimaryKey(image.getPrimaryKey());
241 
242         imageImpl.setImageId(image.getImageId());
243         imageImpl.setModifiedDate(image.getModifiedDate());
244         imageImpl.setText(image.getText());
245         imageImpl.setType(image.getType());
246         imageImpl.setHeight(image.getHeight());
247         imageImpl.setWidth(image.getWidth());
248         imageImpl.setSize(image.getSize());
249 
250         return imageImpl;
251     }
252 
253     public Image findByPrimaryKey(Serializable primaryKey)
254         throws NoSuchModelException, SystemException {
255         return findByPrimaryKey(((Long)primaryKey).longValue());
256     }
257 
258     public Image findByPrimaryKey(long imageId)
259         throws NoSuchImageException, SystemException {
260         Image image = fetchByPrimaryKey(imageId);
261 
262         if (image == null) {
263             if (_log.isWarnEnabled()) {
264                 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + imageId);
265             }
266 
267             throw new NoSuchImageException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
268                 imageId);
269         }
270 
271         return image;
272     }
273 
274     public Image fetchByPrimaryKey(Serializable primaryKey)
275         throws SystemException {
276         return fetchByPrimaryKey(((Long)primaryKey).longValue());
277     }
278 
279     public Image fetchByPrimaryKey(long imageId) throws SystemException {
280         Image image = (Image)EntityCacheUtil.getResult(ImageModelImpl.ENTITY_CACHE_ENABLED,
281                 ImageImpl.class, imageId, this);
282 
283         if (image == null) {
284             Session session = null;
285 
286             try {
287                 session = openSession();
288 
289                 image = (Image)session.get(ImageImpl.class, new Long(imageId));
290             }
291             catch (Exception e) {
292                 throw processException(e);
293             }
294             finally {
295                 if (image != null) {
296                     cacheResult(image);
297                 }
298 
299                 closeSession(session);
300             }
301         }
302 
303         return image;
304     }
305 
306     public List<Image> findBySize(int size) throws SystemException {
307         Object[] finderArgs = new Object[] { new Integer(size) };
308 
309         List<Image> list = (List<Image>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_SIZE,
310                 finderArgs, this);
311 
312         if (list == null) {
313             Session session = null;
314 
315             try {
316                 session = openSession();
317 
318                 StringBundler query = new StringBundler(3);
319 
320                 query.append(_SQL_SELECT_IMAGE_WHERE);
321 
322                 query.append(_FINDER_COLUMN_SIZE_SIZE_2);
323 
324                 query.append(ImageModelImpl.ORDER_BY_JPQL);
325 
326                 String sql = query.toString();
327 
328                 Query q = session.createQuery(sql);
329 
330                 QueryPos qPos = QueryPos.getInstance(q);
331 
332                 qPos.add(size);
333 
334                 list = q.list();
335             }
336             catch (Exception e) {
337                 throw processException(e);
338             }
339             finally {
340                 if (list == null) {
341                     list = new ArrayList<Image>();
342                 }
343 
344                 cacheResult(list);
345 
346                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_SIZE, finderArgs,
347                     list);
348 
349                 closeSession(session);
350             }
351         }
352 
353         return list;
354     }
355 
356     public List<Image> findBySize(int size, int start, int end)
357         throws SystemException {
358         return findBySize(size, start, end, null);
359     }
360 
361     public List<Image> findBySize(int size, int start, int end,
362         OrderByComparator orderByComparator) throws SystemException {
363         Object[] finderArgs = new Object[] {
364                 new Integer(size),
365                 
366                 String.valueOf(start), String.valueOf(end),
367                 String.valueOf(orderByComparator)
368             };
369 
370         List<Image> list = (List<Image>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_SIZE,
371                 finderArgs, this);
372 
373         if (list == null) {
374             Session session = null;
375 
376             try {
377                 session = openSession();
378 
379                 StringBundler query = null;
380 
381                 if (orderByComparator != null) {
382                     query = new StringBundler(3 +
383                             (orderByComparator.getOrderByFields().length * 3));
384                 }
385                 else {
386                     query = new StringBundler(3);
387                 }
388 
389                 query.append(_SQL_SELECT_IMAGE_WHERE);
390 
391                 query.append(_FINDER_COLUMN_SIZE_SIZE_2);
392 
393                 if (orderByComparator != null) {
394                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
395                         orderByComparator);
396                 }
397 
398                 else {
399                     query.append(ImageModelImpl.ORDER_BY_JPQL);
400                 }
401 
402                 String sql = query.toString();
403 
404                 Query q = session.createQuery(sql);
405 
406                 QueryPos qPos = QueryPos.getInstance(q);
407 
408                 qPos.add(size);
409 
410                 list = (List<Image>)QueryUtil.list(q, getDialect(), start, end);
411             }
412             catch (Exception e) {
413                 throw processException(e);
414             }
415             finally {
416                 if (list == null) {
417                     list = new ArrayList<Image>();
418                 }
419 
420                 cacheResult(list);
421 
422                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_SIZE,
423                     finderArgs, list);
424 
425                 closeSession(session);
426             }
427         }
428 
429         return list;
430     }
431 
432     public Image findBySize_First(int size, OrderByComparator orderByComparator)
433         throws NoSuchImageException, SystemException {
434         List<Image> list = findBySize(size, 0, 1, orderByComparator);
435 
436         if (list.isEmpty()) {
437             StringBundler msg = new StringBundler(4);
438 
439             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
440 
441             msg.append("size=");
442             msg.append(size);
443 
444             msg.append(StringPool.CLOSE_CURLY_BRACE);
445 
446             throw new NoSuchImageException(msg.toString());
447         }
448         else {
449             return list.get(0);
450         }
451     }
452 
453     public Image findBySize_Last(int size, OrderByComparator orderByComparator)
454         throws NoSuchImageException, SystemException {
455         int count = countBySize(size);
456 
457         List<Image> list = findBySize(size, count - 1, count, orderByComparator);
458 
459         if (list.isEmpty()) {
460             StringBundler msg = new StringBundler(4);
461 
462             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
463 
464             msg.append("size=");
465             msg.append(size);
466 
467             msg.append(StringPool.CLOSE_CURLY_BRACE);
468 
469             throw new NoSuchImageException(msg.toString());
470         }
471         else {
472             return list.get(0);
473         }
474     }
475 
476     public Image[] findBySize_PrevAndNext(long imageId, int size,
477         OrderByComparator orderByComparator)
478         throws NoSuchImageException, SystemException {
479         Image image = findByPrimaryKey(imageId);
480 
481         int count = countBySize(size);
482 
483         Session session = null;
484 
485         try {
486             session = openSession();
487 
488             StringBundler query = null;
489 
490             if (orderByComparator != null) {
491                 query = new StringBundler(3 +
492                         (orderByComparator.getOrderByFields().length * 3));
493             }
494             else {
495                 query = new StringBundler(3);
496             }
497 
498             query.append(_SQL_SELECT_IMAGE_WHERE);
499 
500             query.append(_FINDER_COLUMN_SIZE_SIZE_2);
501 
502             if (orderByComparator != null) {
503                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
504                     orderByComparator);
505             }
506 
507             else {
508                 query.append(ImageModelImpl.ORDER_BY_JPQL);
509             }
510 
511             String sql = query.toString();
512 
513             Query q = session.createQuery(sql);
514 
515             QueryPos qPos = QueryPos.getInstance(q);
516 
517             qPos.add(size);
518 
519             Object[] objArray = QueryUtil.getPrevAndNext(q, count,
520                     orderByComparator, image);
521 
522             Image[] array = new ImageImpl[3];
523 
524             array[0] = (Image)objArray[0];
525             array[1] = (Image)objArray[1];
526             array[2] = (Image)objArray[2];
527 
528             return array;
529         }
530         catch (Exception e) {
531             throw processException(e);
532         }
533         finally {
534             closeSession(session);
535         }
536     }
537 
538     public List<Image> findAll() throws SystemException {
539         return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
540     }
541 
542     public List<Image> findAll(int start, int end) throws SystemException {
543         return findAll(start, end, null);
544     }
545 
546     public List<Image> findAll(int start, int end,
547         OrderByComparator orderByComparator) throws SystemException {
548         Object[] finderArgs = new Object[] {
549                 String.valueOf(start), String.valueOf(end),
550                 String.valueOf(orderByComparator)
551             };
552 
553         List<Image> list = (List<Image>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
554                 finderArgs, this);
555 
556         if (list == null) {
557             Session session = null;
558 
559             try {
560                 session = openSession();
561 
562                 StringBundler query = null;
563                 String sql = null;
564 
565                 if (orderByComparator != null) {
566                     query = new StringBundler(2 +
567                             (orderByComparator.getOrderByFields().length * 3));
568 
569                     query.append(_SQL_SELECT_IMAGE);
570 
571                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
572                         orderByComparator);
573 
574                     sql = query.toString();
575                 }
576 
577                 else {
578                     sql = _SQL_SELECT_IMAGE.concat(ImageModelImpl.ORDER_BY_JPQL);
579                 }
580 
581                 Query q = session.createQuery(sql);
582 
583                 if (orderByComparator == null) {
584                     list = (List<Image>)QueryUtil.list(q, getDialect(), start,
585                             end, false);
586 
587                     Collections.sort(list);
588                 }
589                 else {
590                     list = (List<Image>)QueryUtil.list(q, getDialect(), start,
591                             end);
592                 }
593             }
594             catch (Exception e) {
595                 throw processException(e);
596             }
597             finally {
598                 if (list == null) {
599                     list = new ArrayList<Image>();
600                 }
601 
602                 cacheResult(list);
603 
604                 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
605 
606                 closeSession(session);
607             }
608         }
609 
610         return list;
611     }
612 
613     public void removeBySize(int size) throws SystemException {
614         for (Image image : findBySize(size)) {
615             remove(image);
616         }
617     }
618 
619     public void removeAll() throws SystemException {
620         for (Image image : findAll()) {
621             remove(image);
622         }
623     }
624 
625     public int countBySize(int size) throws SystemException {
626         Object[] finderArgs = new Object[] { new Integer(size) };
627 
628         Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_SIZE,
629                 finderArgs, this);
630 
631         if (count == null) {
632             Session session = null;
633 
634             try {
635                 session = openSession();
636 
637                 StringBundler query = new StringBundler(2);
638 
639                 query.append(_SQL_COUNT_IMAGE_WHERE);
640 
641                 query.append(_FINDER_COLUMN_SIZE_SIZE_2);
642 
643                 String sql = query.toString();
644 
645                 Query q = session.createQuery(sql);
646 
647                 QueryPos qPos = QueryPos.getInstance(q);
648 
649                 qPos.add(size);
650 
651                 count = (Long)q.uniqueResult();
652             }
653             catch (Exception e) {
654                 throw processException(e);
655             }
656             finally {
657                 if (count == null) {
658                     count = Long.valueOf(0);
659                 }
660 
661                 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_SIZE,
662                     finderArgs, count);
663 
664                 closeSession(session);
665             }
666         }
667 
668         return count.intValue();
669     }
670 
671     public int countAll() throws SystemException {
672         Object[] finderArgs = new Object[0];
673 
674         Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
675                 finderArgs, this);
676 
677         if (count == null) {
678             Session session = null;
679 
680             try {
681                 session = openSession();
682 
683                 Query q = session.createQuery(_SQL_COUNT_IMAGE);
684 
685                 count = (Long)q.uniqueResult();
686             }
687             catch (Exception e) {
688                 throw processException(e);
689             }
690             finally {
691                 if (count == null) {
692                     count = Long.valueOf(0);
693                 }
694 
695                 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
696                     count);
697 
698                 closeSession(session);
699             }
700         }
701 
702         return count.intValue();
703     }
704 
705     public void afterPropertiesSet() {
706         String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
707                     com.liferay.portal.util.PropsUtil.get(
708                         "value.object.listener.com.liferay.portal.model.Image")));
709 
710         if (listenerClassNames.length > 0) {
711             try {
712                 List<ModelListener<Image>> listenersList = new ArrayList<ModelListener<Image>>();
713 
714                 for (String listenerClassName : listenerClassNames) {
715                     listenersList.add((ModelListener<Image>)Class.forName(
716                             listenerClassName).newInstance());
717                 }
718 
719                 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
720             }
721             catch (Exception e) {
722                 _log.error(e);
723             }
724         }
725     }
726 
727     @BeanReference(type = AccountPersistence.class)
728     protected AccountPersistence accountPersistence;
729     @BeanReference(type = AddressPersistence.class)
730     protected AddressPersistence addressPersistence;
731     @BeanReference(type = BrowserTrackerPersistence.class)
732     protected BrowserTrackerPersistence browserTrackerPersistence;
733     @BeanReference(type = ClassNamePersistence.class)
734     protected ClassNamePersistence classNamePersistence;
735     @BeanReference(type = CompanyPersistence.class)
736     protected CompanyPersistence companyPersistence;
737     @BeanReference(type = ContactPersistence.class)
738     protected ContactPersistence contactPersistence;
739     @BeanReference(type = CountryPersistence.class)
740     protected CountryPersistence countryPersistence;
741     @BeanReference(type = EmailAddressPersistence.class)
742     protected EmailAddressPersistence emailAddressPersistence;
743     @BeanReference(type = GroupPersistence.class)
744     protected GroupPersistence groupPersistence;
745     @BeanReference(type = ImagePersistence.class)
746     protected ImagePersistence imagePersistence;
747     @BeanReference(type = LayoutPersistence.class)
748     protected LayoutPersistence layoutPersistence;
749     @BeanReference(type = LayoutPrototypePersistence.class)
750     protected LayoutPrototypePersistence layoutPrototypePersistence;
751     @BeanReference(type = LayoutSetPersistence.class)
752     protected LayoutSetPersistence layoutSetPersistence;
753     @BeanReference(type = LayoutSetPrototypePersistence.class)
754     protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
755     @BeanReference(type = ListTypePersistence.class)
756     protected ListTypePersistence listTypePersistence;
757     @BeanReference(type = LockPersistence.class)
758     protected LockPersistence lockPersistence;
759     @BeanReference(type = MembershipRequestPersistence.class)
760     protected MembershipRequestPersistence membershipRequestPersistence;
761     @BeanReference(type = OrganizationPersistence.class)
762     protected OrganizationPersistence organizationPersistence;
763     @BeanReference(type = OrgGroupPermissionPersistence.class)
764     protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
765     @BeanReference(type = OrgGroupRolePersistence.class)
766     protected OrgGroupRolePersistence orgGroupRolePersistence;
767     @BeanReference(type = OrgLaborPersistence.class)
768     protected OrgLaborPersistence orgLaborPersistence;
769     @BeanReference(type = PasswordPolicyPersistence.class)
770     protected PasswordPolicyPersistence passwordPolicyPersistence;
771     @BeanReference(type = PasswordPolicyRelPersistence.class)
772     protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
773     @BeanReference(type = PasswordTrackerPersistence.class)
774     protected PasswordTrackerPersistence passwordTrackerPersistence;
775     @BeanReference(type = PermissionPersistence.class)
776     protected PermissionPersistence permissionPersistence;
777     @BeanReference(type = PhonePersistence.class)
778     protected PhonePersistence phonePersistence;
779     @BeanReference(type = PluginSettingPersistence.class)
780     protected PluginSettingPersistence pluginSettingPersistence;
781     @BeanReference(type = PortletPersistence.class)
782     protected PortletPersistence portletPersistence;
783     @BeanReference(type = PortletItemPersistence.class)
784     protected PortletItemPersistence portletItemPersistence;
785     @BeanReference(type = PortletPreferencesPersistence.class)
786     protected PortletPreferencesPersistence portletPreferencesPersistence;
787     @BeanReference(type = RegionPersistence.class)
788     protected RegionPersistence regionPersistence;
789     @BeanReference(type = ReleasePersistence.class)
790     protected ReleasePersistence releasePersistence;
791     @BeanReference(type = ResourcePersistence.class)
792     protected ResourcePersistence resourcePersistence;
793     @BeanReference(type = ResourceActionPersistence.class)
794     protected ResourceActionPersistence resourceActionPersistence;
795     @BeanReference(type = ResourceCodePersistence.class)
796     protected ResourceCodePersistence resourceCodePersistence;
797     @BeanReference(type = ResourcePermissionPersistence.class)
798     protected ResourcePermissionPersistence resourcePermissionPersistence;
799     @BeanReference(type = RolePersistence.class)
800     protected RolePersistence rolePersistence;
801     @BeanReference(type = ServiceComponentPersistence.class)
802     protected ServiceComponentPersistence serviceComponentPersistence;
803     @BeanReference(type = ShardPersistence.class)
804     protected ShardPersistence shardPersistence;
805     @BeanReference(type = SubscriptionPersistence.class)
806     protected SubscriptionPersistence subscriptionPersistence;
807     @BeanReference(type = TeamPersistence.class)
808     protected TeamPersistence teamPersistence;
809     @BeanReference(type = UserPersistence.class)
810     protected UserPersistence userPersistence;
811     @BeanReference(type = UserGroupPersistence.class)
812     protected UserGroupPersistence userGroupPersistence;
813     @BeanReference(type = UserGroupGroupRolePersistence.class)
814     protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
815     @BeanReference(type = UserGroupRolePersistence.class)
816     protected UserGroupRolePersistence userGroupRolePersistence;
817     @BeanReference(type = UserIdMapperPersistence.class)
818     protected UserIdMapperPersistence userIdMapperPersistence;
819     @BeanReference(type = UserTrackerPersistence.class)
820     protected UserTrackerPersistence userTrackerPersistence;
821     @BeanReference(type = UserTrackerPathPersistence.class)
822     protected UserTrackerPathPersistence userTrackerPathPersistence;
823     @BeanReference(type = WebDAVPropsPersistence.class)
824     protected WebDAVPropsPersistence webDAVPropsPersistence;
825     @BeanReference(type = WebsitePersistence.class)
826     protected WebsitePersistence websitePersistence;
827     @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
828     protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
829     @BeanReference(type = WorkflowInstanceLinkPersistence.class)
830     protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
831     private static final String _SQL_SELECT_IMAGE = "SELECT image FROM Image image";
832     private static final String _SQL_SELECT_IMAGE_WHERE = "SELECT image FROM Image image WHERE ";
833     private static final String _SQL_COUNT_IMAGE = "SELECT COUNT(image) FROM Image image";
834     private static final String _SQL_COUNT_IMAGE_WHERE = "SELECT COUNT(image) FROM Image image WHERE ";
835     private static final String _FINDER_COLUMN_SIZE_SIZE_2 = "image.size < ?";
836     private static final String _ORDER_BY_ENTITY_ALIAS = "image.";
837     private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Image exists with the primary key ";
838     private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Image exists with the key {";
839     private static Log _log = LogFactoryUtil.getLog(ImagePersistenceImpl.class);
840 }