001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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#remove(com.liferay.portal.model.BaseModel)
097             */
098            public static Ticket remove(Ticket ticket) throws SystemException {
099                    return getPersistence().remove(ticket);
100            }
101    
102            /**
103             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
104             */
105            public static Ticket update(Ticket ticket, boolean merge)
106                    throws SystemException {
107                    return getPersistence().update(ticket, merge);
108            }
109    
110            /**
111             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
112             */
113            public static Ticket update(Ticket ticket, boolean merge,
114                    ServiceContext serviceContext) throws SystemException {
115                    return getPersistence().update(ticket, merge, serviceContext);
116            }
117    
118            /**
119            * Caches the ticket in the entity cache if it is enabled.
120            *
121            * @param ticket the ticket to cache
122            */
123            public static void cacheResult(com.liferay.portal.model.Ticket ticket) {
124                    getPersistence().cacheResult(ticket);
125            }
126    
127            /**
128            * Caches the tickets in the entity cache if it is enabled.
129            *
130            * @param tickets the tickets to cache
131            */
132            public static void cacheResult(
133                    java.util.List<com.liferay.portal.model.Ticket> tickets) {
134                    getPersistence().cacheResult(tickets);
135            }
136    
137            /**
138            * Creates a new ticket with the primary key. Does not add the ticket to the database.
139            *
140            * @param ticketId the primary key for the new ticket
141            * @return the new ticket
142            */
143            public static com.liferay.portal.model.Ticket create(long ticketId) {
144                    return getPersistence().create(ticketId);
145            }
146    
147            /**
148            * Removes the ticket with the primary key from the database. Also notifies the appropriate model listeners.
149            *
150            * @param ticketId the primary key of the ticket to remove
151            * @return the ticket that was removed
152            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            public static com.liferay.portal.model.Ticket remove(long ticketId)
156                    throws com.liferay.portal.NoSuchTicketException,
157                            com.liferay.portal.kernel.exception.SystemException {
158                    return getPersistence().remove(ticketId);
159            }
160    
161            public static com.liferay.portal.model.Ticket updateImpl(
162                    com.liferay.portal.model.Ticket ticket, boolean merge)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getPersistence().updateImpl(ticket, merge);
165            }
166    
167            /**
168            * Finds the ticket with the primary key or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
169            *
170            * @param ticketId the primary key of the ticket to find
171            * @return the ticket
172            * @throws com.liferay.portal.NoSuchTicketException if a ticket with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portal.model.Ticket findByPrimaryKey(
176                    long ticketId)
177                    throws com.liferay.portal.NoSuchTicketException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getPersistence().findByPrimaryKey(ticketId);
180            }
181    
182            /**
183            * Finds the ticket with the primary key or returns <code>null</code> if it could not be found.
184            *
185            * @param ticketId the primary key of the ticket to find
186            * @return the ticket, or <code>null</code> if a ticket with the primary key could not be found
187            * @throws SystemException if a system exception occurred
188            */
189            public static com.liferay.portal.model.Ticket fetchByPrimaryKey(
190                    long ticketId)
191                    throws com.liferay.portal.kernel.exception.SystemException {
192                    return getPersistence().fetchByPrimaryKey(ticketId);
193            }
194    
195            /**
196            * Finds the ticket where key = &#63; or throws a {@link com.liferay.portal.NoSuchTicketException} if it could not be found.
197            *
198            * @param key the key to search with
199            * @return the matching ticket
200            * @throws com.liferay.portal.NoSuchTicketException if a matching ticket could not be found
201            * @throws SystemException if a system exception occurred
202            */
203            public static com.liferay.portal.model.Ticket findByKey(
204                    java.lang.String key)
205                    throws com.liferay.portal.NoSuchTicketException,
206                            com.liferay.portal.kernel.exception.SystemException {
207                    return getPersistence().findByKey(key);
208            }
209    
210            /**
211            * Finds the ticket where key = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
212            *
213            * @param key the key to search with
214            * @return the matching ticket, or <code>null</code> if a matching ticket could not be found
215            * @throws SystemException if a system exception occurred
216            */
217            public static com.liferay.portal.model.Ticket fetchByKey(
218                    java.lang.String key)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getPersistence().fetchByKey(key);
221            }
222    
223            /**
224            * Finds the ticket where key = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
225            *
226            * @param key the key to search with
227            * @return the matching ticket, or <code>null</code> if a matching ticket could not be found
228            * @throws SystemException if a system exception occurred
229            */
230            public static com.liferay.portal.model.Ticket fetchByKey(
231                    java.lang.String key, boolean retrieveFromCache)
232                    throws com.liferay.portal.kernel.exception.SystemException {
233                    return getPersistence().fetchByKey(key, retrieveFromCache);
234            }
235    
236            /**
237            * Finds all the tickets.
238            *
239            * @return the tickets
240            * @throws SystemException if a system exception occurred
241            */
242            public static java.util.List<com.liferay.portal.model.Ticket> findAll()
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getPersistence().findAll();
245            }
246    
247            /**
248            * Finds 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.
252            * </p>
253            *
254            * @param start the lower bound of the range of tickets to return
255            * @param end the upper bound of the range of tickets to return (not inclusive)
256            * @return the range of tickets
257            * @throws SystemException if a system exception occurred
258            */
259            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
260                    int start, int end)
261                    throws com.liferay.portal.kernel.exception.SystemException {
262                    return getPersistence().findAll(start, end);
263            }
264    
265            /**
266            * Finds an ordered range of all the tickets.
267            *
268            * <p>
269            * 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.
270            * </p>
271            *
272            * @param start the lower bound of the range of tickets to return
273            * @param end the upper bound of the range of tickets to return (not inclusive)
274            * @param orderByComparator the comparator to order the results by
275            * @return the ordered range of tickets
276            * @throws SystemException if a system exception occurred
277            */
278            public static java.util.List<com.liferay.portal.model.Ticket> findAll(
279                    int start, int end,
280                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
281                    throws com.liferay.portal.kernel.exception.SystemException {
282                    return getPersistence().findAll(start, end, orderByComparator);
283            }
284    
285            /**
286            * Removes the ticket where key = &#63; from the database.
287            *
288            * @param key the key to search with
289            * @throws SystemException if a system exception occurred
290            */
291            public static void removeByKey(java.lang.String key)
292                    throws com.liferay.portal.NoSuchTicketException,
293                            com.liferay.portal.kernel.exception.SystemException {
294                    getPersistence().removeByKey(key);
295            }
296    
297            /**
298            * Removes all the tickets from the database.
299            *
300            * @throws SystemException if a system exception occurred
301            */
302            public static void removeAll()
303                    throws com.liferay.portal.kernel.exception.SystemException {
304                    getPersistence().removeAll();
305            }
306    
307            /**
308            * Counts all the tickets where key = &#63;.
309            *
310            * @param key the key to search with
311            * @return the number of matching tickets
312            * @throws SystemException if a system exception occurred
313            */
314            public static int countByKey(java.lang.String key)
315                    throws com.liferay.portal.kernel.exception.SystemException {
316                    return getPersistence().countByKey(key);
317            }
318    
319            /**
320            * Counts all the tickets.
321            *
322            * @return the number of tickets
323            * @throws SystemException if a system exception occurred
324            */
325            public static int countAll()
326                    throws com.liferay.portal.kernel.exception.SystemException {
327                    return getPersistence().countAll();
328            }
329    
330            public static TicketPersistence getPersistence() {
331                    if (_persistence == null) {
332                            _persistence = (TicketPersistence)PortalBeanLocatorUtil.locate(TicketPersistence.class.getName());
333    
334                            ReferenceRegistry.registerReference(TicketUtil.class, "_persistence");
335                    }
336    
337                    return _persistence;
338            }
339    
340            public void setPersistence(TicketPersistence persistence) {
341                    _persistence = persistence;
342    
343                    ReferenceRegistry.registerReference(TicketUtil.class, "_persistence");
344            }
345    
346            private static TicketPersistence _persistence;
347    }