1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
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.SystemException;
20  import com.liferay.portal.kernel.annotation.BeanReference;
21  import com.liferay.portal.kernel.cache.CacheRegistry;
22  import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
23  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
24  import com.liferay.portal.kernel.dao.orm.FinderPath;
25  import com.liferay.portal.kernel.dao.orm.Query;
26  import com.liferay.portal.kernel.dao.orm.QueryPos;
27  import com.liferay.portal.kernel.dao.orm.QueryUtil;
28  import com.liferay.portal.kernel.dao.orm.Session;
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     /**
205      * @deprecated Use {@link BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)}.
206      */
207     public Image update(Image image) throws SystemException {
208         if (_log.isWarnEnabled()) {
209             _log.warn(
210                 "Using the deprecated update(Image image) method. Use update(Image image, boolean merge) instead.");
211         }
212 
213         return update(image, false);
214     }
215 
216     public Image updateImpl(com.liferay.portal.model.Image image, boolean merge)
217         throws SystemException {
218         image = toUnwrappedModel(image);
219 
220         Session session = null;
221 
222         try {
223             session = openSession();
224 
225             BatchSessionUtil.update(session, image, merge);
226 
227             image.setNew(false);
228         }
229         catch (Exception e) {
230             throw processException(e);
231         }
232         finally {
233             closeSession(session);
234         }
235 
236         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
237 
238         EntityCacheUtil.putResult(ImageModelImpl.ENTITY_CACHE_ENABLED,
239             ImageImpl.class, image.getPrimaryKey(), image);
240 
241         return image;
242     }
243 
244     protected Image toUnwrappedModel(Image image) {
245         if (image instanceof ImageImpl) {
246             return image;
247         }
248 
249         ImageImpl imageImpl = new ImageImpl();
250 
251         imageImpl.setNew(image.isNew());
252         imageImpl.setPrimaryKey(image.getPrimaryKey());
253 
254         imageImpl.setImageId(image.getImageId());
255         imageImpl.setModifiedDate(image.getModifiedDate());
256         imageImpl.setText(image.getText());
257         imageImpl.setType(image.getType());
258         imageImpl.setHeight(image.getHeight());
259         imageImpl.setWidth(image.getWidth());
260         imageImpl.setSize(image.getSize());
261 
262         return imageImpl;
263     }
264 
265     public Image findByPrimaryKey(Serializable primaryKey)
266         throws NoSuchModelException, SystemException {
267         return findByPrimaryKey(((Long)primaryKey).longValue());
268     }
269 
270     public Image findByPrimaryKey(long imageId)
271         throws NoSuchImageException, SystemException {
272         Image image = fetchByPrimaryKey(imageId);
273 
274         if (image == null) {
275             if (_log.isWarnEnabled()) {
276                 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + imageId);
277             }
278 
279             throw new NoSuchImageException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
280                 imageId);
281         }
282 
283         return image;
284     }
285 
286     public Image fetchByPrimaryKey(Serializable primaryKey)
287         throws SystemException {
288         return fetchByPrimaryKey(((Long)primaryKey).longValue());
289     }
290 
291     public Image fetchByPrimaryKey(long imageId) throws SystemException {
292         Image image = (Image)EntityCacheUtil.getResult(ImageModelImpl.ENTITY_CACHE_ENABLED,
293                 ImageImpl.class, imageId, this);
294 
295         if (image == null) {
296             Session session = null;
297 
298             try {
299                 session = openSession();
300 
301                 image = (Image)session.get(ImageImpl.class, new Long(imageId));
302             }
303             catch (Exception e) {
304                 throw processException(e);
305             }
306             finally {
307                 if (image != null) {
308                     cacheResult(image);
309                 }
310 
311                 closeSession(session);
312             }
313         }
314 
315         return image;
316     }
317 
318     public List<Image> findBySize(int size) throws SystemException {
319         Object[] finderArgs = new Object[] { new Integer(size) };
320 
321         List<Image> list = (List<Image>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_SIZE,
322                 finderArgs, this);
323 
324         if (list == null) {
325             Session session = null;
326 
327             try {
328                 session = openSession();
329 
330                 StringBundler query = new StringBundler(3);
331 
332                 query.append(_SQL_SELECT_IMAGE_WHERE);
333 
334                 query.append(_FINDER_COLUMN_SIZE_SIZE_2);
335 
336                 query.append(ImageModelImpl.ORDER_BY_JPQL);
337 
338                 String sql = query.toString();
339 
340                 Query q = session.createQuery(sql);
341 
342                 QueryPos qPos = QueryPos.getInstance(q);
343 
344                 qPos.add(size);
345 
346                 list = q.list();
347             }
348             catch (Exception e) {
349                 throw processException(e);
350             }
351             finally {
352                 if (list == null) {
353                     list = new ArrayList<Image>();
354                 }
355 
356                 cacheResult(list);
357 
358                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_SIZE, finderArgs,
359                     list);
360 
361                 closeSession(session);
362             }
363         }
364 
365         return list;
366     }
367 
368     public List<Image> findBySize(int size, int start, int end)
369         throws SystemException {
370         return findBySize(size, start, end, null);
371     }
372 
373     public List<Image> findBySize(int size, int start, int end,
374         OrderByComparator orderByComparator) throws SystemException {
375         Object[] finderArgs = new Object[] {
376                 new Integer(size),
377                 
378                 String.valueOf(start), String.valueOf(end),
379                 String.valueOf(orderByComparator)
380             };
381 
382         List<Image> list = (List<Image>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_SIZE,
383                 finderArgs, this);
384 
385         if (list == null) {
386             Session session = null;
387 
388             try {
389                 session = openSession();
390 
391                 StringBundler query = null;
392 
393                 if (orderByComparator != null) {
394                     query = new StringBundler(3 +
395                             (orderByComparator.getOrderByFields().length * 3));
396                 }
397                 else {
398                     query = new StringBundler(3);
399                 }
400 
401                 query.append(_SQL_SELECT_IMAGE_WHERE);
402 
403                 query.append(_FINDER_COLUMN_SIZE_SIZE_2);
404 
405                 if (orderByComparator != null) {
406                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
407                         orderByComparator);
408                 }
409 
410                 else {
411                     query.append(ImageModelImpl.ORDER_BY_JPQL);
412                 }
413 
414                 String sql = query.toString();
415 
416                 Query q = session.createQuery(sql);
417 
418                 QueryPos qPos = QueryPos.getInstance(q);
419 
420                 qPos.add(size);
421 
422                 list = (List<Image>)QueryUtil.list(q, getDialect(), start, end);
423             }
424             catch (Exception e) {
425                 throw processException(e);
426             }
427             finally {
428                 if (list == null) {
429                     list = new ArrayList<Image>();
430                 }
431 
432                 cacheResult(list);
433 
434                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_SIZE,
435                     finderArgs, list);
436 
437                 closeSession(session);
438             }
439         }
440 
441         return list;
442     }
443 
444     public Image findBySize_First(int size, OrderByComparator orderByComparator)
445         throws NoSuchImageException, SystemException {
446         List<Image> list = findBySize(size, 0, 1, orderByComparator);
447 
448         if (list.isEmpty()) {
449             StringBundler msg = new StringBundler(4);
450 
451             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
452 
453             msg.append("size=");
454             msg.append(size);
455 
456             msg.append(StringPool.CLOSE_CURLY_BRACE);
457 
458             throw new NoSuchImageException(msg.toString());
459         }
460         else {
461             return list.get(0);
462         }
463     }
464 
465     public Image findBySize_Last(int size, OrderByComparator orderByComparator)
466         throws NoSuchImageException, SystemException {
467         int count = countBySize(size);
468 
469         List<Image> list = findBySize(size, count - 1, count, orderByComparator);
470 
471         if (list.isEmpty()) {
472             StringBundler msg = new StringBundler(4);
473 
474             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
475 
476             msg.append("size=");
477             msg.append(size);
478 
479             msg.append(StringPool.CLOSE_CURLY_BRACE);
480 
481             throw new NoSuchImageException(msg.toString());
482         }
483         else {
484             return list.get(0);
485         }
486     }
487 
488     public Image[] findBySize_PrevAndNext(long imageId, int size,
489         OrderByComparator orderByComparator)
490         throws NoSuchImageException, SystemException {
491         Image image = findByPrimaryKey(imageId);
492 
493         int count = countBySize(size);
494 
495         Session session = null;
496 
497         try {
498             session = openSession();
499 
500             StringBundler query = null;
501 
502             if (orderByComparator != null) {
503                 query = new StringBundler(3 +
504                         (orderByComparator.getOrderByFields().length * 3));
505             }
506             else {
507                 query = new StringBundler(3);
508             }
509 
510             query.append(_SQL_SELECT_IMAGE_WHERE);
511 
512             query.append(_FINDER_COLUMN_SIZE_SIZE_2);
513 
514             if (orderByComparator != null) {
515                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
516                     orderByComparator);
517             }
518 
519             else {
520                 query.append(ImageModelImpl.ORDER_BY_JPQL);
521             }
522 
523             String sql = query.toString();
524 
525             Query q = session.createQuery(sql);
526 
527             QueryPos qPos = QueryPos.getInstance(q);
528 
529             qPos.add(size);
530 
531             Object[] objArray = QueryUtil.getPrevAndNext(q, count,
532                     orderByComparator, image);
533 
534             Image[] array = new ImageImpl[3];
535 
536             array[0] = (Image)objArray[0];
537             array[1] = (Image)objArray[1];
538             array[2] = (Image)objArray[2];
539 
540             return array;
541         }
542         catch (Exception e) {
543             throw processException(e);
544         }
545         finally {
546             closeSession(session);
547         }
548     }
549 
550     public List<Image> findAll() throws SystemException {
551         return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
552     }
553 
554     public List<Image> findAll(int start, int end) throws SystemException {
555         return findAll(start, end, null);
556     }
557 
558     public List<Image> findAll(int start, int end,
559         OrderByComparator orderByComparator) throws SystemException {
560         Object[] finderArgs = new Object[] {
561                 String.valueOf(start), String.valueOf(end),
562                 String.valueOf(orderByComparator)
563             };
564 
565         List<Image> list = (List<Image>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
566                 finderArgs, this);
567 
568         if (list == null) {
569             Session session = null;
570 
571             try {
572                 session = openSession();
573 
574                 StringBundler query = null;
575                 String sql = null;
576 
577                 if (orderByComparator != null) {
578                     query = new StringBundler(2 +
579                             (orderByComparator.getOrderByFields().length * 3));
580 
581                     query.append(_SQL_SELECT_IMAGE);
582 
583                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
584                         orderByComparator);
585 
586                     sql = query.toString();
587                 }
588 
589                 else {
590                     sql = _SQL_SELECT_IMAGE.concat(ImageModelImpl.ORDER_BY_JPQL);
591                 }
592 
593                 Query q = session.createQuery(sql);
594 
595                 if (orderByComparator == null) {
596                     list = (List<Image>)QueryUtil.list(q, getDialect(), start,
597                             end, false);
598 
599                     Collections.sort(list);
600                 }
601                 else {
602                     list = (List<Image>)QueryUtil.list(q, getDialect(), start,
603                             end);
604                 }
605             }
606             catch (Exception e) {
607                 throw processException(e);
608             }
609             finally {
610                 if (list == null) {
611                     list = new ArrayList<Image>();
612                 }
613 
614                 cacheResult(list);
615 
616                 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
617 
618                 closeSession(session);
619             }
620         }
621 
622         return list;
623     }
624 
625     public void removeBySize(int size) throws SystemException {
626         for (Image image : findBySize(size)) {
627             remove(image);
628         }
629     }
630 
631     public void removeAll() throws SystemException {
632         for (Image image : findAll()) {
633             remove(image);
634         }
635     }
636 
637     public int countBySize(int size) throws SystemException {
638         Object[] finderArgs = new Object[] { new Integer(size) };
639 
640         Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_SIZE,
641                 finderArgs, this);
642 
643         if (count == null) {
644             Session session = null;
645 
646             try {
647                 session = openSession();
648 
649                 StringBundler query = new StringBundler(2);
650 
651                 query.append(_SQL_COUNT_IMAGE_WHERE);
652 
653                 query.append(_FINDER_COLUMN_SIZE_SIZE_2);
654 
655                 String sql = query.toString();
656 
657                 Query q = session.createQuery(sql);
658 
659                 QueryPos qPos = QueryPos.getInstance(q);
660 
661                 qPos.add(size);
662 
663                 count = (Long)q.uniqueResult();
664             }
665             catch (Exception e) {
666                 throw processException(e);
667             }
668             finally {
669                 if (count == null) {
670                     count = Long.valueOf(0);
671                 }
672 
673                 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_SIZE,
674                     finderArgs, count);
675 
676                 closeSession(session);
677             }
678         }
679 
680         return count.intValue();
681     }
682 
683     public int countAll() throws SystemException {
684         Object[] finderArgs = new Object[0];
685 
686         Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
687                 finderArgs, this);
688 
689         if (count == null) {
690             Session session = null;
691 
692             try {
693                 session = openSession();
694 
695                 Query q = session.createQuery(_SQL_COUNT_IMAGE);
696 
697                 count = (Long)q.uniqueResult();
698             }
699             catch (Exception e) {
700                 throw processException(e);
701             }
702             finally {
703                 if (count == null) {
704                     count = Long.valueOf(0);
705                 }
706 
707                 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
708                     count);
709 
710                 closeSession(session);
711             }
712         }
713 
714         return count.intValue();
715     }
716 
717     public void afterPropertiesSet() {
718         String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
719                     com.liferay.portal.util.PropsUtil.get(
720                         "value.object.listener.com.liferay.portal.model.Image")));
721 
722         if (listenerClassNames.length > 0) {
723             try {
724                 List<ModelListener<Image>> listenersList = new ArrayList<ModelListener<Image>>();
725 
726                 for (String listenerClassName : listenerClassNames) {
727                     listenersList.add((ModelListener<Image>)Class.forName(
728                             listenerClassName).newInstance());
729                 }
730 
731                 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
732             }
733             catch (Exception e) {
734                 _log.error(e);
735             }
736         }
737     }
738 
739     @BeanReference(type = AccountPersistence.class)
740     protected AccountPersistence accountPersistence;
741     @BeanReference(type = AddressPersistence.class)
742     protected AddressPersistence addressPersistence;
743     @BeanReference(type = BrowserTrackerPersistence.class)
744     protected BrowserTrackerPersistence browserTrackerPersistence;
745     @BeanReference(type = ClassNamePersistence.class)
746     protected ClassNamePersistence classNamePersistence;
747     @BeanReference(type = CompanyPersistence.class)
748     protected CompanyPersistence companyPersistence;
749     @BeanReference(type = ContactPersistence.class)
750     protected ContactPersistence contactPersistence;
751     @BeanReference(type = CountryPersistence.class)
752     protected CountryPersistence countryPersistence;
753     @BeanReference(type = EmailAddressPersistence.class)
754     protected EmailAddressPersistence emailAddressPersistence;
755     @BeanReference(type = GroupPersistence.class)
756     protected GroupPersistence groupPersistence;
757     @BeanReference(type = ImagePersistence.class)
758     protected ImagePersistence imagePersistence;
759     @BeanReference(type = LayoutPersistence.class)
760     protected LayoutPersistence layoutPersistence;
761     @BeanReference(type = LayoutSetPersistence.class)
762     protected LayoutSetPersistence layoutSetPersistence;
763     @BeanReference(type = ListTypePersistence.class)
764     protected ListTypePersistence listTypePersistence;
765     @BeanReference(type = LockPersistence.class)
766     protected LockPersistence lockPersistence;
767     @BeanReference(type = MembershipRequestPersistence.class)
768     protected MembershipRequestPersistence membershipRequestPersistence;
769     @BeanReference(type = OrganizationPersistence.class)
770     protected OrganizationPersistence organizationPersistence;
771     @BeanReference(type = OrgGroupPermissionPersistence.class)
772     protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
773     @BeanReference(type = OrgGroupRolePersistence.class)
774     protected OrgGroupRolePersistence orgGroupRolePersistence;
775     @BeanReference(type = OrgLaborPersistence.class)
776     protected OrgLaborPersistence orgLaborPersistence;
777     @BeanReference(type = PasswordPolicyPersistence.class)
778     protected PasswordPolicyPersistence passwordPolicyPersistence;
779     @BeanReference(type = PasswordPolicyRelPersistence.class)
780     protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
781     @BeanReference(type = PasswordTrackerPersistence.class)
782     protected PasswordTrackerPersistence passwordTrackerPersistence;
783     @BeanReference(type = PermissionPersistence.class)
784     protected PermissionPersistence permissionPersistence;
785     @BeanReference(type = PhonePersistence.class)
786     protected PhonePersistence phonePersistence;
787     @BeanReference(type = PluginSettingPersistence.class)
788     protected PluginSettingPersistence pluginSettingPersistence;
789     @BeanReference(type = PortletPersistence.class)
790     protected PortletPersistence portletPersistence;
791     @BeanReference(type = PortletItemPersistence.class)
792     protected PortletItemPersistence portletItemPersistence;
793     @BeanReference(type = PortletPreferencesPersistence.class)
794     protected PortletPreferencesPersistence portletPreferencesPersistence;
795     @BeanReference(type = RegionPersistence.class)
796     protected RegionPersistence regionPersistence;
797     @BeanReference(type = ReleasePersistence.class)
798     protected ReleasePersistence releasePersistence;
799     @BeanReference(type = ResourcePersistence.class)
800     protected ResourcePersistence resourcePersistence;
801     @BeanReference(type = ResourceActionPersistence.class)
802     protected ResourceActionPersistence resourceActionPersistence;
803     @BeanReference(type = ResourceCodePersistence.class)
804     protected ResourceCodePersistence resourceCodePersistence;
805     @BeanReference(type = ResourcePermissionPersistence.class)
806     protected ResourcePermissionPersistence resourcePermissionPersistence;
807     @BeanReference(type = RolePersistence.class)
808     protected RolePersistence rolePersistence;
809     @BeanReference(type = ServiceComponentPersistence.class)
810     protected ServiceComponentPersistence serviceComponentPersistence;
811     @BeanReference(type = ShardPersistence.class)
812     protected ShardPersistence shardPersistence;
813     @BeanReference(type = SubscriptionPersistence.class)
814     protected SubscriptionPersistence subscriptionPersistence;
815     @BeanReference(type = UserPersistence.class)
816     protected UserPersistence userPersistence;
817     @BeanReference(type = UserGroupPersistence.class)
818     protected UserGroupPersistence userGroupPersistence;
819     @BeanReference(type = UserGroupGroupRolePersistence.class)
820     protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
821     @BeanReference(type = UserGroupRolePersistence.class)
822     protected UserGroupRolePersistence userGroupRolePersistence;
823     @BeanReference(type = UserIdMapperPersistence.class)
824     protected UserIdMapperPersistence userIdMapperPersistence;
825     @BeanReference(type = UserTrackerPersistence.class)
826     protected UserTrackerPersistence userTrackerPersistence;
827     @BeanReference(type = UserTrackerPathPersistence.class)
828     protected UserTrackerPathPersistence userTrackerPathPersistence;
829     @BeanReference(type = WebDAVPropsPersistence.class)
830     protected WebDAVPropsPersistence webDAVPropsPersistence;
831     @BeanReference(type = WebsitePersistence.class)
832     protected WebsitePersistence websitePersistence;
833     private static final String _SQL_SELECT_IMAGE = "SELECT image FROM Image image";
834     private static final String _SQL_SELECT_IMAGE_WHERE = "SELECT image FROM Image image WHERE ";
835     private static final String _SQL_COUNT_IMAGE = "SELECT COUNT(image) FROM Image image";
836     private static final String _SQL_COUNT_IMAGE_WHERE = "SELECT COUNT(image) FROM Image image WHERE ";
837     private static final String _FINDER_COLUMN_SIZE_SIZE_2 = "image.size < ?";
838     private static final String _ORDER_BY_ENTITY_ALIAS = "image.";
839     private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Image exists with the primary key ";
840     private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Image exists with the key {";
841     private static Log _log = LogFactoryUtil.getLog(ImagePersistenceImpl.class);
842 }