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