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