001    /**
002     * Copyright (c) 2000-2013 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.exception.SystemException;
022    import com.liferay.portal.kernel.util.OrderByComparator;
023    import com.liferay.portal.kernel.util.ReferenceRegistry;
024    import com.liferay.portal.model.Ticket;
025    import com.liferay.portal.service.ServiceContext;
026    
027    import java.util.List;
028    
029    /**
030     * The persistence utility for the ticket service. This utility wraps {@link TicketPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
031     *
032     * <p>
033     * Caching information and settings can be found in <code>portal.properties</code>
034     * </p>
035     *
036     * @author Brian Wing Shun Chan
037     * @see TicketPersistence
038     * @see TicketPersistenceImpl
039     * @generated
040     */
041    @ProviderType
042    public class TicketUtil {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
047             */
048    
049            /**
050             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
051             */
052            public static void clearCache() {
053                    getPersistence().clearCache();
054            }
055    
056            /**
057             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
058             */
059            public static void clearCache(Ticket ticket) {
060                    getPersistence().clearCache(ticket);
061            }
062    
063            /**
064             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
065             */
066            public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
067                    throws SystemException {
068                    return getPersistence().countWithDynamicQuery(dynamicQuery);
069            }
070    
071            /**
072             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
073             */
074            public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery)
075                    throws SystemException {
076                    return getPersistence().findWithDynamicQuery(dynamicQuery);
077            }
078    
079            /**
080             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
081             */
082            public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery,
083                    int start, int end) throws SystemException {
084                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
085            }
086    
087            /**
088             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
089             */
090            public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery,
091                    int start, int end, OrderByComparator orderByComparator)
092                    throws SystemException {
093                    return getPersistence()
094                                       .findWithDynamicQuery(dynamicQuery, start, end,
095                            orderByComparator);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
100             */
101            public static Ticket update(Ticket ticket) throws SystemException {
102                    return getPersistence().update(ticket);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static Ticket update(Ticket ticket, ServiceContext serviceContext)
109                    throws SystemException {
110                    return getPersistence().update(ticket, serviceContext);
111            }
112    
113            /**
114            * Returns the ticket where key = &#63; or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
115            *
116            * @param key the key
117            * @return the matching ticket
118            * @throws com.liferay.portal.NoSuchTicketException if a matching ticket could not be found
119            * @throws SystemException if a system exception occurred
120            */
121            public static com.liferay.portal.model.Ticket findByKey(
122                    java.lang.String key)
123                    throws com.liferay.portal.NoSuchTicketException,
124                            com.liferay.portal.kernel.exception.SystemException {
125                    return getPersistence().findByKey(key);
126            }
127    
128            /**
129            * Returns the ticket where key = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
130            *
131            * @param key the key
132            * @return the matching ticket, or <code>null</code> if a matching ticket could not be found
133            * @throws SystemException if a system exception occurred
134            */
135            public static com.liferay.portal.model.Ticket fetchByKey(
136                    java.lang.String key)
137                    throws com.liferay.portal.kernel.exception.SystemException {
138                    return getPersistence().fetchByKey(key);
139            }
140    
141            /**
142            * Returns the ticket where key = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
143            *
144            * @param key the key
145            * @param retrieveFromCache whether to use the finder cache
146            * @return the matching ticket, or <code>null</code> if a matching ticket could not be found
147            * @throws SystemException if a system exception occurred
148            */
149            public static com.liferay.portal.model.Ticket fetchByKey(
150                    java.lang.String key, boolean retrieveFromCache)
151                    throws com.liferay.portal.kernel.exception.SystemException {
152                    return getPersistence().fetchByKey(key, retrieveFromCache);
153            }
154    
155            /**
156            * Removes the ticket where key = &#63; from the database.
157            *
158            * @param key the key
159            * @return the ticket that was removed
160            * @throws SystemException if a system exception occurred
161            */
162            public static com.liferay.portal.model.Ticket removeByKey(
163                    java.lang.String key)
164                    throws com.liferay.portal.NoSuchTicketException,
165                            com.liferay.portal.kernel.exception.SystemException {
166                    return getPersistence().removeByKey(key);
167            }
168    
169            /**
170            * Returns the number of tickets where key = &#63;.
171            *
172            * @param key the key
173            * @return the number of matching tickets
174            * @throws SystemException if a system exception occurred
175            */
176            public static int countByKey(java.lang.String key)
177                    throws com.liferay.portal.kernel.exception.SystemException {
178                    return getPersistence().countByKey(key);
179            }
180    
181            /**
182            * Returns all the tickets where classNameId = &#63; and classPK = &#63; and type = &#63;.
183            *
184            * @param classNameId the class name ID
185            * @param classPK the class p k
186            * @param type the type
187            * @return the matching tickets
188            * @throws SystemException if a system exception occurred
189            */
190            public static java.util.List<com.liferay.portal.model.Ticket> findByC_C_T(
191                    long classNameId, long classPK, int type)
192                    throws com.liferay.portal.kernel.exception.SystemException {
193                    return getPersistence().findByC_C_T(classNameId, classPK, type);
194            }
195    
196            /**
197            * Returns a range of all the tickets where classNameId = &#63; and classPK = &#63; and type = &#63;.
198            *
199            * <p>
200            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TicketModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
201            * </p>
202            *
203            * @param classNameId the class name ID
204            * @param classPK the class p k
205            * @param type the type
206            * @param start the lower bound of the range of tickets
207            * @param end the upper bound of the range of tickets (not inclusive)
208            * @return the range of matching tickets
209            * @throws SystemException if a system exception occurred
210            */
211            public static java.util.List<com.liferay.portal.model.Ticket> findByC_C_T(
212                    long classNameId, long classPK, int type, int start, int end)
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getPersistence()
215                                       .findByC_C_T(classNameId, classPK, type, start, end);
216            }
217    
218            /**
219            * Returns an ordered range of all the tickets where classNameId = &#63; and classPK = &#63; and type = &#63;.
220            *
221            * <p>
222            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TicketModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
223            * </p>
224            *
225            * @param classNameId the class name ID
226            * @param classPK the class p k
227            * @param type the type
228            * @param start the lower bound of the range of tickets
229            * @param end the upper bound of the range of tickets (not inclusive)
230            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
231            * @return the ordered range of matching tickets
232            * @throws SystemException if a system exception occurred
233            */
234            public static java.util.List<com.liferay.portal.model.Ticket> findByC_C_T(
235                    long classNameId, long classPK, int type, int start, int end,
236                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return getPersistence()
239                                       .findByC_C_T(classNameId, classPK, type, start, end,
240                            orderByComparator);
241            }
242    
243            /**
244            * Returns the first ticket in the ordered set where classNameId = &#63; and classPK = &#63; and type = &#63;.
245            *
246            * @param classNameId the class name ID
247            * @param classPK the class p k
248            * @param type the type
249            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
250            * @return the first matching ticket
251            * @throws com.liferay.portal.NoSuchTicketException if a matching ticket could not be found
252            * @throws SystemException if a system exception occurred
253            */
254            public static com.liferay.portal.model.Ticket findByC_C_T_First(
255                    long classNameId, long classPK, int type,
256                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
257                    throws com.liferay.portal.NoSuchTicketException,
258                            com.liferay.portal.kernel.exception.SystemException {
259                    return getPersistence()
260                                       .findByC_C_T_First(classNameId, classPK, type,
261                            orderByComparator);
262            }
263    
264            /**
265            * Returns the first ticket in the ordered set where classNameId = &#63; and classPK = &#63; and type = &#63;.
266            *
267            * @param classNameId the class name ID
268            * @param classPK the class p k
269            * @param type the type
270            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
271            * @return the first matching ticket, or <code>null</code> if a matching ticket could not be found
272            * @throws SystemException if a system exception occurred
273            */
274            public static com.liferay.portal.model.Ticket fetchByC_C_T_First(
275                    long classNameId, long classPK, int type,
276                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
277                    throws com.liferay.portal.kernel.exception.SystemException {
278                    return getPersistence()
279                                       .fetchByC_C_T_First(classNameId, classPK, type,
280                            orderByComparator);
281            }
282    
283            /**
284            * Returns the last ticket in the ordered set where classNameId = &#63; and classPK = &#63; and type = &#63;.
285            *
286            * @param classNameId the class name ID
287            * @param classPK the class p k
288            * @param type the type
289            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
290            * @return the last matching ticket
291            * @throws com.liferay.portal.NoSuchTicketException if a matching ticket could not be found
292            * @throws SystemException if a system exception occurred
293            */
294            public static com.liferay.portal.model.Ticket findByC_C_T_Last(
295                    long classNameId, long classPK, int type,
296                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
297                    throws com.liferay.portal.NoSuchTicketException,
298                            com.liferay.portal.kernel.exception.SystemException {
299                    return getPersistence()
300                                       .findByC_C_T_Last(classNameId, classPK, type,
301                            orderByComparator);
302            }
303    
304            /**
305            * Returns the last ticket in the ordered set where classNameId = &#63; and classPK = &#63; and type = &#63;.
306            *
307            * @param classNameId the class name ID
308            * @param classPK the class p k
309            * @param type the type
310            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
311            * @return the last matching ticket, or <code>null</code> if a matching ticket could not be found
312            * @throws SystemException if a system exception occurred
313            */
314            public static com.liferay.portal.model.Ticket fetchByC_C_T_Last(
315                    long classNameId, long classPK, int type,
316                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
317                    throws com.liferay.portal.kernel.exception.SystemException {
318                    return getPersistence()
319                                       .fetchByC_C_T_Last(classNameId, classPK, type,
320                            orderByComparator);
321            }
322    
323            /**
324            * Returns the tickets before and after the current ticket in the ordered set where classNameId = &#63; and classPK = &#63; and type = &#63;.
325            *
326            * @param ticketId the primary key of the current ticket
327            * @param classNameId the class name ID
328            * @param classPK the class p k
329            * @param type the type
330            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
331            * @return the previous, current, and next ticket
332            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
333            * @throws SystemException if a system exception occurred
334            */
335            public static com.liferay.portal.model.Ticket[] findByC_C_T_PrevAndNext(
336                    long ticketId, long classNameId, long classPK, int type,
337                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
338                    throws com.liferay.portal.NoSuchTicketException,
339                            com.liferay.portal.kernel.exception.SystemException {
340                    return getPersistence()
341                                       .findByC_C_T_PrevAndNext(ticketId, classNameId, classPK,
342                            type, orderByComparator);
343            }
344    
345            /**
346            * Removes all the tickets where classNameId = &#63; and classPK = &#63; and type = &#63; from the database.
347            *
348            * @param classNameId the class name ID
349            * @param classPK the class p k
350            * @param type the type
351            * @throws SystemException if a system exception occurred
352            */
353            public static void removeByC_C_T(long classNameId, long classPK, int type)
354                    throws com.liferay.portal.kernel.exception.SystemException {
355                    getPersistence().removeByC_C_T(classNameId, classPK, type);
356            }
357    
358            /**
359            * Returns the number of tickets where classNameId = &#63; and classPK = &#63; and type = &#63;.
360            *
361            * @param classNameId the class name ID
362            * @param classPK the class p k
363            * @param type the type
364            * @return the number of matching tickets
365            * @throws SystemException if a system exception occurred
366            */
367            public static int countByC_C_T(long classNameId, long classPK, int type)
368                    throws com.liferay.portal.kernel.exception.SystemException {
369                    return getPersistence().countByC_C_T(classNameId, classPK, type);
370            }
371    
372            /**
373            * Caches the ticket in the entity cache if it is enabled.
374            *
375            * @param ticket the ticket
376            */
377            public static void cacheResult(com.liferay.portal.model.Ticket ticket) {
378                    getPersistence().cacheResult(ticket);
379            }
380    
381            /**
382            * Caches the tickets in the entity cache if it is enabled.
383            *
384            * @param tickets the tickets
385            */
386            public static void cacheResult(
387                    java.util.List<com.liferay.portal.model.Ticket> tickets) {
388                    getPersistence().cacheResult(tickets);
389            }
390    
391            /**
392            * Creates a new ticket with the primary key. Does not add the ticket to the database.
393            *
394            * @param ticketId the primary key for the new ticket
395            * @return the new ticket
396            */
397            public static com.liferay.portal.model.Ticket create(long ticketId) {
398                    return getPersistence().create(ticketId);
399            }
400    
401            /**
402            * Removes the ticket with the primary key from the database. Also notifies the appropriate model listeners.
403            *
404            * @param ticketId the primary key of the ticket
405            * @return the ticket that was removed
406            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
407            * @throws SystemException if a system exception occurred
408            */
409            public static com.liferay.portal.model.Ticket remove(long ticketId)
410                    throws com.liferay.portal.NoSuchTicketException,
411                            com.liferay.portal.kernel.exception.SystemException {
412                    return getPersistence().remove(ticketId);
413            }
414    
415            public static com.liferay.portal.model.Ticket updateImpl(
416                    com.liferay.portal.model.Ticket ticket)
417                    throws com.liferay.portal.kernel.exception.SystemException {
418                    return getPersistence().updateImpl(ticket);
419            }
420    
421            /**
422            * Returns the ticket with the primary key or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
423            *
424            * @param ticketId the primary key of the ticket
425            * @return the ticket
426            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
427            * @throws SystemException if a system exception occurred
428            */
429            public static com.liferay.portal.model.Ticket findByPrimaryKey(
430                    long ticketId)
431                    throws com.liferay.portal.NoSuchTicketException,
432                            com.liferay.portal.kernel.exception.SystemException {
433                    return getPersistence().findByPrimaryKey(ticketId);
434            }
435    
436            /**
437            * Returns the ticket with the primary key or returns <code>null</code> if it could not be found.
438            *
439            * @param ticketId the primary key of the ticket
440            * @return the ticket, or <code>null</code> if a ticket with the primary key could not be found
441            * @throws SystemException if a system exception occurred
442            */
443            public static com.liferay.portal.model.Ticket fetchByPrimaryKey(
444                    long ticketId)
445                    throws com.liferay.portal.kernel.exception.SystemException {
446                    return getPersistence().fetchByPrimaryKey(ticketId);
447            }
448    
449            /**
450            * Returns all the tickets.
451            *
452            * @return the tickets
453            * @throws SystemException if a system exception occurred
454            */
455            public static java.util.List<com.liferay.portal.model.Ticket> findAll()
456                    throws com.liferay.portal.kernel.exception.SystemException {
457                    return getPersistence().findAll();
458            }
459    
460            /**
461            * Returns a range of all the tickets.
462            *
463            * <p>
464            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TicketModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
465            * </p>
466            *
467            * @param start the lower bound of the range of tickets
468            * @param end the upper bound of the range of tickets (not inclusive)
469            * @return the range of tickets
470            * @throws SystemException if a system exception occurred
471            */
472            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
473                    int start, int end)
474                    throws com.liferay.portal.kernel.exception.SystemException {
475                    return getPersistence().findAll(start, end);
476            }
477    
478            /**
479            * Returns an ordered range of all the tickets.
480            *
481            * <p>
482            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TicketModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
483            * </p>
484            *
485            * @param start the lower bound of the range of tickets
486            * @param end the upper bound of the range of tickets (not inclusive)
487            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
488            * @return the ordered range of tickets
489            * @throws SystemException if a system exception occurred
490            */
491            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
492                    int start, int end,
493                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
494                    throws com.liferay.portal.kernel.exception.SystemException {
495                    return getPersistence().findAll(start, end, orderByComparator);
496            }
497    
498            /**
499            * Removes all the tickets from the database.
500            *
501            * @throws SystemException if a system exception occurred
502            */
503            public static void removeAll()
504                    throws com.liferay.portal.kernel.exception.SystemException {
505                    getPersistence().removeAll();
506            }
507    
508            /**
509            * Returns the number of tickets.
510            *
511            * @return the number of tickets
512            * @throws SystemException if a system exception occurred
513            */
514            public static int countAll()
515                    throws com.liferay.portal.kernel.exception.SystemException {
516                    return getPersistence().countAll();
517            }
518    
519            public static TicketPersistence getPersistence() {
520                    if (_persistence == null) {
521                            _persistence = (TicketPersistence)PortalBeanLocatorUtil.locate(TicketPersistence.class.getName());
522    
523                            ReferenceRegistry.registerReference(TicketUtil.class, "_persistence");
524                    }
525    
526                    return _persistence;
527            }
528    
529            /**
530             * @deprecated As of 6.2.0
531             */
532            public void setPersistence(TicketPersistence persistence) {
533            }
534    
535            private static TicketPersistence _persistence;
536    }