001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.NoSuchModelException;
018    import com.liferay.portal.NoSuchTicketException;
019    import com.liferay.portal.kernel.annotation.BeanReference;
020    import com.liferay.portal.kernel.cache.CacheRegistryUtil;
021    import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022    import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
023    import com.liferay.portal.kernel.dao.orm.FinderPath;
024    import com.liferay.portal.kernel.dao.orm.Query;
025    import com.liferay.portal.kernel.dao.orm.QueryPos;
026    import com.liferay.portal.kernel.dao.orm.QueryUtil;
027    import com.liferay.portal.kernel.dao.orm.Session;
028    import com.liferay.portal.kernel.exception.SystemException;
029    import com.liferay.portal.kernel.log.Log;
030    import com.liferay.portal.kernel.log.LogFactoryUtil;
031    import com.liferay.portal.kernel.util.GetterUtil;
032    import com.liferay.portal.kernel.util.InstanceFactory;
033    import com.liferay.portal.kernel.util.OrderByComparator;
034    import com.liferay.portal.kernel.util.StringBundler;
035    import com.liferay.portal.kernel.util.StringPool;
036    import com.liferay.portal.kernel.util.StringUtil;
037    import com.liferay.portal.kernel.util.Validator;
038    import com.liferay.portal.model.ModelListener;
039    import com.liferay.portal.model.Ticket;
040    import com.liferay.portal.model.impl.TicketImpl;
041    import com.liferay.portal.model.impl.TicketModelImpl;
042    import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
043    
044    import java.io.Serializable;
045    
046    import java.util.ArrayList;
047    import java.util.Collections;
048    import java.util.List;
049    
050    /**
051     * @author    Brian Wing Shun Chan
052     * @see       TicketPersistence
053     * @see       TicketUtil
054     * @generated
055     */
056    public class TicketPersistenceImpl extends BasePersistenceImpl<Ticket>
057            implements TicketPersistence {
058            public static final String FINDER_CLASS_NAME_ENTITY = TicketImpl.class.getName();
059            public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
060                    ".List";
061            public static final FinderPath FINDER_PATH_FETCH_BY_KEY = new FinderPath(TicketModelImpl.ENTITY_CACHE_ENABLED,
062                            TicketModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_ENTITY,
063                            "fetchByKey", new String[] { String.class.getName() });
064            public static final FinderPath FINDER_PATH_COUNT_BY_KEY = new FinderPath(TicketModelImpl.ENTITY_CACHE_ENABLED,
065                            TicketModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
066                            "countByKey", new String[] { String.class.getName() });
067            public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(TicketModelImpl.ENTITY_CACHE_ENABLED,
068                            TicketModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
069                            "findAll", new String[0]);
070            public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(TicketModelImpl.ENTITY_CACHE_ENABLED,
071                            TicketModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
072                            "countAll", new String[0]);
073    
074            public void cacheResult(Ticket ticket) {
075                    EntityCacheUtil.putResult(TicketModelImpl.ENTITY_CACHE_ENABLED,
076                            TicketImpl.class, ticket.getPrimaryKey(), ticket);
077    
078                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_KEY,
079                            new Object[] { ticket.getKey() }, ticket);
080            }
081    
082            public void cacheResult(List<Ticket> tickets) {
083                    for (Ticket ticket : tickets) {
084                            if (EntityCacheUtil.getResult(
085                                                    TicketModelImpl.ENTITY_CACHE_ENABLED, TicketImpl.class,
086                                                    ticket.getPrimaryKey(), this) == null) {
087                                    cacheResult(ticket);
088                            }
089                    }
090            }
091    
092            public void clearCache() {
093                    CacheRegistryUtil.clear(TicketImpl.class.getName());
094                    EntityCacheUtil.clearCache(TicketImpl.class.getName());
095                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
096                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
097            }
098    
099            public void clearCache(Ticket ticket) {
100                    EntityCacheUtil.removeResult(TicketModelImpl.ENTITY_CACHE_ENABLED,
101                            TicketImpl.class, ticket.getPrimaryKey());
102    
103                    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_KEY,
104                            new Object[] { ticket.getKey() });
105            }
106    
107            public Ticket create(long ticketId) {
108                    Ticket ticket = new TicketImpl();
109    
110                    ticket.setNew(true);
111                    ticket.setPrimaryKey(ticketId);
112    
113                    return ticket;
114            }
115    
116            public Ticket remove(Serializable primaryKey)
117                    throws NoSuchModelException, SystemException {
118                    return remove(((Long)primaryKey).longValue());
119            }
120    
121            public Ticket remove(long ticketId)
122                    throws NoSuchTicketException, SystemException {
123                    Session session = null;
124    
125                    try {
126                            session = openSession();
127    
128                            Ticket ticket = (Ticket)session.get(TicketImpl.class,
129                                            new Long(ticketId));
130    
131                            if (ticket == null) {
132                                    if (_log.isWarnEnabled()) {
133                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + ticketId);
134                                    }
135    
136                                    throw new NoSuchTicketException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
137                                            ticketId);
138                            }
139    
140                            return remove(ticket);
141                    }
142                    catch (NoSuchTicketException nsee) {
143                            throw nsee;
144                    }
145                    catch (Exception e) {
146                            throw processException(e);
147                    }
148                    finally {
149                            closeSession(session);
150                    }
151            }
152    
153            protected Ticket removeImpl(Ticket ticket) throws SystemException {
154                    ticket = toUnwrappedModel(ticket);
155    
156                    Session session = null;
157    
158                    try {
159                            session = openSession();
160    
161                            if (ticket.isCachedModel() || BatchSessionUtil.isEnabled()) {
162                                    Object staleObject = session.get(TicketImpl.class,
163                                                    ticket.getPrimaryKeyObj());
164    
165                                    if (staleObject != null) {
166                                            session.evict(staleObject);
167                                    }
168                            }
169    
170                            session.delete(ticket);
171    
172                            session.flush();
173                    }
174                    catch (Exception e) {
175                            throw processException(e);
176                    }
177                    finally {
178                            closeSession(session);
179                    }
180    
181                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
182    
183                    TicketModelImpl ticketModelImpl = (TicketModelImpl)ticket;
184    
185                    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_KEY,
186                            new Object[] { ticketModelImpl.getOriginalKey() });
187    
188                    EntityCacheUtil.removeResult(TicketModelImpl.ENTITY_CACHE_ENABLED,
189                            TicketImpl.class, ticket.getPrimaryKey());
190    
191                    return ticket;
192            }
193    
194            public Ticket updateImpl(com.liferay.portal.model.Ticket ticket,
195                    boolean merge) throws SystemException {
196                    ticket = toUnwrappedModel(ticket);
197    
198                    boolean isNew = ticket.isNew();
199    
200                    TicketModelImpl ticketModelImpl = (TicketModelImpl)ticket;
201    
202                    Session session = null;
203    
204                    try {
205                            session = openSession();
206    
207                            BatchSessionUtil.update(session, ticket, merge);
208    
209                            ticket.setNew(false);
210                    }
211                    catch (Exception e) {
212                            throw processException(e);
213                    }
214                    finally {
215                            closeSession(session);
216                    }
217    
218                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
219    
220                    EntityCacheUtil.putResult(TicketModelImpl.ENTITY_CACHE_ENABLED,
221                            TicketImpl.class, ticket.getPrimaryKey(), ticket);
222    
223                    if (!isNew &&
224                                    (!Validator.equals(ticket.getKey(),
225                                            ticketModelImpl.getOriginalKey()))) {
226                            FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_KEY,
227                                    new Object[] { ticketModelImpl.getOriginalKey() });
228                    }
229    
230                    if (isNew ||
231                                    (!Validator.equals(ticket.getKey(),
232                                            ticketModelImpl.getOriginalKey()))) {
233                            FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_KEY,
234                                    new Object[] { ticket.getKey() }, ticket);
235                    }
236    
237                    return ticket;
238            }
239    
240            protected Ticket toUnwrappedModel(Ticket ticket) {
241                    if (ticket instanceof TicketImpl) {
242                            return ticket;
243                    }
244    
245                    TicketImpl ticketImpl = new TicketImpl();
246    
247                    ticketImpl.setNew(ticket.isNew());
248                    ticketImpl.setPrimaryKey(ticket.getPrimaryKey());
249    
250                    ticketImpl.setTicketId(ticket.getTicketId());
251                    ticketImpl.setCompanyId(ticket.getCompanyId());
252                    ticketImpl.setCreateDate(ticket.getCreateDate());
253                    ticketImpl.setClassNameId(ticket.getClassNameId());
254                    ticketImpl.setClassPK(ticket.getClassPK());
255                    ticketImpl.setKey(ticket.getKey());
256                    ticketImpl.setExpirationDate(ticket.getExpirationDate());
257    
258                    return ticketImpl;
259            }
260    
261            public Ticket findByPrimaryKey(Serializable primaryKey)
262                    throws NoSuchModelException, SystemException {
263                    return findByPrimaryKey(((Long)primaryKey).longValue());
264            }
265    
266            public Ticket findByPrimaryKey(long ticketId)
267                    throws NoSuchTicketException, SystemException {
268                    Ticket ticket = fetchByPrimaryKey(ticketId);
269    
270                    if (ticket == null) {
271                            if (_log.isWarnEnabled()) {
272                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + ticketId);
273                            }
274    
275                            throw new NoSuchTicketException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
276                                    ticketId);
277                    }
278    
279                    return ticket;
280            }
281    
282            public Ticket fetchByPrimaryKey(Serializable primaryKey)
283                    throws SystemException {
284                    return fetchByPrimaryKey(((Long)primaryKey).longValue());
285            }
286    
287            public Ticket fetchByPrimaryKey(long ticketId) throws SystemException {
288                    Ticket ticket = (Ticket)EntityCacheUtil.getResult(TicketModelImpl.ENTITY_CACHE_ENABLED,
289                                    TicketImpl.class, ticketId, this);
290    
291                    if (ticket == null) {
292                            Session session = null;
293    
294                            try {
295                                    session = openSession();
296    
297                                    ticket = (Ticket)session.get(TicketImpl.class,
298                                                    new Long(ticketId));
299                            }
300                            catch (Exception e) {
301                                    throw processException(e);
302                            }
303                            finally {
304                                    if (ticket != null) {
305                                            cacheResult(ticket);
306                                    }
307    
308                                    closeSession(session);
309                            }
310                    }
311    
312                    return ticket;
313            }
314    
315            public Ticket findByKey(String key)
316                    throws NoSuchTicketException, SystemException {
317                    Ticket ticket = fetchByKey(key);
318    
319                    if (ticket == null) {
320                            StringBundler msg = new StringBundler(4);
321    
322                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
323    
324                            msg.append("key=");
325                            msg.append(key);
326    
327                            msg.append(StringPool.CLOSE_CURLY_BRACE);
328    
329                            if (_log.isWarnEnabled()) {
330                                    _log.warn(msg.toString());
331                            }
332    
333                            throw new NoSuchTicketException(msg.toString());
334                    }
335    
336                    return ticket;
337            }
338    
339            public Ticket fetchByKey(String key) throws SystemException {
340                    return fetchByKey(key, true);
341            }
342    
343            public Ticket fetchByKey(String key, boolean retrieveFromCache)
344                    throws SystemException {
345                    Object[] finderArgs = new Object[] { key };
346    
347                    Object result = null;
348    
349                    if (retrieveFromCache) {
350                            result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_KEY,
351                                            finderArgs, this);
352                    }
353    
354                    if (result == null) {
355                            Session session = null;
356    
357                            try {
358                                    session = openSession();
359    
360                                    StringBundler query = new StringBundler(3);
361    
362                                    query.append(_SQL_SELECT_TICKET_WHERE);
363    
364                                    if (key == null) {
365                                            query.append(_FINDER_COLUMN_KEY_KEY_1);
366                                    }
367                                    else {
368                                            if (key.equals(StringPool.BLANK)) {
369                                                    query.append(_FINDER_COLUMN_KEY_KEY_3);
370                                            }
371                                            else {
372                                                    query.append(_FINDER_COLUMN_KEY_KEY_2);
373                                            }
374                                    }
375    
376                                    query.append(TicketModelImpl.ORDER_BY_JPQL);
377    
378                                    String sql = query.toString();
379    
380                                    Query q = session.createQuery(sql);
381    
382                                    QueryPos qPos = QueryPos.getInstance(q);
383    
384                                    if (key != null) {
385                                            qPos.add(key);
386                                    }
387    
388                                    List<Ticket> list = q.list();
389    
390                                    result = list;
391    
392                                    Ticket ticket = null;
393    
394                                    if (list.isEmpty()) {
395                                            FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_KEY,
396                                                    finderArgs, list);
397                                    }
398                                    else {
399                                            ticket = list.get(0);
400    
401                                            cacheResult(ticket);
402    
403                                            if ((ticket.getKey() == null) ||
404                                                            !ticket.getKey().equals(key)) {
405                                                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_KEY,
406                                                            finderArgs, ticket);
407                                            }
408                                    }
409    
410                                    return ticket;
411                            }
412                            catch (Exception e) {
413                                    throw processException(e);
414                            }
415                            finally {
416                                    if (result == null) {
417                                            FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_KEY,
418                                                    finderArgs, new ArrayList<Ticket>());
419                                    }
420    
421                                    closeSession(session);
422                            }
423                    }
424                    else {
425                            if (result instanceof List<?>) {
426                                    return null;
427                            }
428                            else {
429                                    return (Ticket)result;
430                            }
431                    }
432            }
433    
434            public List<Ticket> findAll() throws SystemException {
435                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
436            }
437    
438            public List<Ticket> findAll(int start, int end) throws SystemException {
439                    return findAll(start, end, null);
440            }
441    
442            public List<Ticket> findAll(int start, int end,
443                    OrderByComparator orderByComparator) throws SystemException {
444                    Object[] finderArgs = new Object[] {
445                                    String.valueOf(start), String.valueOf(end),
446                                    String.valueOf(orderByComparator)
447                            };
448    
449                    List<Ticket> list = (List<Ticket>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
450                                    finderArgs, this);
451    
452                    if (list == null) {
453                            Session session = null;
454    
455                            try {
456                                    session = openSession();
457    
458                                    StringBundler query = null;
459                                    String sql = null;
460    
461                                    if (orderByComparator != null) {
462                                            query = new StringBundler(2 +
463                                                            (orderByComparator.getOrderByFields().length * 3));
464    
465                                            query.append(_SQL_SELECT_TICKET);
466    
467                                            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
468                                                    orderByComparator);
469    
470                                            sql = query.toString();
471                                    }
472                                    else {
473                                            sql = _SQL_SELECT_TICKET.concat(TicketModelImpl.ORDER_BY_JPQL);
474                                    }
475    
476                                    Query q = session.createQuery(sql);
477    
478                                    if (orderByComparator == null) {
479                                            list = (List<Ticket>)QueryUtil.list(q, getDialect(), start,
480                                                            end, false);
481    
482                                            Collections.sort(list);
483                                    }
484                                    else {
485                                            list = (List<Ticket>)QueryUtil.list(q, getDialect(), start,
486                                                            end);
487                                    }
488                            }
489                            catch (Exception e) {
490                                    throw processException(e);
491                            }
492                            finally {
493                                    if (list == null) {
494                                            list = new ArrayList<Ticket>();
495                                    }
496    
497                                    cacheResult(list);
498    
499                                    FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
500    
501                                    closeSession(session);
502                            }
503                    }
504    
505                    return list;
506            }
507    
508            public void removeByKey(String key)
509                    throws NoSuchTicketException, SystemException {
510                    Ticket ticket = findByKey(key);
511    
512                    remove(ticket);
513            }
514    
515            public void removeAll() throws SystemException {
516                    for (Ticket ticket : findAll()) {
517                            remove(ticket);
518                    }
519            }
520    
521            public int countByKey(String key) throws SystemException {
522                    Object[] finderArgs = new Object[] { key };
523    
524                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_KEY,
525                                    finderArgs, this);
526    
527                    if (count == null) {
528                            Session session = null;
529    
530                            try {
531                                    session = openSession();
532    
533                                    StringBundler query = new StringBundler(2);
534    
535                                    query.append(_SQL_COUNT_TICKET_WHERE);
536    
537                                    if (key == null) {
538                                            query.append(_FINDER_COLUMN_KEY_KEY_1);
539                                    }
540                                    else {
541                                            if (key.equals(StringPool.BLANK)) {
542                                                    query.append(_FINDER_COLUMN_KEY_KEY_3);
543                                            }
544                                            else {
545                                                    query.append(_FINDER_COLUMN_KEY_KEY_2);
546                                            }
547                                    }
548    
549                                    String sql = query.toString();
550    
551                                    Query q = session.createQuery(sql);
552    
553                                    QueryPos qPos = QueryPos.getInstance(q);
554    
555                                    if (key != null) {
556                                            qPos.add(key);
557                                    }
558    
559                                    count = (Long)q.uniqueResult();
560                            }
561                            catch (Exception e) {
562                                    throw processException(e);
563                            }
564                            finally {
565                                    if (count == null) {
566                                            count = Long.valueOf(0);
567                                    }
568    
569                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_KEY, finderArgs,
570                                            count);
571    
572                                    closeSession(session);
573                            }
574                    }
575    
576                    return count.intValue();
577            }
578    
579            public int countAll() throws SystemException {
580                    Object[] finderArgs = new Object[0];
581    
582                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
583                                    finderArgs, this);
584    
585                    if (count == null) {
586                            Session session = null;
587    
588                            try {
589                                    session = openSession();
590    
591                                    Query q = session.createQuery(_SQL_COUNT_TICKET);
592    
593                                    count = (Long)q.uniqueResult();
594                            }
595                            catch (Exception e) {
596                                    throw processException(e);
597                            }
598                            finally {
599                                    if (count == null) {
600                                            count = Long.valueOf(0);
601                                    }
602    
603                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
604                                            count);
605    
606                                    closeSession(session);
607                            }
608                    }
609    
610                    return count.intValue();
611            }
612    
613            public void afterPropertiesSet() {
614                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
615                                            com.liferay.portal.util.PropsUtil.get(
616                                                    "value.object.listener.com.liferay.portal.model.Ticket")));
617    
618                    if (listenerClassNames.length > 0) {
619                            try {
620                                    List<ModelListener<Ticket>> listenersList = new ArrayList<ModelListener<Ticket>>();
621    
622                                    for (String listenerClassName : listenerClassNames) {
623                                            listenersList.add((ModelListener<Ticket>)InstanceFactory.newInstance(
624                                                            listenerClassName));
625                                    }
626    
627                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
628                            }
629                            catch (Exception e) {
630                                    _log.error(e);
631                            }
632                    }
633            }
634    
635            @BeanReference(type = AccountPersistence.class)
636            protected AccountPersistence accountPersistence;
637            @BeanReference(type = AddressPersistence.class)
638            protected AddressPersistence addressPersistence;
639            @BeanReference(type = BrowserTrackerPersistence.class)
640            protected BrowserTrackerPersistence browserTrackerPersistence;
641            @BeanReference(type = ClassNamePersistence.class)
642            protected ClassNamePersistence classNamePersistence;
643            @BeanReference(type = CompanyPersistence.class)
644            protected CompanyPersistence companyPersistence;
645            @BeanReference(type = ContactPersistence.class)
646            protected ContactPersistence contactPersistence;
647            @BeanReference(type = CountryPersistence.class)
648            protected CountryPersistence countryPersistence;
649            @BeanReference(type = EmailAddressPersistence.class)
650            protected EmailAddressPersistence emailAddressPersistence;
651            @BeanReference(type = GroupPersistence.class)
652            protected GroupPersistence groupPersistence;
653            @BeanReference(type = ImagePersistence.class)
654            protected ImagePersistence imagePersistence;
655            @BeanReference(type = LayoutPersistence.class)
656            protected LayoutPersistence layoutPersistence;
657            @BeanReference(type = LayoutPrototypePersistence.class)
658            protected LayoutPrototypePersistence layoutPrototypePersistence;
659            @BeanReference(type = LayoutSetPersistence.class)
660            protected LayoutSetPersistence layoutSetPersistence;
661            @BeanReference(type = LayoutSetPrototypePersistence.class)
662            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
663            @BeanReference(type = ListTypePersistence.class)
664            protected ListTypePersistence listTypePersistence;
665            @BeanReference(type = LockPersistence.class)
666            protected LockPersistence lockPersistence;
667            @BeanReference(type = MembershipRequestPersistence.class)
668            protected MembershipRequestPersistence membershipRequestPersistence;
669            @BeanReference(type = OrganizationPersistence.class)
670            protected OrganizationPersistence organizationPersistence;
671            @BeanReference(type = OrgGroupPermissionPersistence.class)
672            protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
673            @BeanReference(type = OrgGroupRolePersistence.class)
674            protected OrgGroupRolePersistence orgGroupRolePersistence;
675            @BeanReference(type = OrgLaborPersistence.class)
676            protected OrgLaborPersistence orgLaborPersistence;
677            @BeanReference(type = PasswordPolicyPersistence.class)
678            protected PasswordPolicyPersistence passwordPolicyPersistence;
679            @BeanReference(type = PasswordPolicyRelPersistence.class)
680            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
681            @BeanReference(type = PasswordTrackerPersistence.class)
682            protected PasswordTrackerPersistence passwordTrackerPersistence;
683            @BeanReference(type = PermissionPersistence.class)
684            protected PermissionPersistence permissionPersistence;
685            @BeanReference(type = PhonePersistence.class)
686            protected PhonePersistence phonePersistence;
687            @BeanReference(type = PluginSettingPersistence.class)
688            protected PluginSettingPersistence pluginSettingPersistence;
689            @BeanReference(type = PortletPersistence.class)
690            protected PortletPersistence portletPersistence;
691            @BeanReference(type = PortletItemPersistence.class)
692            protected PortletItemPersistence portletItemPersistence;
693            @BeanReference(type = PortletPreferencesPersistence.class)
694            protected PortletPreferencesPersistence portletPreferencesPersistence;
695            @BeanReference(type = RegionPersistence.class)
696            protected RegionPersistence regionPersistence;
697            @BeanReference(type = ReleasePersistence.class)
698            protected ReleasePersistence releasePersistence;
699            @BeanReference(type = ResourcePersistence.class)
700            protected ResourcePersistence resourcePersistence;
701            @BeanReference(type = ResourceActionPersistence.class)
702            protected ResourceActionPersistence resourceActionPersistence;
703            @BeanReference(type = ResourceCodePersistence.class)
704            protected ResourceCodePersistence resourceCodePersistence;
705            @BeanReference(type = ResourcePermissionPersistence.class)
706            protected ResourcePermissionPersistence resourcePermissionPersistence;
707            @BeanReference(type = RolePersistence.class)
708            protected RolePersistence rolePersistence;
709            @BeanReference(type = ServiceComponentPersistence.class)
710            protected ServiceComponentPersistence serviceComponentPersistence;
711            @BeanReference(type = ShardPersistence.class)
712            protected ShardPersistence shardPersistence;
713            @BeanReference(type = SubscriptionPersistence.class)
714            protected SubscriptionPersistence subscriptionPersistence;
715            @BeanReference(type = TicketPersistence.class)
716            protected TicketPersistence ticketPersistence;
717            @BeanReference(type = TeamPersistence.class)
718            protected TeamPersistence teamPersistence;
719            @BeanReference(type = UserPersistence.class)
720            protected UserPersistence userPersistence;
721            @BeanReference(type = UserGroupPersistence.class)
722            protected UserGroupPersistence userGroupPersistence;
723            @BeanReference(type = UserGroupGroupRolePersistence.class)
724            protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
725            @BeanReference(type = UserGroupRolePersistence.class)
726            protected UserGroupRolePersistence userGroupRolePersistence;
727            @BeanReference(type = UserIdMapperPersistence.class)
728            protected UserIdMapperPersistence userIdMapperPersistence;
729            @BeanReference(type = UserTrackerPersistence.class)
730            protected UserTrackerPersistence userTrackerPersistence;
731            @BeanReference(type = UserTrackerPathPersistence.class)
732            protected UserTrackerPathPersistence userTrackerPathPersistence;
733            @BeanReference(type = WebDAVPropsPersistence.class)
734            protected WebDAVPropsPersistence webDAVPropsPersistence;
735            @BeanReference(type = WebsitePersistence.class)
736            protected WebsitePersistence websitePersistence;
737            @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
738            protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
739            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
740            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
741            private static final String _SQL_SELECT_TICKET = "SELECT ticket FROM Ticket ticket";
742            private static final String _SQL_SELECT_TICKET_WHERE = "SELECT ticket FROM Ticket ticket WHERE ";
743            private static final String _SQL_COUNT_TICKET = "SELECT COUNT(ticket) FROM Ticket ticket";
744            private static final String _SQL_COUNT_TICKET_WHERE = "SELECT COUNT(ticket) FROM Ticket ticket WHERE ";
745            private static final String _FINDER_COLUMN_KEY_KEY_1 = "ticket.key IS NULL";
746            private static final String _FINDER_COLUMN_KEY_KEY_2 = "ticket.key = ?";
747            private static final String _FINDER_COLUMN_KEY_KEY_3 = "(ticket.key IS NULL OR ticket.key = ?)";
748            private static final String _ORDER_BY_ENTITY_ALIAS = "ticket.";
749            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Ticket exists with the primary key ";
750            private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Ticket exists with the key {";
751            private static Log _log = LogFactoryUtil.getLog(TicketPersistenceImpl.class);
752    }