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.ListType;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * The persistence utility for the list type service. This utility wraps {@link ListTypePersistenceImpl} 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 ListTypePersistence
039     * @see ListTypePersistenceImpl
040     * @generated
041     */
042    public class ListTypeUtil {
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(ListType listType) {
054                    getPersistence().clearCache(listType);
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<ListType> 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<ListType> findWithDynamicQuery(
077                    DynamicQuery dynamicQuery, int start, int end)
078                    throws SystemException {
079                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
080            }
081    
082            /**
083             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
084             */
085            public static List<ListType> findWithDynamicQuery(
086                    DynamicQuery dynamicQuery, int start, int end,
087                    OrderByComparator orderByComparator) throws SystemException {
088                    return getPersistence()
089                                       .findWithDynamicQuery(dynamicQuery, start, end,
090                            orderByComparator);
091            }
092    
093            /**
094             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
095             */
096            public static ListType remove(ListType listType) throws SystemException {
097                    return getPersistence().remove(listType);
098            }
099    
100            /**
101             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
102             */
103            public static ListType update(ListType listType, boolean merge)
104                    throws SystemException {
105                    return getPersistence().update(listType, merge);
106            }
107    
108            /**
109             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
110             */
111            public static ListType update(ListType listType, boolean merge,
112                    ServiceContext serviceContext) throws SystemException {
113                    return getPersistence().update(listType, merge, serviceContext);
114            }
115    
116            /**
117            * Caches the list type in the entity cache if it is enabled.
118            *
119            * @param listType the list type to cache
120            */
121            public static void cacheResult(com.liferay.portal.model.ListType listType) {
122                    getPersistence().cacheResult(listType);
123            }
124    
125            /**
126            * Caches the list types in the entity cache if it is enabled.
127            *
128            * @param listTypes the list types to cache
129            */
130            public static void cacheResult(
131                    java.util.List<com.liferay.portal.model.ListType> listTypes) {
132                    getPersistence().cacheResult(listTypes);
133            }
134    
135            /**
136            * Creates a new list type with the primary key. Does not add the list type to the database.
137            *
138            * @param listTypeId the primary key for the new list type
139            * @return the new list type
140            */
141            public static com.liferay.portal.model.ListType create(int listTypeId) {
142                    return getPersistence().create(listTypeId);
143            }
144    
145            /**
146            * Removes the list type with the primary key from the database. Also notifies the appropriate model listeners.
147            *
148            * @param listTypeId the primary key of the list type to remove
149            * @return the list type that was removed
150            * @throws com.liferay.portal.NoSuchListTypeException if a list type with the primary key could not be found
151            * @throws SystemException if a system exception occurred
152            */
153            public static com.liferay.portal.model.ListType remove(int listTypeId)
154                    throws com.liferay.portal.NoSuchListTypeException,
155                            com.liferay.portal.kernel.exception.SystemException {
156                    return getPersistence().remove(listTypeId);
157            }
158    
159            public static com.liferay.portal.model.ListType updateImpl(
160                    com.liferay.portal.model.ListType listType, boolean merge)
161                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence().updateImpl(listType, merge);
163            }
164    
165            /**
166            * Finds the list type with the primary key or throws a {@link com.liferay.portal.NoSuchListTypeException} if it could not be found.
167            *
168            * @param listTypeId the primary key of the list type to find
169            * @return the list type
170            * @throws com.liferay.portal.NoSuchListTypeException if a list type with the primary key could not be found
171            * @throws SystemException if a system exception occurred
172            */
173            public static com.liferay.portal.model.ListType findByPrimaryKey(
174                    int listTypeId)
175                    throws com.liferay.portal.NoSuchListTypeException,
176                            com.liferay.portal.kernel.exception.SystemException {
177                    return getPersistence().findByPrimaryKey(listTypeId);
178            }
179    
180            /**
181            * Finds the list type with the primary key or returns <code>null</code> if it could not be found.
182            *
183            * @param listTypeId the primary key of the list type to find
184            * @return the list type, or <code>null</code> if a list type with the primary key could not be found
185            * @throws SystemException if a system exception occurred
186            */
187            public static com.liferay.portal.model.ListType fetchByPrimaryKey(
188                    int listTypeId)
189                    throws com.liferay.portal.kernel.exception.SystemException {
190                    return getPersistence().fetchByPrimaryKey(listTypeId);
191            }
192    
193            /**
194            * Finds all the list types where type = &#63;.
195            *
196            * @param type the type to search with
197            * @return the matching list types
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portal.model.ListType> findByType(
201                    java.lang.String type)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().findByType(type);
204            }
205    
206            /**
207            * Finds a range of all the list types where type = &#63;.
208            *
209            * <p>
210            * 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.
211            * </p>
212            *
213            * @param type the type to search with
214            * @param start the lower bound of the range of list types to return
215            * @param end the upper bound of the range of list types to return (not inclusive)
216            * @return the range of matching list types
217            * @throws SystemException if a system exception occurred
218            */
219            public static java.util.List<com.liferay.portal.model.ListType> findByType(
220                    java.lang.String type, int start, int end)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().findByType(type, start, end);
223            }
224    
225            /**
226            * Finds an ordered range of all the list types where type = &#63;.
227            *
228            * <p>
229            * 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.
230            * </p>
231            *
232            * @param type the type to search with
233            * @param start the lower bound of the range of list types to return
234            * @param end the upper bound of the range of list types to return (not inclusive)
235            * @param orderByComparator the comparator to order the results by
236            * @return the ordered range of matching list types
237            * @throws SystemException if a system exception occurred
238            */
239            public static java.util.List<com.liferay.portal.model.ListType> findByType(
240                    java.lang.String type, int start, int end,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence().findByType(type, start, end, orderByComparator);
244            }
245    
246            /**
247            * Finds the first list type in the ordered set where type = &#63;.
248            *
249            * <p>
250            * 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.
251            * </p>
252            *
253            * @param type the type to search with
254            * @param orderByComparator the comparator to order the set by
255            * @return the first matching list type
256            * @throws com.liferay.portal.NoSuchListTypeException if a matching list type could not be found
257            * @throws SystemException if a system exception occurred
258            */
259            public static com.liferay.portal.model.ListType findByType_First(
260                    java.lang.String type,
261                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
262                    throws com.liferay.portal.NoSuchListTypeException,
263                            com.liferay.portal.kernel.exception.SystemException {
264                    return getPersistence().findByType_First(type, orderByComparator);
265            }
266    
267            /**
268            * Finds the last list type in the ordered set where type = &#63;.
269            *
270            * <p>
271            * 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.
272            * </p>
273            *
274            * @param type the type to search with
275            * @param orderByComparator the comparator to order the set by
276            * @return the last matching list type
277            * @throws com.liferay.portal.NoSuchListTypeException if a matching list type could not be found
278            * @throws SystemException if a system exception occurred
279            */
280            public static com.liferay.portal.model.ListType findByType_Last(
281                    java.lang.String type,
282                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
283                    throws com.liferay.portal.NoSuchListTypeException,
284                            com.liferay.portal.kernel.exception.SystemException {
285                    return getPersistence().findByType_Last(type, orderByComparator);
286            }
287    
288            /**
289            * Finds the list types before and after the current list type in the ordered set where type = &#63;.
290            *
291            * <p>
292            * 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.
293            * </p>
294            *
295            * @param listTypeId the primary key of the current list type
296            * @param type the type to search with
297            * @param orderByComparator the comparator to order the set by
298            * @return the previous, current, and next list type
299            * @throws com.liferay.portal.NoSuchListTypeException if a list type with the primary key could not be found
300            * @throws SystemException if a system exception occurred
301            */
302            public static com.liferay.portal.model.ListType[] findByType_PrevAndNext(
303                    int listTypeId, java.lang.String type,
304                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
305                    throws com.liferay.portal.NoSuchListTypeException,
306                            com.liferay.portal.kernel.exception.SystemException {
307                    return getPersistence()
308                                       .findByType_PrevAndNext(listTypeId, type, orderByComparator);
309            }
310    
311            /**
312            * Finds all the list types.
313            *
314            * @return the list types
315            * @throws SystemException if a system exception occurred
316            */
317            public static java.util.List<com.liferay.portal.model.ListType> findAll()
318                    throws com.liferay.portal.kernel.exception.SystemException {
319                    return getPersistence().findAll();
320            }
321    
322            /**
323            * Finds a range of all the list types.
324            *
325            * <p>
326            * 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.
327            * </p>
328            *
329            * @param start the lower bound of the range of list types to return
330            * @param end the upper bound of the range of list types to return (not inclusive)
331            * @return the range of list types
332            * @throws SystemException if a system exception occurred
333            */
334            public static java.util.List<com.liferay.portal.model.ListType> findAll(
335                    int start, int end)
336                    throws com.liferay.portal.kernel.exception.SystemException {
337                    return getPersistence().findAll(start, end);
338            }
339    
340            /**
341            * Finds an ordered range of all the list types.
342            *
343            * <p>
344            * 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.
345            * </p>
346            *
347            * @param start the lower bound of the range of list types to return
348            * @param end the upper bound of the range of list types to return (not inclusive)
349            * @param orderByComparator the comparator to order the results by
350            * @return the ordered range of list types
351            * @throws SystemException if a system exception occurred
352            */
353            public static java.util.List<com.liferay.portal.model.ListType> findAll(
354                    int start, int end,
355                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
356                    throws com.liferay.portal.kernel.exception.SystemException {
357                    return getPersistence().findAll(start, end, orderByComparator);
358            }
359    
360            /**
361            * Removes all the list types where type = &#63; from the database.
362            *
363            * @param type the type to search with
364            * @throws SystemException if a system exception occurred
365            */
366            public static void removeByType(java.lang.String type)
367                    throws com.liferay.portal.kernel.exception.SystemException {
368                    getPersistence().removeByType(type);
369            }
370    
371            /**
372            * Removes all the list types from the database.
373            *
374            * @throws SystemException if a system exception occurred
375            */
376            public static void removeAll()
377                    throws com.liferay.portal.kernel.exception.SystemException {
378                    getPersistence().removeAll();
379            }
380    
381            /**
382            * Counts all the list types where type = &#63;.
383            *
384            * @param type the type to search with
385            * @return the number of matching list types
386            * @throws SystemException if a system exception occurred
387            */
388            public static int countByType(java.lang.String type)
389                    throws com.liferay.portal.kernel.exception.SystemException {
390                    return getPersistence().countByType(type);
391            }
392    
393            /**
394            * Counts all the list types.
395            *
396            * @return the number of list types
397            * @throws SystemException if a system exception occurred
398            */
399            public static int countAll()
400                    throws com.liferay.portal.kernel.exception.SystemException {
401                    return getPersistence().countAll();
402            }
403    
404            public static ListTypePersistence getPersistence() {
405                    if (_persistence == null) {
406                            _persistence = (ListTypePersistence)PortalBeanLocatorUtil.locate(ListTypePersistence.class.getName());
407                    }
408    
409                    return _persistence;
410            }
411    
412            public void setPersistence(ListTypePersistence persistence) {
413                    _persistence = persistence;
414            }
415    
416            private static ListTypePersistence _persistence;
417    }