1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.tasks.service.persistence;
24  
25  import com.liferay.portal.NoSuchModelException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.BeanReference;
28  import com.liferay.portal.kernel.cache.CacheRegistry;
29  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
30  import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
31  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
32  import com.liferay.portal.kernel.dao.orm.FinderPath;
33  import com.liferay.portal.kernel.dao.orm.Query;
34  import com.liferay.portal.kernel.dao.orm.QueryPos;
35  import com.liferay.portal.kernel.dao.orm.QueryUtil;
36  import com.liferay.portal.kernel.dao.orm.Session;
37  import com.liferay.portal.kernel.log.Log;
38  import com.liferay.portal.kernel.log.LogFactoryUtil;
39  import com.liferay.portal.kernel.util.GetterUtil;
40  import com.liferay.portal.kernel.util.OrderByComparator;
41  import com.liferay.portal.kernel.util.StringBundler;
42  import com.liferay.portal.kernel.util.StringPool;
43  import com.liferay.portal.kernel.util.StringUtil;
44  import com.liferay.portal.kernel.util.Validator;
45  import com.liferay.portal.model.ModelListener;
46  import com.liferay.portal.service.persistence.BatchSessionUtil;
47  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
48  
49  import com.liferay.portlet.tasks.NoSuchProposalException;
50  import com.liferay.portlet.tasks.model.TasksProposal;
51  import com.liferay.portlet.tasks.model.impl.TasksProposalImpl;
52  import com.liferay.portlet.tasks.model.impl.TasksProposalModelImpl;
53  
54  import java.io.Serializable;
55  
56  import java.util.ArrayList;
57  import java.util.Collections;
58  import java.util.List;
59  
60  /**
61   * <a href="TasksProposalPersistenceImpl.java.html"><b><i>View Source</i></b></a>
62   *
63   * <p>
64   * ServiceBuilder generated this class. Modifications in this class will be
65   * overwritten the next time is generated.
66   * </p>
67   *
68   * @author    Brian Wing Shun Chan
69   * @see       TasksProposalPersistence
70   * @see       TasksProposalUtil
71   * @generated
72   */
73  public class TasksProposalPersistenceImpl extends BasePersistenceImpl<TasksProposal>
74      implements TasksProposalPersistence {
75      public static final String FINDER_CLASS_NAME_ENTITY = TasksProposalImpl.class.getName();
76      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
77          ".List";
78      public static final FinderPath FINDER_PATH_FIND_BY_GROUPID = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
79              TasksProposalModelImpl.FINDER_CACHE_ENABLED,
80              FINDER_CLASS_NAME_LIST, "findByGroupId",
81              new String[] { Long.class.getName() });
82      public static final FinderPath FINDER_PATH_FIND_BY_OBC_GROUPID = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
83              TasksProposalModelImpl.FINDER_CACHE_ENABLED,
84              FINDER_CLASS_NAME_LIST, "findByGroupId",
85              new String[] {
86                  Long.class.getName(),
87                  
88              "java.lang.Integer", "java.lang.Integer",
89                  "com.liferay.portal.kernel.util.OrderByComparator"
90              });
91      public static final FinderPath FINDER_PATH_COUNT_BY_GROUPID = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
92              TasksProposalModelImpl.FINDER_CACHE_ENABLED,
93              FINDER_CLASS_NAME_LIST, "countByGroupId",
94              new String[] { Long.class.getName() });
95      public static final FinderPath FINDER_PATH_FIND_BY_G_U = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
96              TasksProposalModelImpl.FINDER_CACHE_ENABLED,
97              FINDER_CLASS_NAME_LIST, "findByG_U",
98              new String[] { Long.class.getName(), Long.class.getName() });
99      public static final FinderPath FINDER_PATH_FIND_BY_OBC_G_U = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
100             TasksProposalModelImpl.FINDER_CACHE_ENABLED,
101             FINDER_CLASS_NAME_LIST, "findByG_U",
102             new String[] {
103                 Long.class.getName(), Long.class.getName(),
104                 
105             "java.lang.Integer", "java.lang.Integer",
106                 "com.liferay.portal.kernel.util.OrderByComparator"
107             });
108     public static final FinderPath FINDER_PATH_COUNT_BY_G_U = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
109             TasksProposalModelImpl.FINDER_CACHE_ENABLED,
110             FINDER_CLASS_NAME_LIST, "countByG_U",
111             new String[] { Long.class.getName(), Long.class.getName() });
112     public static final FinderPath FINDER_PATH_FETCH_BY_C_C = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
113             TasksProposalModelImpl.FINDER_CACHE_ENABLED,
114             FINDER_CLASS_NAME_ENTITY, "fetchByC_C",
115             new String[] { Long.class.getName(), String.class.getName() });
116     public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
117             TasksProposalModelImpl.FINDER_CACHE_ENABLED,
118             FINDER_CLASS_NAME_LIST, "countByC_C",
119             new String[] { Long.class.getName(), String.class.getName() });
120     public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
121             TasksProposalModelImpl.FINDER_CACHE_ENABLED,
122             FINDER_CLASS_NAME_LIST, "findAll", new String[0]);
123     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
124             TasksProposalModelImpl.FINDER_CACHE_ENABLED,
125             FINDER_CLASS_NAME_LIST, "countAll", new String[0]);
126 
127     public void cacheResult(TasksProposal tasksProposal) {
128         EntityCacheUtil.putResult(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
129             TasksProposalImpl.class, tasksProposal.getPrimaryKey(),
130             tasksProposal);
131 
132         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
133             new Object[] {
134                 new Long(tasksProposal.getClassNameId()),
135                 
136             tasksProposal.getClassPK()
137             }, tasksProposal);
138     }
139 
140     public void cacheResult(List<TasksProposal> tasksProposals) {
141         for (TasksProposal tasksProposal : tasksProposals) {
142             if (EntityCacheUtil.getResult(
143                         TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
144                         TasksProposalImpl.class, tasksProposal.getPrimaryKey(),
145                         this) == null) {
146                 cacheResult(tasksProposal);
147             }
148         }
149     }
150 
151     public void clearCache() {
152         CacheRegistry.clear(TasksProposalImpl.class.getName());
153         EntityCacheUtil.clearCache(TasksProposalImpl.class.getName());
154         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
155         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
156     }
157 
158     public TasksProposal create(long proposalId) {
159         TasksProposal tasksProposal = new TasksProposalImpl();
160 
161         tasksProposal.setNew(true);
162         tasksProposal.setPrimaryKey(proposalId);
163 
164         return tasksProposal;
165     }
166 
167     public TasksProposal remove(Serializable primaryKey)
168         throws NoSuchModelException, SystemException {
169         return remove(((Long)primaryKey).longValue());
170     }
171 
172     public TasksProposal remove(long proposalId)
173         throws NoSuchProposalException, SystemException {
174         Session session = null;
175 
176         try {
177             session = openSession();
178 
179             TasksProposal tasksProposal = (TasksProposal)session.get(TasksProposalImpl.class,
180                     new Long(proposalId));
181 
182             if (tasksProposal == null) {
183                 if (_log.isWarnEnabled()) {
184                     _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + proposalId);
185                 }
186 
187                 throw new NoSuchProposalException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
188                     proposalId);
189             }
190 
191             return remove(tasksProposal);
192         }
193         catch (NoSuchProposalException nsee) {
194             throw nsee;
195         }
196         catch (Exception e) {
197             throw processException(e);
198         }
199         finally {
200             closeSession(session);
201         }
202     }
203 
204     public TasksProposal remove(TasksProposal tasksProposal)
205         throws SystemException {
206         for (ModelListener<TasksProposal> listener : listeners) {
207             listener.onBeforeRemove(tasksProposal);
208         }
209 
210         tasksProposal = removeImpl(tasksProposal);
211 
212         for (ModelListener<TasksProposal> listener : listeners) {
213             listener.onAfterRemove(tasksProposal);
214         }
215 
216         return tasksProposal;
217     }
218 
219     protected TasksProposal removeImpl(TasksProposal tasksProposal)
220         throws SystemException {
221         tasksProposal = toUnwrappedModel(tasksProposal);
222 
223         Session session = null;
224 
225         try {
226             session = openSession();
227 
228             if (tasksProposal.isCachedModel() || BatchSessionUtil.isEnabled()) {
229                 Object staleObject = session.get(TasksProposalImpl.class,
230                         tasksProposal.getPrimaryKeyObj());
231 
232                 if (staleObject != null) {
233                     session.evict(staleObject);
234                 }
235             }
236 
237             session.delete(tasksProposal);
238 
239             session.flush();
240         }
241         catch (Exception e) {
242             throw processException(e);
243         }
244         finally {
245             closeSession(session);
246         }
247 
248         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
249 
250         TasksProposalModelImpl tasksProposalModelImpl = (TasksProposalModelImpl)tasksProposal;
251 
252         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
253             new Object[] {
254                 new Long(tasksProposalModelImpl.getOriginalClassNameId()),
255                 
256             tasksProposalModelImpl.getOriginalClassPK()
257             });
258 
259         EntityCacheUtil.removeResult(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
260             TasksProposalImpl.class, tasksProposal.getPrimaryKey());
261 
262         return tasksProposal;
263     }
264 
265     /**
266      * @deprecated Use {@link BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)}.
267      */
268     public TasksProposal update(TasksProposal tasksProposal)
269         throws SystemException {
270         if (_log.isWarnEnabled()) {
271             _log.warn(
272                 "Using the deprecated update(TasksProposal tasksProposal) method. Use update(TasksProposal tasksProposal, boolean merge) instead.");
273         }
274 
275         return update(tasksProposal, false);
276     }
277 
278     public TasksProposal updateImpl(
279         com.liferay.portlet.tasks.model.TasksProposal tasksProposal,
280         boolean merge) throws SystemException {
281         tasksProposal = toUnwrappedModel(tasksProposal);
282 
283         boolean isNew = tasksProposal.isNew();
284 
285         TasksProposalModelImpl tasksProposalModelImpl = (TasksProposalModelImpl)tasksProposal;
286 
287         Session session = null;
288 
289         try {
290             session = openSession();
291 
292             BatchSessionUtil.update(session, tasksProposal, merge);
293 
294             tasksProposal.setNew(false);
295         }
296         catch (Exception e) {
297             throw processException(e);
298         }
299         finally {
300             closeSession(session);
301         }
302 
303         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
304 
305         EntityCacheUtil.putResult(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
306             TasksProposalImpl.class, tasksProposal.getPrimaryKey(),
307             tasksProposal);
308 
309         if (!isNew &&
310                 ((tasksProposal.getClassNameId() != tasksProposalModelImpl.getOriginalClassNameId()) ||
311                 !Validator.equals(tasksProposal.getClassPK(),
312                     tasksProposalModelImpl.getOriginalClassPK()))) {
313             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
314                 new Object[] {
315                     new Long(tasksProposalModelImpl.getOriginalClassNameId()),
316                     
317                 tasksProposalModelImpl.getOriginalClassPK()
318                 });
319         }
320 
321         if (isNew ||
322                 ((tasksProposal.getClassNameId() != tasksProposalModelImpl.getOriginalClassNameId()) ||
323                 !Validator.equals(tasksProposal.getClassPK(),
324                     tasksProposalModelImpl.getOriginalClassPK()))) {
325             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
326                 new Object[] {
327                     new Long(tasksProposal.getClassNameId()),
328                     
329                 tasksProposal.getClassPK()
330                 }, tasksProposal);
331         }
332 
333         return tasksProposal;
334     }
335 
336     protected TasksProposal toUnwrappedModel(TasksProposal tasksProposal) {
337         if (tasksProposal instanceof TasksProposalImpl) {
338             return tasksProposal;
339         }
340 
341         TasksProposalImpl tasksProposalImpl = new TasksProposalImpl();
342 
343         tasksProposalImpl.setNew(tasksProposal.isNew());
344         tasksProposalImpl.setPrimaryKey(tasksProposal.getPrimaryKey());
345 
346         tasksProposalImpl.setProposalId(tasksProposal.getProposalId());
347         tasksProposalImpl.setGroupId(tasksProposal.getGroupId());
348         tasksProposalImpl.setCompanyId(tasksProposal.getCompanyId());
349         tasksProposalImpl.setUserId(tasksProposal.getUserId());
350         tasksProposalImpl.setUserName(tasksProposal.getUserName());
351         tasksProposalImpl.setCreateDate(tasksProposal.getCreateDate());
352         tasksProposalImpl.setModifiedDate(tasksProposal.getModifiedDate());
353         tasksProposalImpl.setClassNameId(tasksProposal.getClassNameId());
354         tasksProposalImpl.setClassPK(tasksProposal.getClassPK());
355         tasksProposalImpl.setName(tasksProposal.getName());
356         tasksProposalImpl.setDescription(tasksProposal.getDescription());
357         tasksProposalImpl.setPublishDate(tasksProposal.getPublishDate());
358         tasksProposalImpl.setDueDate(tasksProposal.getDueDate());
359 
360         return tasksProposalImpl;
361     }
362 
363     public TasksProposal findByPrimaryKey(Serializable primaryKey)
364         throws NoSuchModelException, SystemException {
365         return findByPrimaryKey(((Long)primaryKey).longValue());
366     }
367 
368     public TasksProposal findByPrimaryKey(long proposalId)
369         throws NoSuchProposalException, SystemException {
370         TasksProposal tasksProposal = fetchByPrimaryKey(proposalId);
371 
372         if (tasksProposal == null) {
373             if (_log.isWarnEnabled()) {
374                 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + proposalId);
375             }
376 
377             throw new NoSuchProposalException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
378                 proposalId);
379         }
380 
381         return tasksProposal;
382     }
383 
384     public TasksProposal fetchByPrimaryKey(Serializable primaryKey)
385         throws SystemException {
386         return fetchByPrimaryKey(((Long)primaryKey).longValue());
387     }
388 
389     public TasksProposal fetchByPrimaryKey(long proposalId)
390         throws SystemException {
391         TasksProposal tasksProposal = (TasksProposal)EntityCacheUtil.getResult(TasksProposalModelImpl.ENTITY_CACHE_ENABLED,
392                 TasksProposalImpl.class, proposalId, this);
393 
394         if (tasksProposal == null) {
395             Session session = null;
396 
397             try {
398                 session = openSession();
399 
400                 tasksProposal = (TasksProposal)session.get(TasksProposalImpl.class,
401                         new Long(proposalId));
402             }
403             catch (Exception e) {
404                 throw processException(e);
405             }
406             finally {
407                 if (tasksProposal != null) {
408                     cacheResult(tasksProposal);
409                 }
410 
411                 closeSession(session);
412             }
413         }
414 
415         return tasksProposal;
416     }
417 
418     public List<TasksProposal> findByGroupId(long groupId)
419         throws SystemException {
420         Object[] finderArgs = new Object[] { new Long(groupId) };
421 
422         List<TasksProposal> list = (List<TasksProposal>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_GROUPID,
423                 finderArgs, this);
424 
425         if (list == null) {
426             Session session = null;
427 
428             try {
429                 session = openSession();
430 
431                 StringBundler query = new StringBundler(3);
432 
433                 query.append(_SQL_SELECT_TASKSPROPOSAL_WHERE);
434 
435                 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
436 
437                 query.append(TasksProposalModelImpl.ORDER_BY_JPQL);
438 
439                 String sql = query.toString();
440 
441                 Query q = session.createQuery(sql);
442 
443                 QueryPos qPos = QueryPos.getInstance(q);
444 
445                 qPos.add(groupId);
446 
447                 list = q.list();
448             }
449             catch (Exception e) {
450                 throw processException(e);
451             }
452             finally {
453                 if (list == null) {
454                     list = new ArrayList<TasksProposal>();
455                 }
456 
457                 cacheResult(list);
458 
459                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_GROUPID,
460                     finderArgs, list);
461 
462                 closeSession(session);
463             }
464         }
465 
466         return list;
467     }
468 
469     public List<TasksProposal> findByGroupId(long groupId, int start, int end)
470         throws SystemException {
471         return findByGroupId(groupId, start, end, null);
472     }
473 
474     public List<TasksProposal> findByGroupId(long groupId, int start, int end,
475         OrderByComparator obc) throws SystemException {
476         Object[] finderArgs = new Object[] {
477                 new Long(groupId),
478                 
479                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
480             };
481 
482         List<TasksProposal> list = (List<TasksProposal>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
483                 finderArgs, this);
484 
485         if (list == null) {
486             Session session = null;
487 
488             try {
489                 session = openSession();
490 
491                 StringBundler query = null;
492 
493                 if (obc != null) {
494                     query = new StringBundler(3 +
495                             (obc.getOrderByFields().length * 3));
496                 }
497                 else {
498                     query = new StringBundler(3);
499                 }
500 
501                 query.append(_SQL_SELECT_TASKSPROPOSAL_WHERE);
502 
503                 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
504 
505                 if (obc != null) {
506                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
507                 }
508 
509                 else {
510                     query.append(TasksProposalModelImpl.ORDER_BY_JPQL);
511                 }
512 
513                 String sql = query.toString();
514 
515                 Query q = session.createQuery(sql);
516 
517                 QueryPos qPos = QueryPos.getInstance(q);
518 
519                 qPos.add(groupId);
520 
521                 list = (List<TasksProposal>)QueryUtil.list(q, getDialect(),
522                         start, end);
523             }
524             catch (Exception e) {
525                 throw processException(e);
526             }
527             finally {
528                 if (list == null) {
529                     list = new ArrayList<TasksProposal>();
530                 }
531 
532                 cacheResult(list);
533 
534                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
535                     finderArgs, list);
536 
537                 closeSession(session);
538             }
539         }
540 
541         return list;
542     }
543 
544     public TasksProposal findByGroupId_First(long groupId, OrderByComparator obc)
545         throws NoSuchProposalException, SystemException {
546         List<TasksProposal> list = findByGroupId(groupId, 0, 1, obc);
547 
548         if (list.isEmpty()) {
549             StringBundler msg = new StringBundler(4);
550 
551             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
552 
553             msg.append("groupId=");
554             msg.append(groupId);
555 
556             msg.append(StringPool.CLOSE_CURLY_BRACE);
557 
558             throw new NoSuchProposalException(msg.toString());
559         }
560         else {
561             return list.get(0);
562         }
563     }
564 
565     public TasksProposal findByGroupId_Last(long groupId, OrderByComparator obc)
566         throws NoSuchProposalException, SystemException {
567         int count = countByGroupId(groupId);
568 
569         List<TasksProposal> list = findByGroupId(groupId, count - 1, count, obc);
570 
571         if (list.isEmpty()) {
572             StringBundler msg = new StringBundler(4);
573 
574             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
575 
576             msg.append("groupId=");
577             msg.append(groupId);
578 
579             msg.append(StringPool.CLOSE_CURLY_BRACE);
580 
581             throw new NoSuchProposalException(msg.toString());
582         }
583         else {
584             return list.get(0);
585         }
586     }
587 
588     public TasksProposal[] findByGroupId_PrevAndNext(long proposalId,
589         long groupId, OrderByComparator obc)
590         throws NoSuchProposalException, SystemException {
591         TasksProposal tasksProposal = findByPrimaryKey(proposalId);
592 
593         int count = countByGroupId(groupId);
594 
595         Session session = null;
596 
597         try {
598             session = openSession();
599 
600             StringBundler query = null;
601 
602             if (obc != null) {
603                 query = new StringBundler(3 +
604                         (obc.getOrderByFields().length * 3));
605             }
606             else {
607                 query = new StringBundler(3);
608             }
609 
610             query.append(_SQL_SELECT_TASKSPROPOSAL_WHERE);
611 
612             query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
613 
614             if (obc != null) {
615                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
616             }
617 
618             else {
619                 query.append(TasksProposalModelImpl.ORDER_BY_JPQL);
620             }
621 
622             String sql = query.toString();
623 
624             Query q = session.createQuery(sql);
625 
626             QueryPos qPos = QueryPos.getInstance(q);
627 
628             qPos.add(groupId);
629 
630             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
631                     tasksProposal);
632 
633             TasksProposal[] array = new TasksProposalImpl[3];
634 
635             array[0] = (TasksProposal)objArray[0];
636             array[1] = (TasksProposal)objArray[1];
637             array[2] = (TasksProposal)objArray[2];
638 
639             return array;
640         }
641         catch (Exception e) {
642             throw processException(e);
643         }
644         finally {
645             closeSession(session);
646         }
647     }
648 
649     public List<TasksProposal> findByG_U(long groupId, long userId)
650         throws SystemException {
651         Object[] finderArgs = new Object[] { new Long(groupId), new Long(userId) };
652 
653         List<TasksProposal> list = (List<TasksProposal>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_U,
654                 finderArgs, this);
655 
656         if (list == null) {
657             Session session = null;
658 
659             try {
660                 session = openSession();
661 
662                 StringBundler query = new StringBundler(4);
663 
664                 query.append(_SQL_SELECT_TASKSPROPOSAL_WHERE);
665 
666                 query.append(_FINDER_COLUMN_G_U_GROUPID_2);
667 
668                 query.append(_FINDER_COLUMN_G_U_USERID_2);
669 
670                 query.append(TasksProposalModelImpl.ORDER_BY_JPQL);
671 
672                 String sql = query.toString();
673 
674                 Query q = session.createQuery(sql);
675 
676                 QueryPos qPos = QueryPos.getInstance(q);
677 
678                 qPos.add(groupId);
679 
680                 qPos.add(userId);
681 
682                 list = q.list();
683             }
684             catch (Exception e) {
685                 throw processException(e);
686             }
687             finally {
688                 if (list == null) {
689                     list = new ArrayList<TasksProposal>();
690                 }
691 
692                 cacheResult(list);
693 
694                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_U, finderArgs,
695                     list);
696 
697                 closeSession(session);
698             }
699         }
700 
701         return list;
702     }
703 
704     public List<TasksProposal> findByG_U(long groupId, long userId, int start,
705         int end) throws SystemException {
706         return findByG_U(groupId, userId, start, end, null);
707     }
708 
709     public List<TasksProposal> findByG_U(long groupId, long userId, int start,
710         int end, OrderByComparator obc) throws SystemException {
711         Object[] finderArgs = new Object[] {
712                 new Long(groupId), new Long(userId),
713                 
714                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
715             };
716 
717         List<TasksProposal> list = (List<TasksProposal>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_G_U,
718                 finderArgs, this);
719 
720         if (list == null) {
721             Session session = null;
722 
723             try {
724                 session = openSession();
725 
726                 StringBundler query = null;
727 
728                 if (obc != null) {
729                     query = new StringBundler(4 +
730                             (obc.getOrderByFields().length * 3));
731                 }
732                 else {
733                     query = new StringBundler(4);
734                 }
735 
736                 query.append(_SQL_SELECT_TASKSPROPOSAL_WHERE);
737 
738                 query.append(_FINDER_COLUMN_G_U_GROUPID_2);
739 
740                 query.append(_FINDER_COLUMN_G_U_USERID_2);
741 
742                 if (obc != null) {
743                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
744                 }
745 
746                 else {
747                     query.append(TasksProposalModelImpl.ORDER_BY_JPQL);
748                 }
749 
750                 String sql = query.toString();
751 
752                 Query q = session.createQuery(sql);
753 
754                 QueryPos qPos = QueryPos.getInstance(q);
755 
756                 qPos.add(groupId);
757 
758                 qPos.add(userId);
759 
760                 list = (List<TasksProposal>)QueryUtil.list(q, getDialect(),
761                         start, end);
762             }
763             catch (Exception e) {
764                 throw processException(e);
765             }
766             finally {
767                 if (list == null) {
768                     list = new ArrayList<TasksProposal>();
769                 }
770 
771                 cacheResult(list);
772 
773                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_G_U,
774                     finderArgs, list);
775 
776                 closeSession(session);
777             }
778         }
779 
780         return list;
781     }
782 
783     public TasksProposal findByG_U_First(long groupId, long userId,
784         OrderByComparator obc) throws NoSuchProposalException, SystemException {
785         List<TasksProposal> list = findByG_U(groupId, userId, 0, 1, obc);
786 
787         if (list.isEmpty()) {
788             StringBundler msg = new StringBundler(6);
789 
790             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
791 
792             msg.append("groupId=");
793             msg.append(groupId);
794 
795             msg.append(", userId=");
796             msg.append(userId);
797 
798             msg.append(StringPool.CLOSE_CURLY_BRACE);
799 
800             throw new NoSuchProposalException(msg.toString());
801         }
802         else {
803             return list.get(0);
804         }
805     }
806 
807     public TasksProposal findByG_U_Last(long groupId, long userId,
808         OrderByComparator obc) throws NoSuchProposalException, SystemException {
809         int count = countByG_U(groupId, userId);
810 
811         List<TasksProposal> list = findByG_U(groupId, userId, count - 1, count,
812                 obc);
813 
814         if (list.isEmpty()) {
815             StringBundler msg = new StringBundler(6);
816 
817             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
818 
819             msg.append("groupId=");
820             msg.append(groupId);
821 
822             msg.append(", userId=");
823             msg.append(userId);
824 
825             msg.append(StringPool.CLOSE_CURLY_BRACE);
826 
827             throw new NoSuchProposalException(msg.toString());
828         }
829         else {
830             return list.get(0);
831         }
832     }
833 
834     public TasksProposal[] findByG_U_PrevAndNext(long proposalId, long groupId,
835         long userId, OrderByComparator obc)
836         throws NoSuchProposalException, SystemException {
837         TasksProposal tasksProposal = findByPrimaryKey(proposalId);
838 
839         int count = countByG_U(groupId, userId);
840 
841         Session session = null;
842 
843         try {
844             session = openSession();
845 
846             StringBundler query = null;
847 
848             if (obc != null) {
849                 query = new StringBundler(4 +
850                         (obc.getOrderByFields().length * 3));
851             }
852             else {
853                 query = new StringBundler(4);
854             }
855 
856             query.append(_SQL_SELECT_TASKSPROPOSAL_WHERE);
857 
858             query.append(_FINDER_COLUMN_G_U_GROUPID_2);
859 
860             query.append(_FINDER_COLUMN_G_U_USERID_2);
861 
862             if (obc != null) {
863                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
864             }
865 
866             else {
867                 query.append(TasksProposalModelImpl.ORDER_BY_JPQL);
868             }
869 
870             String sql = query.toString();
871 
872             Query q = session.createQuery(sql);
873 
874             QueryPos qPos = QueryPos.getInstance(q);
875 
876             qPos.add(groupId);
877 
878             qPos.add(userId);
879 
880             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
881                     tasksProposal);
882 
883             TasksProposal[] array = new TasksProposalImpl[3];
884 
885             array[0] = (TasksProposal)objArray[0];
886             array[1] = (TasksProposal)objArray[1];
887             array[2] = (TasksProposal)objArray[2];
888 
889             return array;
890         }
891         catch (Exception e) {
892             throw processException(e);
893         }
894         finally {
895             closeSession(session);
896         }
897     }
898 
899     public TasksProposal findByC_C(long classNameId, String classPK)
900         throws NoSuchProposalException, SystemException {
901         TasksProposal tasksProposal = fetchByC_C(classNameId, classPK);
902 
903         if (tasksProposal == null) {
904             StringBundler msg = new StringBundler(6);
905 
906             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
907 
908             msg.append("classNameId=");
909             msg.append(classNameId);
910 
911             msg.append(", classPK=");
912             msg.append(classPK);
913 
914             msg.append(StringPool.CLOSE_CURLY_BRACE);
915 
916             if (_log.isWarnEnabled()) {
917                 _log.warn(msg.toString());
918             }
919 
920             throw new NoSuchProposalException(msg.toString());
921         }
922 
923         return tasksProposal;
924     }
925 
926     public TasksProposal fetchByC_C(long classNameId, String classPK)
927         throws SystemException {
928         return fetchByC_C(classNameId, classPK, true);
929     }
930 
931     public TasksProposal fetchByC_C(long classNameId, String classPK,
932         boolean retrieveFromCache) throws SystemException {
933         Object[] finderArgs = new Object[] { new Long(classNameId), classPK };
934 
935         Object result = null;
936 
937         if (retrieveFromCache) {
938             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_C_C,
939                     finderArgs, this);
940         }
941 
942         if (result == null) {
943             Session session = null;
944 
945             try {
946                 session = openSession();
947 
948                 StringBundler query = new StringBundler(4);
949 
950                 query.append(_SQL_SELECT_TASKSPROPOSAL_WHERE);
951 
952                 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
953 
954                 if (classPK == null) {
955                     query.append(_FINDER_COLUMN_C_C_CLASSPK_1);
956                 }
957                 else {
958                     if (classPK.equals(StringPool.BLANK)) {
959                         query.append(_FINDER_COLUMN_C_C_CLASSPK_3);
960                     }
961                     else {
962                         query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
963                     }
964                 }
965 
966                 query.append(TasksProposalModelImpl.ORDER_BY_JPQL);
967 
968                 String sql = query.toString();
969 
970                 Query q = session.createQuery(sql);
971 
972                 QueryPos qPos = QueryPos.getInstance(q);
973 
974                 qPos.add(classNameId);
975 
976                 if (classPK != null) {
977                     qPos.add(classPK);
978                 }
979 
980                 List<TasksProposal> list = q.list();
981 
982                 result = list;
983 
984                 TasksProposal tasksProposal = null;
985 
986                 if (list.isEmpty()) {
987                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
988                         finderArgs, list);
989                 }
990                 else {
991                     tasksProposal = list.get(0);
992 
993                     cacheResult(tasksProposal);
994 
995                     if ((tasksProposal.getClassNameId() != classNameId) ||
996                             (tasksProposal.getClassPK() == null) ||
997                             !tasksProposal.getClassPK().equals(classPK)) {
998                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
999                             finderArgs, tasksProposal);
1000                    }
1001                }
1002
1003                return tasksProposal;
1004            }
1005            catch (Exception e) {
1006                throw processException(e);
1007            }
1008            finally {
1009                if (result == null) {
1010                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
1011                        finderArgs, new ArrayList<TasksProposal>());
1012                }
1013
1014                closeSession(session);
1015            }
1016        }
1017        else {
1018            if (result instanceof List<?>) {
1019                return null;
1020            }
1021            else {
1022                return (TasksProposal)result;
1023            }
1024        }
1025    }
1026
1027    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
1028        throws SystemException {
1029        Session session = null;
1030
1031        try {
1032            session = openSession();
1033
1034            dynamicQuery.compile(session);
1035
1036            return dynamicQuery.list();
1037        }
1038        catch (Exception e) {
1039            throw processException(e);
1040        }
1041        finally {
1042            closeSession(session);
1043        }
1044    }
1045
1046    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
1047        int start, int end) throws SystemException {
1048        Session session = null;
1049
1050        try {
1051            session = openSession();
1052
1053            dynamicQuery.setLimit(start, end);
1054
1055            dynamicQuery.compile(session);
1056
1057            return dynamicQuery.list();
1058        }
1059        catch (Exception e) {
1060            throw processException(e);
1061        }
1062        finally {
1063            closeSession(session);
1064        }
1065    }
1066
1067    public List<TasksProposal> findAll() throws SystemException {
1068        return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1069    }
1070
1071    public List<TasksProposal> findAll(int start, int end)
1072        throws SystemException {
1073        return findAll(start, end, null);
1074    }
1075
1076    public List<TasksProposal> findAll(int start, int end, OrderByComparator obc)
1077        throws SystemException {
1078        Object[] finderArgs = new Object[] {
1079                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1080            };
1081
1082        List<TasksProposal> list = (List<TasksProposal>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1083                finderArgs, this);
1084
1085        if (list == null) {
1086            Session session = null;
1087
1088            try {
1089                session = openSession();
1090
1091                StringBundler query = null;
1092                String sql = null;
1093
1094                if (obc != null) {
1095                    query = new StringBundler(2 +
1096                            (obc.getOrderByFields().length * 3));
1097
1098                    query.append(_SQL_SELECT_TASKSPROPOSAL);
1099
1100                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1101
1102                    sql = query.toString();
1103                }
1104
1105                else {
1106                    sql = _SQL_SELECT_TASKSPROPOSAL.concat(TasksProposalModelImpl.ORDER_BY_JPQL);
1107                }
1108
1109                Query q = session.createQuery(sql);
1110
1111                if (obc == null) {
1112                    list = (List<TasksProposal>)QueryUtil.list(q, getDialect(),
1113                            start, end, false);
1114
1115                    Collections.sort(list);
1116                }
1117                else {
1118                    list = (List<TasksProposal>)QueryUtil.list(q, getDialect(),
1119                            start, end);
1120                }
1121            }
1122            catch (Exception e) {
1123                throw processException(e);
1124            }
1125            finally {
1126                if (list == null) {
1127                    list = new ArrayList<TasksProposal>();
1128                }
1129
1130                cacheResult(list);
1131
1132                FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1133
1134                closeSession(session);
1135            }
1136        }
1137
1138        return list;
1139    }
1140
1141    public void removeByGroupId(long groupId) throws SystemException {
1142        for (TasksProposal tasksProposal : findByGroupId(groupId)) {
1143            remove(tasksProposal);
1144        }
1145    }
1146
1147    public void removeByG_U(long groupId, long userId)
1148        throws SystemException {
1149        for (TasksProposal tasksProposal : findByG_U(groupId, userId)) {
1150            remove(tasksProposal);
1151        }
1152    }
1153
1154    public void removeByC_C(long classNameId, String classPK)
1155        throws NoSuchProposalException, SystemException {
1156        TasksProposal tasksProposal = findByC_C(classNameId, classPK);
1157
1158        remove(tasksProposal);
1159    }
1160
1161    public void removeAll() throws SystemException {
1162        for (TasksProposal tasksProposal : findAll()) {
1163            remove(tasksProposal);
1164        }
1165    }
1166
1167    public int countByGroupId(long groupId) throws SystemException {
1168        Object[] finderArgs = new Object[] { new Long(groupId) };
1169
1170        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_GROUPID,
1171                finderArgs, this);
1172
1173        if (count == null) {
1174            Session session = null;
1175
1176            try {
1177                session = openSession();
1178
1179                StringBundler query = new StringBundler(2);
1180
1181                query.append(_SQL_COUNT_TASKSPROPOSAL_WHERE);
1182
1183                query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
1184
1185                String sql = query.toString();
1186
1187                Query q = session.createQuery(sql);
1188
1189                QueryPos qPos = QueryPos.getInstance(q);
1190
1191                qPos.add(groupId);
1192
1193                count = (Long)q.uniqueResult();
1194            }
1195            catch (Exception e) {
1196                throw processException(e);
1197            }
1198            finally {
1199                if (count == null) {
1200                    count = Long.valueOf(0);
1201                }
1202
1203                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_GROUPID,
1204                    finderArgs, count);
1205
1206                closeSession(session);
1207            }
1208        }
1209
1210        return count.intValue();
1211    }
1212
1213    public int countByG_U(long groupId, long userId) throws SystemException {
1214        Object[] finderArgs = new Object[] { new Long(groupId), new Long(userId) };
1215
1216        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_U,
1217                finderArgs, this);
1218
1219        if (count == null) {
1220            Session session = null;
1221
1222            try {
1223                session = openSession();
1224
1225                StringBundler query = new StringBundler(3);
1226
1227                query.append(_SQL_COUNT_TASKSPROPOSAL_WHERE);
1228
1229                query.append(_FINDER_COLUMN_G_U_GROUPID_2);
1230
1231                query.append(_FINDER_COLUMN_G_U_USERID_2);
1232
1233                String sql = query.toString();
1234
1235                Query q = session.createQuery(sql);
1236
1237                QueryPos qPos = QueryPos.getInstance(q);
1238
1239                qPos.add(groupId);
1240
1241                qPos.add(userId);
1242
1243                count = (Long)q.uniqueResult();
1244            }
1245            catch (Exception e) {
1246                throw processException(e);
1247            }
1248            finally {
1249                if (count == null) {
1250                    count = Long.valueOf(0);
1251                }
1252
1253                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_U, finderArgs,
1254                    count);
1255
1256                closeSession(session);
1257            }
1258        }
1259
1260        return count.intValue();
1261    }
1262
1263    public int countByC_C(long classNameId, String classPK)
1264        throws SystemException {
1265        Object[] finderArgs = new Object[] { new Long(classNameId), classPK };
1266
1267        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C,
1268                finderArgs, this);
1269
1270        if (count == null) {
1271            Session session = null;
1272
1273            try {
1274                session = openSession();
1275
1276                StringBundler query = new StringBundler(3);
1277
1278                query.append(_SQL_COUNT_TASKSPROPOSAL_WHERE);
1279
1280                query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
1281
1282                if (classPK == null) {
1283                    query.append(_FINDER_COLUMN_C_C_CLASSPK_1);
1284                }
1285                else {
1286                    if (classPK.equals(StringPool.BLANK)) {
1287                        query.append(_FINDER_COLUMN_C_C_CLASSPK_3);
1288                    }
1289                    else {
1290                        query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
1291                    }
1292                }
1293
1294                String sql = query.toString();
1295
1296                Query q = session.createQuery(sql);
1297
1298                QueryPos qPos = QueryPos.getInstance(q);
1299
1300                qPos.add(classNameId);
1301
1302                if (classPK != null) {
1303                    qPos.add(classPK);
1304                }
1305
1306                count = (Long)q.uniqueResult();
1307            }
1308            catch (Exception e) {
1309                throw processException(e);
1310            }
1311            finally {
1312                if (count == null) {
1313                    count = Long.valueOf(0);
1314                }
1315
1316                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, finderArgs,
1317                    count);
1318
1319                closeSession(session);
1320            }
1321        }
1322
1323        return count.intValue();
1324    }
1325
1326    public int countAll() throws SystemException {
1327        Object[] finderArgs = new Object[0];
1328
1329        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1330                finderArgs, this);
1331
1332        if (count == null) {
1333            Session session = null;
1334
1335            try {
1336                session = openSession();
1337
1338                Query q = session.createQuery(_SQL_COUNT_TASKSPROPOSAL);
1339
1340                count = (Long)q.uniqueResult();
1341            }
1342            catch (Exception e) {
1343                throw processException(e);
1344            }
1345            finally {
1346                if (count == null) {
1347                    count = Long.valueOf(0);
1348                }
1349
1350                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1351                    count);
1352
1353                closeSession(session);
1354            }
1355        }
1356
1357        return count.intValue();
1358    }
1359
1360    public void afterPropertiesSet() {
1361        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1362                    com.liferay.portal.util.PropsUtil.get(
1363                        "value.object.listener.com.liferay.portlet.tasks.model.TasksProposal")));
1364
1365        if (listenerClassNames.length > 0) {
1366            try {
1367                List<ModelListener<TasksProposal>> listenersList = new ArrayList<ModelListener<TasksProposal>>();
1368
1369                for (String listenerClassName : listenerClassNames) {
1370                    listenersList.add((ModelListener<TasksProposal>)Class.forName(
1371                            listenerClassName).newInstance());
1372                }
1373
1374                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1375            }
1376            catch (Exception e) {
1377                _log.error(e);
1378            }
1379        }
1380    }
1381
1382    @BeanReference(name = "com.liferay.portlet.tasks.service.persistence.TasksProposalPersistence")
1383    protected com.liferay.portlet.tasks.service.persistence.TasksProposalPersistence tasksProposalPersistence;
1384    @BeanReference(name = "com.liferay.portlet.tasks.service.persistence.TasksReviewPersistence")
1385    protected com.liferay.portlet.tasks.service.persistence.TasksReviewPersistence tasksReviewPersistence;
1386    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
1387    protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
1388    @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
1389    protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
1390    @BeanReference(name = "com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence")
1391    protected com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence mbMessagePersistence;
1392    @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityPersistence")
1393    protected com.liferay.portlet.social.service.persistence.SocialActivityPersistence socialActivityPersistence;
1394    private static final String _SQL_SELECT_TASKSPROPOSAL = "SELECT tasksProposal FROM TasksProposal tasksProposal";
1395    private static final String _SQL_SELECT_TASKSPROPOSAL_WHERE = "SELECT tasksProposal FROM TasksProposal tasksProposal WHERE ";
1396    private static final String _SQL_COUNT_TASKSPROPOSAL = "SELECT COUNT(tasksProposal) FROM TasksProposal tasksProposal";
1397    private static final String _SQL_COUNT_TASKSPROPOSAL_WHERE = "SELECT COUNT(tasksProposal) FROM TasksProposal tasksProposal WHERE ";
1398    private static final String _FINDER_COLUMN_GROUPID_GROUPID_2 = "tasksProposal.groupId = ?";
1399    private static final String _FINDER_COLUMN_G_U_GROUPID_2 = "tasksProposal.groupId = ? AND ";
1400    private static final String _FINDER_COLUMN_G_U_USERID_2 = "tasksProposal.userId = ?";
1401    private static final String _FINDER_COLUMN_C_C_CLASSNAMEID_2 = "tasksProposal.classNameId = ? AND ";
1402    private static final String _FINDER_COLUMN_C_C_CLASSPK_1 = "tasksProposal.classPK IS NULL";
1403    private static final String _FINDER_COLUMN_C_C_CLASSPK_2 = "tasksProposal.classPK = ?";
1404    private static final String _FINDER_COLUMN_C_C_CLASSPK_3 = "(tasksProposal.classPK IS NULL OR tasksProposal.classPK = ?)";
1405    private static final String _ORDER_BY_ENTITY_ALIAS = "tasksProposal.";
1406    private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No TasksProposal exists with the primary key ";
1407    private static final String _NO_SUCH_ENTITY_WITH_KEY = "No TasksProposal exists with the key {";
1408    private static Log _log = LogFactoryUtil.getLog(TasksProposalPersistenceImpl.class);
1409}