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            * Caches the ticket in the entity cache if it is enabled.
183            *
184            * @param ticket the ticket
185            */
186            public static void cacheResult(com.liferay.portal.model.Ticket ticket) {
187                    getPersistence().cacheResult(ticket);
188            }
189    
190            /**
191            * Caches the tickets in the entity cache if it is enabled.
192            *
193            * @param tickets the tickets
194            */
195            public static void cacheResult(
196                    java.util.List<com.liferay.portal.model.Ticket> tickets) {
197                    getPersistence().cacheResult(tickets);
198            }
199    
200            /**
201            * Creates a new ticket with the primary key. Does not add the ticket to the database.
202            *
203            * @param ticketId the primary key for the new ticket
204            * @return the new ticket
205            */
206            public static com.liferay.portal.model.Ticket create(long ticketId) {
207                    return getPersistence().create(ticketId);
208            }
209    
210            /**
211            * Removes the ticket with the primary key from the database. Also notifies the appropriate model listeners.
212            *
213            * @param ticketId the primary key of the ticket
214            * @return the ticket that was removed
215            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
216            * @throws SystemException if a system exception occurred
217            */
218            public static com.liferay.portal.model.Ticket remove(long ticketId)
219                    throws com.liferay.portal.NoSuchTicketException,
220                            com.liferay.portal.kernel.exception.SystemException {
221                    return getPersistence().remove(ticketId);
222            }
223    
224            public static com.liferay.portal.model.Ticket updateImpl(
225                    com.liferay.portal.model.Ticket ticket)
226                    throws com.liferay.portal.kernel.exception.SystemException {
227                    return getPersistence().updateImpl(ticket);
228            }
229    
230            /**
231            * Returns the ticket with the primary key or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
232            *
233            * @param ticketId the primary key of the ticket
234            * @return the ticket
235            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
236            * @throws SystemException if a system exception occurred
237            */
238            public static com.liferay.portal.model.Ticket findByPrimaryKey(
239                    long ticketId)
240                    throws com.liferay.portal.NoSuchTicketException,
241                            com.liferay.portal.kernel.exception.SystemException {
242                    return getPersistence().findByPrimaryKey(ticketId);
243            }
244    
245            /**
246            * Returns the ticket with the primary key or returns <code>null</code> if it could not be found.
247            *
248            * @param ticketId the primary key of the ticket
249            * @return the ticket, or <code>null</code> if a ticket with the primary key could not be found
250            * @throws SystemException if a system exception occurred
251            */
252            public static com.liferay.portal.model.Ticket fetchByPrimaryKey(
253                    long ticketId)
254                    throws com.liferay.portal.kernel.exception.SystemException {
255                    return getPersistence().fetchByPrimaryKey(ticketId);
256            }
257    
258            /**
259            * Returns all the tickets.
260            *
261            * @return the tickets
262            * @throws SystemException if a system exception occurred
263            */
264            public static java.util.List<com.liferay.portal.model.Ticket> findAll()
265                    throws com.liferay.portal.kernel.exception.SystemException {
266                    return getPersistence().findAll();
267            }
268    
269            /**
270            * Returns a range of all the tickets.
271            *
272            * <p>
273            * 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.
274            * </p>
275            *
276            * @param start the lower bound of the range of tickets
277            * @param end the upper bound of the range of tickets (not inclusive)
278            * @return the range of tickets
279            * @throws SystemException if a system exception occurred
280            */
281            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
282                    int start, int end)
283                    throws com.liferay.portal.kernel.exception.SystemException {
284                    return getPersistence().findAll(start, end);
285            }
286    
287            /**
288            * Returns an ordered range of all the tickets.
289            *
290            * <p>
291            * 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.
292            * </p>
293            *
294            * @param start the lower bound of the range of tickets
295            * @param end the upper bound of the range of tickets (not inclusive)
296            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
297            * @return the ordered range of tickets
298            * @throws SystemException if a system exception occurred
299            */
300            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
301                    int start, int end,
302                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
303                    throws com.liferay.portal.kernel.exception.SystemException {
304                    return getPersistence().findAll(start, end, orderByComparator);
305            }
306    
307            /**
308            * Removes all the tickets from the database.
309            *
310            * @throws SystemException if a system exception occurred
311            */
312            public static void removeAll()
313                    throws com.liferay.portal.kernel.exception.SystemException {
314                    getPersistence().removeAll();
315            }
316    
317            /**
318            * Returns the number of tickets.
319            *
320            * @return the number of tickets
321            * @throws SystemException if a system exception occurred
322            */
323            public static int countAll()
324                    throws com.liferay.portal.kernel.exception.SystemException {
325                    return getPersistence().countAll();
326            }
327    
328            public static TicketPersistence getPersistence() {
329                    if (_persistence == null) {
330                            _persistence = (TicketPersistence)PortalBeanLocatorUtil.locate(TicketPersistence.class.getName());
331    
332                            ReferenceRegistry.registerReference(TicketUtil.class, "_persistence");
333                    }
334    
335                    return _persistence;
336            }
337    
338            /**
339             * @deprecated As of 6.2.0
340             */
341            public void setPersistence(TicketPersistence persistence) {
342            }
343    
344            private static TicketPersistence _persistence;
345    }