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