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