1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="CompanyUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class CompanyUtil {
32      public static void cacheResult(com.liferay.portal.model.Company company) {
33          getPersistence().cacheResult(company);
34      }
35  
36      public static void cacheResult(
37          java.util.List<com.liferay.portal.model.Company> companies) {
38          getPersistence().cacheResult(companies);
39      }
40  
41      public static void clearCache() {
42          getPersistence().clearCache();
43      }
44  
45      public static com.liferay.portal.model.Company create(long companyId) {
46          return getPersistence().create(companyId);
47      }
48  
49      public static com.liferay.portal.model.Company remove(long companyId)
50          throws com.liferay.portal.NoSuchCompanyException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(companyId);
53      }
54  
55      public static com.liferay.portal.model.Company remove(
56          com.liferay.portal.model.Company company)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(company);
59      }
60  
61      /**
62       * @deprecated Use <code>update(Company company, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.Company update(
65          com.liferay.portal.model.Company company)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(company);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        company the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when company is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.Company update(
84          com.liferay.portal.model.Company company, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(company, merge);
87      }
88  
89      public static com.liferay.portal.model.Company updateImpl(
90          com.liferay.portal.model.Company company, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(company, merge);
93      }
94  
95      public static com.liferay.portal.model.Company findByPrimaryKey(
96          long companyId)
97          throws com.liferay.portal.NoSuchCompanyException,
98              com.liferay.portal.SystemException {
99          return getPersistence().findByPrimaryKey(companyId);
100     }
101 
102     public static com.liferay.portal.model.Company fetchByPrimaryKey(
103         long companyId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(companyId);
105     }
106 
107     public static com.liferay.portal.model.Company findByWebId(
108         java.lang.String webId)
109         throws com.liferay.portal.NoSuchCompanyException,
110             com.liferay.portal.SystemException {
111         return getPersistence().findByWebId(webId);
112     }
113 
114     public static com.liferay.portal.model.Company fetchByWebId(
115         java.lang.String webId) throws com.liferay.portal.SystemException {
116         return getPersistence().fetchByWebId(webId);
117     }
118 
119     public static com.liferay.portal.model.Company fetchByWebId(
120         java.lang.String webId, boolean retrieveFromCache)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().fetchByWebId(webId, retrieveFromCache);
123     }
124 
125     public static com.liferay.portal.model.Company findByVirtualHost(
126         java.lang.String virtualHost)
127         throws com.liferay.portal.NoSuchCompanyException,
128             com.liferay.portal.SystemException {
129         return getPersistence().findByVirtualHost(virtualHost);
130     }
131 
132     public static com.liferay.portal.model.Company fetchByVirtualHost(
133         java.lang.String virtualHost) throws com.liferay.portal.SystemException {
134         return getPersistence().fetchByVirtualHost(virtualHost);
135     }
136 
137     public static com.liferay.portal.model.Company fetchByVirtualHost(
138         java.lang.String virtualHost, boolean retrieveFromCache)
139         throws com.liferay.portal.SystemException {
140         return getPersistence()
141                    .fetchByVirtualHost(virtualHost, retrieveFromCache);
142     }
143 
144     public static com.liferay.portal.model.Company findByMx(java.lang.String mx)
145         throws com.liferay.portal.NoSuchCompanyException,
146             com.liferay.portal.SystemException {
147         return getPersistence().findByMx(mx);
148     }
149 
150     public static com.liferay.portal.model.Company fetchByMx(
151         java.lang.String mx) throws com.liferay.portal.SystemException {
152         return getPersistence().fetchByMx(mx);
153     }
154 
155     public static com.liferay.portal.model.Company fetchByMx(
156         java.lang.String mx, boolean retrieveFromCache)
157         throws com.liferay.portal.SystemException {
158         return getPersistence().fetchByMx(mx, retrieveFromCache);
159     }
160 
161     public static com.liferay.portal.model.Company findByLogoId(long logoId)
162         throws com.liferay.portal.NoSuchCompanyException,
163             com.liferay.portal.SystemException {
164         return getPersistence().findByLogoId(logoId);
165     }
166 
167     public static com.liferay.portal.model.Company fetchByLogoId(long logoId)
168         throws com.liferay.portal.SystemException {
169         return getPersistence().fetchByLogoId(logoId);
170     }
171 
172     public static com.liferay.portal.model.Company fetchByLogoId(long logoId,
173         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
174         return getPersistence().fetchByLogoId(logoId, retrieveFromCache);
175     }
176 
177     public static java.util.List<com.liferay.portal.model.Company> findBySystem(
178         boolean system) throws com.liferay.portal.SystemException {
179         return getPersistence().findBySystem(system);
180     }
181 
182     public static java.util.List<com.liferay.portal.model.Company> findBySystem(
183         boolean system, int start, int end)
184         throws com.liferay.portal.SystemException {
185         return getPersistence().findBySystem(system, start, end);
186     }
187 
188     public static java.util.List<com.liferay.portal.model.Company> findBySystem(
189         boolean system, int start, int end,
190         com.liferay.portal.kernel.util.OrderByComparator obc)
191         throws com.liferay.portal.SystemException {
192         return getPersistence().findBySystem(system, start, end, obc);
193     }
194 
195     public static com.liferay.portal.model.Company findBySystem_First(
196         boolean system, com.liferay.portal.kernel.util.OrderByComparator obc)
197         throws com.liferay.portal.NoSuchCompanyException,
198             com.liferay.portal.SystemException {
199         return getPersistence().findBySystem_First(system, obc);
200     }
201 
202     public static com.liferay.portal.model.Company findBySystem_Last(
203         boolean system, com.liferay.portal.kernel.util.OrderByComparator obc)
204         throws com.liferay.portal.NoSuchCompanyException,
205             com.liferay.portal.SystemException {
206         return getPersistence().findBySystem_Last(system, obc);
207     }
208 
209     public static com.liferay.portal.model.Company[] findBySystem_PrevAndNext(
210         long companyId, boolean system,
211         com.liferay.portal.kernel.util.OrderByComparator obc)
212         throws com.liferay.portal.NoSuchCompanyException,
213             com.liferay.portal.SystemException {
214         return getPersistence().findBySystem_PrevAndNext(companyId, system, obc);
215     }
216 
217     public static java.util.List<Object> findWithDynamicQuery(
218         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
219         throws com.liferay.portal.SystemException {
220         return getPersistence().findWithDynamicQuery(dynamicQuery);
221     }
222 
223     public static java.util.List<Object> findWithDynamicQuery(
224         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
225         int end) throws com.liferay.portal.SystemException {
226         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
227     }
228 
229     public static java.util.List<com.liferay.portal.model.Company> findAll()
230         throws com.liferay.portal.SystemException {
231         return getPersistence().findAll();
232     }
233 
234     public static java.util.List<com.liferay.portal.model.Company> findAll(
235         int start, int end) throws com.liferay.portal.SystemException {
236         return getPersistence().findAll(start, end);
237     }
238 
239     public static java.util.List<com.liferay.portal.model.Company> findAll(
240         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
241         throws com.liferay.portal.SystemException {
242         return getPersistence().findAll(start, end, obc);
243     }
244 
245     public static void removeByWebId(java.lang.String webId)
246         throws com.liferay.portal.NoSuchCompanyException,
247             com.liferay.portal.SystemException {
248         getPersistence().removeByWebId(webId);
249     }
250 
251     public static void removeByVirtualHost(java.lang.String virtualHost)
252         throws com.liferay.portal.NoSuchCompanyException,
253             com.liferay.portal.SystemException {
254         getPersistence().removeByVirtualHost(virtualHost);
255     }
256 
257     public static void removeByMx(java.lang.String mx)
258         throws com.liferay.portal.NoSuchCompanyException,
259             com.liferay.portal.SystemException {
260         getPersistence().removeByMx(mx);
261     }
262 
263     public static void removeByLogoId(long logoId)
264         throws com.liferay.portal.NoSuchCompanyException,
265             com.liferay.portal.SystemException {
266         getPersistence().removeByLogoId(logoId);
267     }
268 
269     public static void removeBySystem(boolean system)
270         throws com.liferay.portal.SystemException {
271         getPersistence().removeBySystem(system);
272     }
273 
274     public static void removeAll() throws com.liferay.portal.SystemException {
275         getPersistence().removeAll();
276     }
277 
278     public static int countByWebId(java.lang.String webId)
279         throws com.liferay.portal.SystemException {
280         return getPersistence().countByWebId(webId);
281     }
282 
283     public static int countByVirtualHost(java.lang.String virtualHost)
284         throws com.liferay.portal.SystemException {
285         return getPersistence().countByVirtualHost(virtualHost);
286     }
287 
288     public static int countByMx(java.lang.String mx)
289         throws com.liferay.portal.SystemException {
290         return getPersistence().countByMx(mx);
291     }
292 
293     public static int countByLogoId(long logoId)
294         throws com.liferay.portal.SystemException {
295         return getPersistence().countByLogoId(logoId);
296     }
297 
298     public static int countBySystem(boolean system)
299         throws com.liferay.portal.SystemException {
300         return getPersistence().countBySystem(system);
301     }
302 
303     public static int countAll() throws com.liferay.portal.SystemException {
304         return getPersistence().countAll();
305     }
306 
307     public static CompanyPersistence getPersistence() {
308         return _persistence;
309     }
310 
311     public void setPersistence(CompanyPersistence persistence) {
312         _persistence = persistence;
313     }
314 
315     private static CompanyPersistence _persistence;
316 }