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