001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.util.OrderByComparator;
022    import com.liferay.portal.kernel.util.ReferenceRegistry;
023    import com.liferay.portal.model.ListType;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the list type service. This utility wraps {@link com.liferay.portal.service.persistence.impl.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.
030     *
031     * <p>
032     * Caching information and settings can be found in <code>portal.properties</code>
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see ListTypePersistence
037     * @see com.liferay.portal.service.persistence.impl.ListTypePersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class ListTypeUtil {
042            /*
043             * NOTE FOR DEVELOPERS:
044             *
045             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
046             */
047    
048            /**
049             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
050             */
051            public static void clearCache() {
052                    getPersistence().clearCache();
053            }
054    
055            /**
056             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
057             */
058            public static void clearCache(ListType listType) {
059                    getPersistence().clearCache(listType);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
064             */
065            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<ListType> findWithDynamicQuery(DynamicQuery dynamicQuery) {
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                    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<ListType> findWithDynamicQuery(
088                    DynamicQuery dynamicQuery, int start, int end,
089                    OrderByComparator<ListType> orderByComparator) {
090                    return getPersistence()
091                                       .findWithDynamicQuery(dynamicQuery, start, end,
092                            orderByComparator);
093            }
094    
095            /**
096             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
097             */
098            public static ListType update(ListType listType) {
099                    return getPersistence().update(listType);
100            }
101    
102            /**
103             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
104             */
105            public static ListType update(ListType listType,
106                    ServiceContext serviceContext) {
107                    return getPersistence().update(listType, serviceContext);
108            }
109    
110            /**
111            * Returns all the list types where type = &#63;.
112            *
113            * @param type the type
114            * @return the matching list types
115            */
116            public static List<ListType> findByType(java.lang.String type) {
117                    return getPersistence().findByType(type);
118            }
119    
120            /**
121            * Returns a range of all the list types where type = &#63;.
122            *
123            * <p>
124            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ListTypeModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
125            * </p>
126            *
127            * @param type the type
128            * @param start the lower bound of the range of list types
129            * @param end the upper bound of the range of list types (not inclusive)
130            * @return the range of matching list types
131            */
132            public static List<ListType> findByType(java.lang.String type, int start,
133                    int end) {
134                    return getPersistence().findByType(type, start, end);
135            }
136    
137            /**
138            * Returns an ordered range of all the list types where type = &#63;.
139            *
140            * <p>
141            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ListTypeModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
142            * </p>
143            *
144            * @param type the type
145            * @param start the lower bound of the range of list types
146            * @param end the upper bound of the range of list types (not inclusive)
147            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
148            * @return the ordered range of matching list types
149            */
150            public static List<ListType> findByType(java.lang.String type, int start,
151                    int end, OrderByComparator<ListType> orderByComparator) {
152                    return getPersistence().findByType(type, start, end, orderByComparator);
153            }
154    
155            /**
156            * Returns the first list type in the ordered set where type = &#63;.
157            *
158            * @param type the type
159            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
160            * @return the first matching list type
161            * @throws NoSuchListTypeException if a matching list type could not be found
162            */
163            public static ListType findByType_First(java.lang.String type,
164                    OrderByComparator<ListType> orderByComparator)
165                    throws com.liferay.portal.NoSuchListTypeException {
166                    return getPersistence().findByType_First(type, orderByComparator);
167            }
168    
169            /**
170            * Returns the first list type in the ordered set where type = &#63;.
171            *
172            * @param type the type
173            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
174            * @return the first matching list type, or <code>null</code> if a matching list type could not be found
175            */
176            public static ListType fetchByType_First(java.lang.String type,
177                    OrderByComparator<ListType> orderByComparator) {
178                    return getPersistence().fetchByType_First(type, orderByComparator);
179            }
180    
181            /**
182            * Returns the last list type in the ordered set where type = &#63;.
183            *
184            * @param type the type
185            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
186            * @return the last matching list type
187            * @throws NoSuchListTypeException if a matching list type could not be found
188            */
189            public static ListType findByType_Last(java.lang.String type,
190                    OrderByComparator<ListType> orderByComparator)
191                    throws com.liferay.portal.NoSuchListTypeException {
192                    return getPersistence().findByType_Last(type, orderByComparator);
193            }
194    
195            /**
196            * Returns the last list type in the ordered set where type = &#63;.
197            *
198            * @param type the type
199            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
200            * @return the last matching list type, or <code>null</code> if a matching list type could not be found
201            */
202            public static ListType fetchByType_Last(java.lang.String type,
203                    OrderByComparator<ListType> orderByComparator) {
204                    return getPersistence().fetchByType_Last(type, orderByComparator);
205            }
206    
207            /**
208            * Returns the list types before and after the current list type in the ordered set where type = &#63;.
209            *
210            * @param listTypeId the primary key of the current list type
211            * @param type the type
212            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
213            * @return the previous, current, and next list type
214            * @throws NoSuchListTypeException if a list type with the primary key could not be found
215            */
216            public static ListType[] findByType_PrevAndNext(long listTypeId,
217                    java.lang.String type, OrderByComparator<ListType> orderByComparator)
218                    throws com.liferay.portal.NoSuchListTypeException {
219                    return getPersistence()
220                                       .findByType_PrevAndNext(listTypeId, type, orderByComparator);
221            }
222    
223            /**
224            * Removes all the list types where type = &#63; from the database.
225            *
226            * @param type the type
227            */
228            public static void removeByType(java.lang.String type) {
229                    getPersistence().removeByType(type);
230            }
231    
232            /**
233            * Returns the number of list types where type = &#63;.
234            *
235            * @param type the type
236            * @return the number of matching list types
237            */
238            public static int countByType(java.lang.String type) {
239                    return getPersistence().countByType(type);
240            }
241    
242            /**
243            * Returns the list type where name = &#63; and type = &#63; or throws a {@link NoSuchListTypeException} if it could not be found.
244            *
245            * @param name the name
246            * @param type the type
247            * @return the matching list type
248            * @throws NoSuchListTypeException if a matching list type could not be found
249            */
250            public static ListType findByN_T(java.lang.String name,
251                    java.lang.String type)
252                    throws com.liferay.portal.NoSuchListTypeException {
253                    return getPersistence().findByN_T(name, type);
254            }
255    
256            /**
257            * Returns the list type where name = &#63; and type = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
258            *
259            * @param name the name
260            * @param type the type
261            * @return the matching list type, or <code>null</code> if a matching list type could not be found
262            */
263            public static ListType fetchByN_T(java.lang.String name,
264                    java.lang.String type) {
265                    return getPersistence().fetchByN_T(name, type);
266            }
267    
268            /**
269            * Returns the list type where name = &#63; and type = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
270            *
271            * @param name the name
272            * @param type the type
273            * @param retrieveFromCache whether to use the finder cache
274            * @return the matching list type, or <code>null</code> if a matching list type could not be found
275            */
276            public static ListType fetchByN_T(java.lang.String name,
277                    java.lang.String type, boolean retrieveFromCache) {
278                    return getPersistence().fetchByN_T(name, type, retrieveFromCache);
279            }
280    
281            /**
282            * Removes the list type where name = &#63; and type = &#63; from the database.
283            *
284            * @param name the name
285            * @param type the type
286            * @return the list type that was removed
287            */
288            public static ListType removeByN_T(java.lang.String name,
289                    java.lang.String type)
290                    throws com.liferay.portal.NoSuchListTypeException {
291                    return getPersistence().removeByN_T(name, type);
292            }
293    
294            /**
295            * Returns the number of list types where name = &#63; and type = &#63;.
296            *
297            * @param name the name
298            * @param type the type
299            * @return the number of matching list types
300            */
301            public static int countByN_T(java.lang.String name, java.lang.String type) {
302                    return getPersistence().countByN_T(name, type);
303            }
304    
305            /**
306            * Caches the list type in the entity cache if it is enabled.
307            *
308            * @param listType the list type
309            */
310            public static void cacheResult(ListType listType) {
311                    getPersistence().cacheResult(listType);
312            }
313    
314            /**
315            * Caches the list types in the entity cache if it is enabled.
316            *
317            * @param listTypes the list types
318            */
319            public static void cacheResult(List<ListType> listTypes) {
320                    getPersistence().cacheResult(listTypes);
321            }
322    
323            /**
324            * Creates a new list type with the primary key. Does not add the list type to the database.
325            *
326            * @param listTypeId the primary key for the new list type
327            * @return the new list type
328            */
329            public static ListType create(long listTypeId) {
330                    return getPersistence().create(listTypeId);
331            }
332    
333            /**
334            * Removes the list type with the primary key from the database. Also notifies the appropriate model listeners.
335            *
336            * @param listTypeId the primary key of the list type
337            * @return the list type that was removed
338            * @throws NoSuchListTypeException if a list type with the primary key could not be found
339            */
340            public static ListType remove(long listTypeId)
341                    throws com.liferay.portal.NoSuchListTypeException {
342                    return getPersistence().remove(listTypeId);
343            }
344    
345            public static ListType updateImpl(ListType listType) {
346                    return getPersistence().updateImpl(listType);
347            }
348    
349            /**
350            * Returns the list type with the primary key or throws a {@link NoSuchListTypeException} if it could not be found.
351            *
352            * @param listTypeId the primary key of the list type
353            * @return the list type
354            * @throws NoSuchListTypeException if a list type with the primary key could not be found
355            */
356            public static ListType findByPrimaryKey(long listTypeId)
357                    throws com.liferay.portal.NoSuchListTypeException {
358                    return getPersistence().findByPrimaryKey(listTypeId);
359            }
360    
361            /**
362            * Returns the list type with the primary key or returns <code>null</code> if it could not be found.
363            *
364            * @param listTypeId the primary key of the list type
365            * @return the list type, or <code>null</code> if a list type with the primary key could not be found
366            */
367            public static ListType fetchByPrimaryKey(long listTypeId) {
368                    return getPersistence().fetchByPrimaryKey(listTypeId);
369            }
370    
371            public static java.util.Map<java.io.Serializable, ListType> fetchByPrimaryKeys(
372                    java.util.Set<java.io.Serializable> primaryKeys) {
373                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
374            }
375    
376            /**
377            * Returns all the list types.
378            *
379            * @return the list types
380            */
381            public static List<ListType> findAll() {
382                    return getPersistence().findAll();
383            }
384    
385            /**
386            * Returns a range of all the list types.
387            *
388            * <p>
389            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ListTypeModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
390            * </p>
391            *
392            * @param start the lower bound of the range of list types
393            * @param end the upper bound of the range of list types (not inclusive)
394            * @return the range of list types
395            */
396            public static List<ListType> findAll(int start, int end) {
397                    return getPersistence().findAll(start, end);
398            }
399    
400            /**
401            * Returns an ordered range of all the list types.
402            *
403            * <p>
404            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ListTypeModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
405            * </p>
406            *
407            * @param start the lower bound of the range of list types
408            * @param end the upper bound of the range of list types (not inclusive)
409            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
410            * @return the ordered range of list types
411            */
412            public static List<ListType> findAll(int start, int end,
413                    OrderByComparator<ListType> orderByComparator) {
414                    return getPersistence().findAll(start, end, orderByComparator);
415            }
416    
417            /**
418            * Removes all the list types from the database.
419            */
420            public static void removeAll() {
421                    getPersistence().removeAll();
422            }
423    
424            /**
425            * Returns the number of list types.
426            *
427            * @return the number of list types
428            */
429            public static int countAll() {
430                    return getPersistence().countAll();
431            }
432    
433            public static ListTypePersistence getPersistence() {
434                    if (_persistence == null) {
435                            _persistence = (ListTypePersistence)PortalBeanLocatorUtil.locate(ListTypePersistence.class.getName());
436    
437                            ReferenceRegistry.registerReference(ListTypeUtil.class,
438                                    "_persistence");
439                    }
440    
441                    return _persistence;
442            }
443    
444            /**
445             * @deprecated As of 6.2.0
446             */
447            @Deprecated
448            public void setPersistence(ListTypePersistence persistence) {
449            }
450    
451            private static ListTypePersistence _persistence;
452    }