001    /**
002     * Copyright (c) 2000-2010 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.model.Ticket;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * The persistence utility for the ticket service.
028     *
029     * <p>
030     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
031     * </p>
032     *
033     * @author Brian Wing Shun Chan
034     * @see TicketPersistence
035     * @see TicketPersistenceImpl
036     * @generated
037     */
038    public class TicketUtil {
039            /**
040             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
041             */
042            public static void clearCache() {
043                    getPersistence().clearCache();
044            }
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
048             */
049            public static void clearCache(Ticket ticket) {
050                    getPersistence().clearCache(ticket);
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
055             */
056            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
057                    throws SystemException {
058                    return getPersistence().countWithDynamicQuery(dynamicQuery);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
063             */
064            public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery)
065                    throws SystemException {
066                    return getPersistence().findWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
071             */
072            public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery,
073                    int start, int end) throws SystemException {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
075            }
076    
077            /**
078             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
079             */
080            public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery,
081                    int start, int end, OrderByComparator orderByComparator)
082                    throws SystemException {
083                    return getPersistence()
084                                       .findWithDynamicQuery(dynamicQuery, start, end,
085                            orderByComparator);
086            }
087    
088            /**
089             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
090             */
091            public static Ticket remove(Ticket ticket) throws SystemException {
092                    return getPersistence().remove(ticket);
093            }
094    
095            /**
096             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
097             */
098            public static Ticket update(Ticket ticket, boolean merge)
099                    throws SystemException {
100                    return getPersistence().update(ticket, merge);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
105             */
106            public static Ticket update(Ticket ticket, boolean merge,
107                    ServiceContext serviceContext) throws SystemException {
108                    return getPersistence().update(ticket, merge, serviceContext);
109            }
110    
111            /**
112            * Caches the ticket in the entity cache if it is enabled.
113            *
114            * @param ticket the ticket to cache
115            */
116            public static void cacheResult(com.liferay.portal.model.Ticket ticket) {
117                    getPersistence().cacheResult(ticket);
118            }
119    
120            /**
121            * Caches the tickets in the entity cache if it is enabled.
122            *
123            * @param tickets the tickets to cache
124            */
125            public static void cacheResult(
126                    java.util.List<com.liferay.portal.model.Ticket> tickets) {
127                    getPersistence().cacheResult(tickets);
128            }
129    
130            /**
131            * Creates a new ticket with the primary key.
132            *
133            * @param ticketId the primary key for the new ticket
134            * @return the new ticket
135            */
136            public static com.liferay.portal.model.Ticket create(long ticketId) {
137                    return getPersistence().create(ticketId);
138            }
139    
140            /**
141            * Removes the ticket with the primary key from the database. Also notifies the appropriate model listeners.
142            *
143            * @param ticketId the primary key of the ticket to remove
144            * @return the ticket that was removed
145            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
146            * @throws SystemException if a system exception occurred
147            */
148            public static com.liferay.portal.model.Ticket remove(long ticketId)
149                    throws com.liferay.portal.NoSuchTicketException,
150                            com.liferay.portal.kernel.exception.SystemException {
151                    return getPersistence().remove(ticketId);
152            }
153    
154            public static com.liferay.portal.model.Ticket updateImpl(
155                    com.liferay.portal.model.Ticket ticket, boolean merge)
156                    throws com.liferay.portal.kernel.exception.SystemException {
157                    return getPersistence().updateImpl(ticket, merge);
158            }
159    
160            /**
161            * Finds the ticket with the primary key or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
162            *
163            * @param ticketId the primary key of the ticket to find
164            * @return the ticket
165            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
166            * @throws SystemException if a system exception occurred
167            */
168            public static com.liferay.portal.model.Ticket findByPrimaryKey(
169                    long ticketId)
170                    throws com.liferay.portal.NoSuchTicketException,
171                            com.liferay.portal.kernel.exception.SystemException {
172                    return getPersistence().findByPrimaryKey(ticketId);
173            }
174    
175            /**
176            * Finds the ticket with the primary key or returns <code>null</code> if it could not be found.
177            *
178            * @param ticketId the primary key of the ticket to find
179            * @return the ticket, or <code>null</code> if a ticket with the primary key could not be found
180            * @throws SystemException if a system exception occurred
181            */
182            public static com.liferay.portal.model.Ticket fetchByPrimaryKey(
183                    long ticketId)
184                    throws com.liferay.portal.kernel.exception.SystemException {
185                    return getPersistence().fetchByPrimaryKey(ticketId);
186            }
187    
188            /**
189            * Finds the ticket where key = &#63; or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
190            *
191            * @param key the key to search with
192            * @return the matching ticket
193            * @throws com.liferay.portal.NoSuchTicketException if a matching ticket could not be found
194            * @throws SystemException if a system exception occurred
195            */
196            public static com.liferay.portal.model.Ticket findByKey(
197                    java.lang.String key)
198                    throws com.liferay.portal.NoSuchTicketException,
199                            com.liferay.portal.kernel.exception.SystemException {
200                    return getPersistence().findByKey(key);
201            }
202    
203            /**
204            * Finds the ticket where key = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
205            *
206            * @param key the key to search with
207            * @return the matching ticket, or <code>null</code> if a matching ticket could not be found
208            * @throws SystemException if a system exception occurred
209            */
210            public static com.liferay.portal.model.Ticket fetchByKey(
211                    java.lang.String key)
212                    throws com.liferay.portal.kernel.exception.SystemException {
213                    return getPersistence().fetchByKey(key);
214            }
215    
216            /**
217            * Finds the ticket where key = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
218            *
219            * @param key the key to search with
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            * Finds 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            * Finds 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 to return
248            * @param end the upper bound of the range of tickets to return (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            * Finds 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 to return
266            * @param end the upper bound of the range of tickets to return (not inclusive)
267            * @param orderByComparator the comparator to order the results by
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 to search with
282            * @throws SystemException if a system exception occurred
283            */
284            public static void removeByKey(java.lang.String key)
285                    throws com.liferay.portal.NoSuchTicketException,
286                            com.liferay.portal.kernel.exception.SystemException {
287                    getPersistence().removeByKey(key);
288            }
289    
290            /**
291            * Removes all the tickets from the database.
292            *
293            * @throws SystemException if a system exception occurred
294            */
295            public static void removeAll()
296                    throws com.liferay.portal.kernel.exception.SystemException {
297                    getPersistence().removeAll();
298            }
299    
300            /**
301            * Counts all the tickets where key = &#63;.
302            *
303            * @param key the key to search with
304            * @return the number of matching tickets
305            * @throws SystemException if a system exception occurred
306            */
307            public static int countByKey(java.lang.String key)
308                    throws com.liferay.portal.kernel.exception.SystemException {
309                    return getPersistence().countByKey(key);
310            }
311    
312            /**
313            * Counts all the tickets.
314            *
315            * @return the number of tickets
316            * @throws SystemException if a system exception occurred
317            */
318            public static int countAll()
319                    throws com.liferay.portal.kernel.exception.SystemException {
320                    return getPersistence().countAll();
321            }
322    
323            public static TicketPersistence getPersistence() {
324                    if (_persistence == null) {
325                            _persistence = (TicketPersistence)PortalBeanLocatorUtil.locate(TicketPersistence.class.getName());
326                    }
327    
328                    return _persistence;
329            }
330    
331            public void setPersistence(TicketPersistence persistence) {
332                    _persistence = persistence;
333            }
334    
335            private static TicketPersistence _persistence;
336    }