001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.Ticket;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * 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.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see TicketPersistence
036     * @see TicketPersistenceImpl
037     * @generated
038     */
039    public class TicketUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(Ticket ticket) {
057                    getPersistence().clearCache(ticket);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery)
072                    throws SystemException {
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) throws SystemException {
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 orderByComparator)
089                    throws SystemException {
090                    return getPersistence()
091                                       .findWithDynamicQuery(dynamicQuery, start, end,
092                            orderByComparator);
093            }
094    
095            /**
096             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
097             */
098            public static Ticket update(Ticket ticket) throws SystemException {
099                    return getPersistence().update(ticket);
100            }
101    
102            /**
103             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
104             */
105            public static Ticket update(Ticket ticket, ServiceContext serviceContext)
106                    throws SystemException {
107                    return getPersistence().update(ticket, serviceContext);
108            }
109    
110            /**
111            * Caches the ticket in the entity cache if it is enabled.
112            *
113            * @param ticket the ticket
114            */
115            public static void cacheResult(com.liferay.portal.model.Ticket ticket) {
116                    getPersistence().cacheResult(ticket);
117            }
118    
119            /**
120            * Caches the tickets in the entity cache if it is enabled.
121            *
122            * @param tickets the tickets
123            */
124            public static void cacheResult(
125                    java.util.List<com.liferay.portal.model.Ticket> tickets) {
126                    getPersistence().cacheResult(tickets);
127            }
128    
129            /**
130            * Creates a new ticket with the primary key. Does not add the ticket to the database.
131            *
132            * @param ticketId the primary key for the new ticket
133            * @return the new ticket
134            */
135            public static com.liferay.portal.model.Ticket create(long ticketId) {
136                    return getPersistence().create(ticketId);
137            }
138    
139            /**
140            * Removes the ticket with the primary key from the database. Also notifies the appropriate model listeners.
141            *
142            * @param ticketId the primary key of the ticket
143            * @return the ticket that was removed
144            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
145            * @throws SystemException if a system exception occurred
146            */
147            public static com.liferay.portal.model.Ticket remove(long ticketId)
148                    throws com.liferay.portal.NoSuchTicketException,
149                            com.liferay.portal.kernel.exception.SystemException {
150                    return getPersistence().remove(ticketId);
151            }
152    
153            public static com.liferay.portal.model.Ticket updateImpl(
154                    com.liferay.portal.model.Ticket ticket)
155                    throws com.liferay.portal.kernel.exception.SystemException {
156                    return getPersistence().updateImpl(ticket);
157            }
158    
159            /**
160            * Returns the ticket with the primary key or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
161            *
162            * @param ticketId the primary key of the ticket
163            * @return the ticket
164            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
165            * @throws SystemException if a system exception occurred
166            */
167            public static com.liferay.portal.model.Ticket findByPrimaryKey(
168                    long ticketId)
169                    throws com.liferay.portal.NoSuchTicketException,
170                            com.liferay.portal.kernel.exception.SystemException {
171                    return getPersistence().findByPrimaryKey(ticketId);
172            }
173    
174            /**
175            * Returns the ticket with the primary key or returns <code>null</code> if it could not be found.
176            *
177            * @param ticketId the primary key of the ticket
178            * @return the ticket, or <code>null</code> if a ticket with the primary key could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public static com.liferay.portal.model.Ticket fetchByPrimaryKey(
182                    long ticketId)
183                    throws com.liferay.portal.kernel.exception.SystemException {
184                    return getPersistence().fetchByPrimaryKey(ticketId);
185            }
186    
187            /**
188            * Returns the ticket where key = &#63; or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
189            *
190            * @param key the key
191            * @return the matching ticket
192            * @throws com.liferay.portal.NoSuchTicketException if a matching ticket could not be found
193            * @throws SystemException if a system exception occurred
194            */
195            public static com.liferay.portal.model.Ticket findByKey(
196                    java.lang.String key)
197                    throws com.liferay.portal.NoSuchTicketException,
198                            com.liferay.portal.kernel.exception.SystemException {
199                    return getPersistence().findByKey(key);
200            }
201    
202            /**
203            * Returns the ticket where key = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
204            *
205            * @param key the key
206            * @return the matching ticket, or <code>null</code> if a matching ticket could not be found
207            * @throws SystemException if a system exception occurred
208            */
209            public static com.liferay.portal.model.Ticket fetchByKey(
210                    java.lang.String key)
211                    throws com.liferay.portal.kernel.exception.SystemException {
212                    return getPersistence().fetchByKey(key);
213            }
214    
215            /**
216            * Returns the ticket where key = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
217            *
218            * @param key the key
219            * @param retrieveFromCache whether to use the finder cache
220            * @return the matching ticket, or <code>null</code> if a matching ticket could not be found
221            * @throws SystemException if a system exception occurred
222            */
223            public static com.liferay.portal.model.Ticket fetchByKey(
224                    java.lang.String key, boolean retrieveFromCache)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().fetchByKey(key, retrieveFromCache);
227            }
228    
229            /**
230            * Returns all the tickets.
231            *
232            * @return the tickets
233            * @throws SystemException if a system exception occurred
234            */
235            public static java.util.List<com.liferay.portal.model.Ticket> findAll()
236                    throws com.liferay.portal.kernel.exception.SystemException {
237                    return getPersistence().findAll();
238            }
239    
240            /**
241            * Returns a range of all the tickets.
242            *
243            * <p>
244            * 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.
245            * </p>
246            *
247            * @param start the lower bound of the range of tickets
248            * @param end the upper bound of the range of tickets (not inclusive)
249            * @return the range of tickets
250            * @throws SystemException if a system exception occurred
251            */
252            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
253                    int start, int end)
254                    throws com.liferay.portal.kernel.exception.SystemException {
255                    return getPersistence().findAll(start, end);
256            }
257    
258            /**
259            * Returns an ordered range of all the tickets.
260            *
261            * <p>
262            * 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.
263            * </p>
264            *
265            * @param start the lower bound of the range of tickets
266            * @param end the upper bound of the range of tickets (not inclusive)
267            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
268            * @return the ordered range of tickets
269            * @throws SystemException if a system exception occurred
270            */
271            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
272                    int start, int end,
273                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
274                    throws com.liferay.portal.kernel.exception.SystemException {
275                    return getPersistence().findAll(start, end, orderByComparator);
276            }
277    
278            /**
279            * Removes the ticket where key = &#63; from the database.
280            *
281            * @param key the key
282            * @return the ticket that was removed
283            * @throws SystemException if a system exception occurred
284            */
285            public static com.liferay.portal.model.Ticket removeByKey(
286                    java.lang.String key)
287                    throws com.liferay.portal.NoSuchTicketException,
288                            com.liferay.portal.kernel.exception.SystemException {
289                    return getPersistence().removeByKey(key);
290            }
291    
292            /**
293            * Removes all the tickets from the database.
294            *
295            * @throws SystemException if a system exception occurred
296            */
297            public static void removeAll()
298                    throws com.liferay.portal.kernel.exception.SystemException {
299                    getPersistence().removeAll();
300            }
301    
302            /**
303            * Returns the number of tickets where key = &#63;.
304            *
305            * @param key the key
306            * @return the number of matching tickets
307            * @throws SystemException if a system exception occurred
308            */
309            public static int countByKey(java.lang.String key)
310                    throws com.liferay.portal.kernel.exception.SystemException {
311                    return getPersistence().countByKey(key);
312            }
313    
314            /**
315            * Returns the number of tickets.
316            *
317            * @return the number of tickets
318            * @throws SystemException if a system exception occurred
319            */
320            public static int countAll()
321                    throws com.liferay.portal.kernel.exception.SystemException {
322                    return getPersistence().countAll();
323            }
324    
325            public static TicketPersistence getPersistence() {
326                    if (_persistence == null) {
327                            _persistence = (TicketPersistence)PortalBeanLocatorUtil.locate(TicketPersistence.class.getName());
328    
329                            ReferenceRegistry.registerReference(TicketUtil.class, "_persistence");
330                    }
331    
332                    return _persistence;
333            }
334    
335            /**
336             * @deprecated
337             */
338            public void setPersistence(TicketPersistence persistence) {
339            }
340    
341            private static TicketPersistence _persistence;
342    }