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 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 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 com.liferay.portal.NoSuchTicketException} if it could not be found.
110            *
111            * @param key the key
112            * @return the matching ticket
113            * @throws com.liferay.portal.NoSuchTicketException if a matching ticket could not be found
114            */
115            public static com.liferay.portal.model.Ticket findByKey(
116                    java.lang.String key) throws com.liferay.portal.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 com.liferay.portal.model.Ticket fetchByKey(
127                    java.lang.String key) {
128                    return getPersistence().fetchByKey(key);
129            }
130    
131            /**
132            * Returns the ticket where key = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
133            *
134            * @param key the key
135            * @param retrieveFromCache whether to use the finder cache
136            * @return the matching ticket, or <code>null</code> if a matching ticket could not be found
137            */
138            public static com.liferay.portal.model.Ticket fetchByKey(
139                    java.lang.String key, boolean retrieveFromCache) {
140                    return getPersistence().fetchByKey(key, retrieveFromCache);
141            }
142    
143            /**
144            * Removes the ticket where key = &#63; from the database.
145            *
146            * @param key the key
147            * @return the ticket that was removed
148            */
149            public static com.liferay.portal.model.Ticket removeByKey(
150                    java.lang.String key) throws com.liferay.portal.NoSuchTicketException {
151                    return getPersistence().removeByKey(key);
152            }
153    
154            /**
155            * Returns the number of tickets where key = &#63;.
156            *
157            * @param key the key
158            * @return the number of matching tickets
159            */
160            public static int countByKey(java.lang.String key) {
161                    return getPersistence().countByKey(key);
162            }
163    
164            /**
165            * Caches the ticket in the entity cache if it is enabled.
166            *
167            * @param ticket the ticket
168            */
169            public static void cacheResult(com.liferay.portal.model.Ticket ticket) {
170                    getPersistence().cacheResult(ticket);
171            }
172    
173            /**
174            * Caches the tickets in the entity cache if it is enabled.
175            *
176            * @param tickets the tickets
177            */
178            public static void cacheResult(
179                    java.util.List<com.liferay.portal.model.Ticket> tickets) {
180                    getPersistence().cacheResult(tickets);
181            }
182    
183            /**
184            * Creates a new ticket with the primary key. Does not add the ticket to the database.
185            *
186            * @param ticketId the primary key for the new ticket
187            * @return the new ticket
188            */
189            public static com.liferay.portal.model.Ticket create(long ticketId) {
190                    return getPersistence().create(ticketId);
191            }
192    
193            /**
194            * Removes the ticket with the primary key from the database. Also notifies the appropriate model listeners.
195            *
196            * @param ticketId the primary key of the ticket
197            * @return the ticket that was removed
198            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
199            */
200            public static com.liferay.portal.model.Ticket remove(long ticketId)
201                    throws com.liferay.portal.NoSuchTicketException {
202                    return getPersistence().remove(ticketId);
203            }
204    
205            public static com.liferay.portal.model.Ticket updateImpl(
206                    com.liferay.portal.model.Ticket ticket) {
207                    return getPersistence().updateImpl(ticket);
208            }
209    
210            /**
211            * Returns the ticket with the primary key or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
212            *
213            * @param ticketId the primary key of the ticket
214            * @return the ticket
215            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
216            */
217            public static com.liferay.portal.model.Ticket findByPrimaryKey(
218                    long ticketId) throws com.liferay.portal.NoSuchTicketException {
219                    return getPersistence().findByPrimaryKey(ticketId);
220            }
221    
222            /**
223            * Returns the ticket with the primary key or returns <code>null</code> if it could not be found.
224            *
225            * @param ticketId the primary key of the ticket
226            * @return the ticket, or <code>null</code> if a ticket with the primary key could not be found
227            */
228            public static com.liferay.portal.model.Ticket fetchByPrimaryKey(
229                    long ticketId) {
230                    return getPersistence().fetchByPrimaryKey(ticketId);
231            }
232    
233            public static java.util.Map<java.io.Serializable, com.liferay.portal.model.Ticket> fetchByPrimaryKeys(
234                    java.util.Set<java.io.Serializable> primaryKeys) {
235                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
236            }
237    
238            /**
239            * Returns all the tickets.
240            *
241            * @return the tickets
242            */
243            public static java.util.List<com.liferay.portal.model.Ticket> findAll() {
244                    return getPersistence().findAll();
245            }
246    
247            /**
248            * Returns a range of all the tickets.
249            *
250            * <p>
251            * 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.
252            * </p>
253            *
254            * @param start the lower bound of the range of tickets
255            * @param end the upper bound of the range of tickets (not inclusive)
256            * @return the range of tickets
257            */
258            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
259                    int start, int end) {
260                    return getPersistence().findAll(start, end);
261            }
262    
263            /**
264            * Returns an ordered range of all the tickets.
265            *
266            * <p>
267            * 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.
268            * </p>
269            *
270            * @param start the lower bound of the range of tickets
271            * @param end the upper bound of the range of tickets (not inclusive)
272            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
273            * @return the ordered range of tickets
274            */
275            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
276                    int start, int end,
277                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Ticket> orderByComparator) {
278                    return getPersistence().findAll(start, end, orderByComparator);
279            }
280    
281            /**
282            * Removes all the tickets from the database.
283            */
284            public static void removeAll() {
285                    getPersistence().removeAll();
286            }
287    
288            /**
289            * Returns the number of tickets.
290            *
291            * @return the number of tickets
292            */
293            public static int countAll() {
294                    return getPersistence().countAll();
295            }
296    
297            public static TicketPersistence getPersistence() {
298                    if (_persistence == null) {
299                            _persistence = (TicketPersistence)PortalBeanLocatorUtil.locate(TicketPersistence.class.getName());
300    
301                            ReferenceRegistry.registerReference(TicketUtil.class, "_persistence");
302                    }
303    
304                    return _persistence;
305            }
306    
307            /**
308             * @deprecated As of 6.2.0
309             */
310            @Deprecated
311            public void setPersistence(TicketPersistence persistence) {
312            }
313    
314            private static TicketPersistence _persistence;
315    }