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