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