1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  import com.liferay.portal.model.ClassName;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="ClassNameUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       ClassNamePersistence
35   * @see       ClassNamePersistenceImpl
36   * @generated
37   */
38  public class ClassNameUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(ClassName)
48       */
49      public static void clearCache(ClassName className) {
50          getPersistence().clearCache(className);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65          throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
73          int start, int end) throws SystemException {
74          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
79       */
80      public static ClassName remove(ClassName className)
81          throws SystemException {
82          return getPersistence().remove(className);
83      }
84  
85      /**
86       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
87       */
88      public static ClassName update(ClassName className, boolean merge)
89          throws SystemException {
90          return getPersistence().update(className, merge);
91      }
92  
93      public static void cacheResult(com.liferay.portal.model.ClassName className) {
94          getPersistence().cacheResult(className);
95      }
96  
97      public static void cacheResult(
98          java.util.List<com.liferay.portal.model.ClassName> classNames) {
99          getPersistence().cacheResult(classNames);
100     }
101 
102     public static com.liferay.portal.model.ClassName create(long classNameId) {
103         return getPersistence().create(classNameId);
104     }
105 
106     public static com.liferay.portal.model.ClassName remove(long classNameId)
107         throws com.liferay.portal.NoSuchClassNameException,
108             com.liferay.portal.SystemException {
109         return getPersistence().remove(classNameId);
110     }
111 
112     /**
113      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
114      */
115     public static com.liferay.portal.model.ClassName update(
116         com.liferay.portal.model.ClassName className)
117         throws com.liferay.portal.SystemException {
118         return getPersistence().update(className);
119     }
120 
121     public static com.liferay.portal.model.ClassName updateImpl(
122         com.liferay.portal.model.ClassName className, boolean merge)
123         throws com.liferay.portal.SystemException {
124         return getPersistence().updateImpl(className, merge);
125     }
126 
127     public static com.liferay.portal.model.ClassName findByPrimaryKey(
128         long classNameId)
129         throws com.liferay.portal.NoSuchClassNameException,
130             com.liferay.portal.SystemException {
131         return getPersistence().findByPrimaryKey(classNameId);
132     }
133 
134     public static com.liferay.portal.model.ClassName fetchByPrimaryKey(
135         long classNameId) throws com.liferay.portal.SystemException {
136         return getPersistence().fetchByPrimaryKey(classNameId);
137     }
138 
139     public static com.liferay.portal.model.ClassName findByValue(
140         java.lang.String value)
141         throws com.liferay.portal.NoSuchClassNameException,
142             com.liferay.portal.SystemException {
143         return getPersistence().findByValue(value);
144     }
145 
146     public static com.liferay.portal.model.ClassName fetchByValue(
147         java.lang.String value) throws com.liferay.portal.SystemException {
148         return getPersistence().fetchByValue(value);
149     }
150 
151     public static com.liferay.portal.model.ClassName fetchByValue(
152         java.lang.String value, boolean retrieveFromCache)
153         throws com.liferay.portal.SystemException {
154         return getPersistence().fetchByValue(value, retrieveFromCache);
155     }
156 
157     public static java.util.List<com.liferay.portal.model.ClassName> findAll()
158         throws com.liferay.portal.SystemException {
159         return getPersistence().findAll();
160     }
161 
162     public static java.util.List<com.liferay.portal.model.ClassName> findAll(
163         int start, int end) throws com.liferay.portal.SystemException {
164         return getPersistence().findAll(start, end);
165     }
166 
167     public static java.util.List<com.liferay.portal.model.ClassName> findAll(
168         int start, int end,
169         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
170         throws com.liferay.portal.SystemException {
171         return getPersistence().findAll(start, end, orderByComparator);
172     }
173 
174     public static void removeByValue(java.lang.String value)
175         throws com.liferay.portal.NoSuchClassNameException,
176             com.liferay.portal.SystemException {
177         getPersistence().removeByValue(value);
178     }
179 
180     public static void removeAll() throws com.liferay.portal.SystemException {
181         getPersistence().removeAll();
182     }
183 
184     public static int countByValue(java.lang.String value)
185         throws com.liferay.portal.SystemException {
186         return getPersistence().countByValue(value);
187     }
188 
189     public static int countAll() throws com.liferay.portal.SystemException {
190         return getPersistence().countAll();
191     }
192 
193     public static ClassNamePersistence getPersistence() {
194         if (_persistence == null) {
195             _persistence = (ClassNamePersistence)PortalBeanLocatorUtil.locate(ClassNamePersistence.class.getName());
196 
197             ReferenceRegistry.registerReference(ClassNameUtil.class,
198                 "_persistence");
199         }
200 
201         return _persistence;
202     }
203 
204     public void setPersistence(ClassNamePersistence persistence) {
205         _persistence = persistence;
206 
207         ReferenceRegistry.registerReference(ClassNameUtil.class, "_persistence");
208     }
209 
210     private static ClassNamePersistence _persistence;
211 }