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.ClassName;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * The persistence utility for the class name service.
028     *
029     * <p>
030     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
031     * </p>
032     *
033     * @author Brian Wing Shun Chan
034     * @see ClassNamePersistence
035     * @see ClassNamePersistenceImpl
036     * @generated
037     */
038    public class ClassNameUtil {
039            /**
040             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
041             */
042            public static void clearCache() {
043                    getPersistence().clearCache();
044            }
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
048             */
049            public static void clearCache(ClassName className) {
050                    getPersistence().clearCache(className);
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
055             */
056            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
057                    throws SystemException {
058                    return getPersistence().countWithDynamicQuery(dynamicQuery);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
063             */
064            public static List<ClassName> findWithDynamicQuery(
065                    DynamicQuery dynamicQuery) throws SystemException {
066                    return getPersistence().findWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
071             */
072            public static List<ClassName> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery, int start, int end)
074                    throws SystemException {
075                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
076            }
077    
078            /**
079             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
080             */
081            public static List<ClassName> findWithDynamicQuery(
082                    DynamicQuery dynamicQuery, int start, int end,
083                    OrderByComparator orderByComparator) throws SystemException {
084                    return getPersistence()
085                                       .findWithDynamicQuery(dynamicQuery, start, end,
086                            orderByComparator);
087            }
088    
089            /**
090             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
091             */
092            public static ClassName remove(ClassName className)
093                    throws SystemException {
094                    return getPersistence().remove(className);
095            }
096    
097            /**
098             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
099             */
100            public static ClassName update(ClassName className, boolean merge)
101                    throws SystemException {
102                    return getPersistence().update(className, merge);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
107             */
108            public static ClassName update(ClassName className, boolean merge,
109                    ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(className, merge, serviceContext);
111            }
112    
113            /**
114            * Caches the class name in the entity cache if it is enabled.
115            *
116            * @param className the class name to cache
117            */
118            public static void cacheResult(com.liferay.portal.model.ClassName className) {
119                    getPersistence().cacheResult(className);
120            }
121    
122            /**
123            * Caches the class names in the entity cache if it is enabled.
124            *
125            * @param classNames the class names to cache
126            */
127            public static void cacheResult(
128                    java.util.List<com.liferay.portal.model.ClassName> classNames) {
129                    getPersistence().cacheResult(classNames);
130            }
131    
132            /**
133            * Creates a new class name with the primary key.
134            *
135            * @param classNameId the primary key for the new class name
136            * @return the new class name
137            */
138            public static com.liferay.portal.model.ClassName create(long classNameId) {
139                    return getPersistence().create(classNameId);
140            }
141    
142            /**
143            * Removes the class name with the primary key from the database. Also notifies the appropriate model listeners.
144            *
145            * @param classNameId the primary key of the class name to remove
146            * @return the class name that was removed
147            * @throws com.liferay.portal.NoSuchClassNameException if a class name with the primary key could not be found
148            * @throws SystemException if a system exception occurred
149            */
150            public static com.liferay.portal.model.ClassName remove(long classNameId)
151                    throws com.liferay.portal.NoSuchClassNameException,
152                            com.liferay.portal.kernel.exception.SystemException {
153                    return getPersistence().remove(classNameId);
154            }
155    
156            public static com.liferay.portal.model.ClassName updateImpl(
157                    com.liferay.portal.model.ClassName className, boolean merge)
158                    throws com.liferay.portal.kernel.exception.SystemException {
159                    return getPersistence().updateImpl(className, merge);
160            }
161    
162            /**
163            * Finds the class name with the primary key or throws a {@link com.liferay.portal.NoSuchClassNameException} if it could not be found.
164            *
165            * @param classNameId the primary key of the class name to find
166            * @return the class name
167            * @throws com.liferay.portal.NoSuchClassNameException if a class name with the primary key could not be found
168            * @throws SystemException if a system exception occurred
169            */
170            public static com.liferay.portal.model.ClassName findByPrimaryKey(
171                    long classNameId)
172                    throws com.liferay.portal.NoSuchClassNameException,
173                            com.liferay.portal.kernel.exception.SystemException {
174                    return getPersistence().findByPrimaryKey(classNameId);
175            }
176    
177            /**
178            * Finds the class name with the primary key or returns <code>null</code> if it could not be found.
179            *
180            * @param classNameId the primary key of the class name to find
181            * @return the class name, or <code>null</code> if a class name with the primary key could not be found
182            * @throws SystemException if a system exception occurred
183            */
184            public static com.liferay.portal.model.ClassName fetchByPrimaryKey(
185                    long classNameId)
186                    throws com.liferay.portal.kernel.exception.SystemException {
187                    return getPersistence().fetchByPrimaryKey(classNameId);
188            }
189    
190            /**
191            * Finds the class name where value = &#63; or throws a {@link com.liferay.portal.NoSuchClassNameException} if it could not be found.
192            *
193            * @param value the value to search with
194            * @return the matching class name
195            * @throws com.liferay.portal.NoSuchClassNameException if a matching class name could not be found
196            * @throws SystemException if a system exception occurred
197            */
198            public static com.liferay.portal.model.ClassName findByValue(
199                    java.lang.String value)
200                    throws com.liferay.portal.NoSuchClassNameException,
201                            com.liferay.portal.kernel.exception.SystemException {
202                    return getPersistence().findByValue(value);
203            }
204    
205            /**
206            * Finds the class name where value = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
207            *
208            * @param value the value to search with
209            * @return the matching class name, or <code>null</code> if a matching class name could not be found
210            * @throws SystemException if a system exception occurred
211            */
212            public static com.liferay.portal.model.ClassName fetchByValue(
213                    java.lang.String value)
214                    throws com.liferay.portal.kernel.exception.SystemException {
215                    return getPersistence().fetchByValue(value);
216            }
217    
218            /**
219            * Finds the class name where value = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
220            *
221            * @param value the value to search with
222            * @return the matching class name, or <code>null</code> if a matching class name could not be found
223            * @throws SystemException if a system exception occurred
224            */
225            public static com.liferay.portal.model.ClassName fetchByValue(
226                    java.lang.String value, boolean retrieveFromCache)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getPersistence().fetchByValue(value, retrieveFromCache);
229            }
230    
231            /**
232            * Finds all the class names.
233            *
234            * @return the class names
235            * @throws SystemException if a system exception occurred
236            */
237            public static java.util.List<com.liferay.portal.model.ClassName> findAll()
238                    throws com.liferay.portal.kernel.exception.SystemException {
239                    return getPersistence().findAll();
240            }
241    
242            /**
243            * Finds a range of all the class names.
244            *
245            * <p>
246            * 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.
247            * </p>
248            *
249            * @param start the lower bound of the range of class names to return
250            * @param end the upper bound of the range of class names to return (not inclusive)
251            * @return the range of class names
252            * @throws SystemException if a system exception occurred
253            */
254            public static java.util.List<com.liferay.portal.model.ClassName> findAll(
255                    int start, int end)
256                    throws com.liferay.portal.kernel.exception.SystemException {
257                    return getPersistence().findAll(start, end);
258            }
259    
260            /**
261            * Finds an ordered range of all the class names.
262            *
263            * <p>
264            * 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.
265            * </p>
266            *
267            * @param start the lower bound of the range of class names to return
268            * @param end the upper bound of the range of class names to return (not inclusive)
269            * @param orderByComparator the comparator to order the results by
270            * @return the ordered range of class names
271            * @throws SystemException if a system exception occurred
272            */
273            public static java.util.List<com.liferay.portal.model.ClassName> findAll(
274                    int start, int end,
275                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
276                    throws com.liferay.portal.kernel.exception.SystemException {
277                    return getPersistence().findAll(start, end, orderByComparator);
278            }
279    
280            /**
281            * Removes the class name where value = &#63; from the database.
282            *
283            * @param value the value to search with
284            * @throws SystemException if a system exception occurred
285            */
286            public static void removeByValue(java.lang.String value)
287                    throws com.liferay.portal.NoSuchClassNameException,
288                            com.liferay.portal.kernel.exception.SystemException {
289                    getPersistence().removeByValue(value);
290            }
291    
292            /**
293            * Removes all the class names from the database.
294            *
295            * @throws SystemException if a system exception occurred
296            */
297            public static void removeAll()
298                    throws com.liferay.portal.kernel.exception.SystemException {
299                    getPersistence().removeAll();
300            }
301    
302            /**
303            * Counts all the class names where value = &#63;.
304            *
305            * @param value the value to search with
306            * @return the number of matching class names
307            * @throws SystemException if a system exception occurred
308            */
309            public static int countByValue(java.lang.String value)
310                    throws com.liferay.portal.kernel.exception.SystemException {
311                    return getPersistence().countByValue(value);
312            }
313    
314            /**
315            * Counts all the class names.
316            *
317            * @return the number of class names
318            * @throws SystemException if a system exception occurred
319            */
320            public static int countAll()
321                    throws com.liferay.portal.kernel.exception.SystemException {
322                    return getPersistence().countAll();
323            }
324    
325            public static ClassNamePersistence getPersistence() {
326                    if (_persistence == null) {
327                            _persistence = (ClassNamePersistence)PortalBeanLocatorUtil.locate(ClassNamePersistence.class.getName());
328                    }
329    
330                    return _persistence;
331            }
332    
333            public void setPersistence(ClassNamePersistence persistence) {
334                    _persistence = persistence;
335            }
336    
337            private static ClassNamePersistence _persistence;
338    }