1   /**
2    * Copyright (c) 2000-2008 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 com.liferay.portal.model.Company create(long companyId) {
33          return getPersistence().create(companyId);
34      }
35  
36      public static com.liferay.portal.model.Company remove(long companyId)
37          throws com.liferay.portal.SystemException,
38              com.liferay.portal.NoSuchCompanyException {
39          return getPersistence().remove(companyId);
40      }
41  
42      public static com.liferay.portal.model.Company remove(
43          com.liferay.portal.model.Company company)
44          throws com.liferay.portal.SystemException {
45          return getPersistence().remove(company);
46      }
47  
48      /**
49       * @deprecated Use <code>update(Company company, boolean merge)</code>.
50       */
51      public static com.liferay.portal.model.Company update(
52          com.liferay.portal.model.Company company)
53          throws com.liferay.portal.SystemException {
54          return getPersistence().update(company);
55      }
56  
57      /**
58       * Add, update, or merge, the entity. This method also calls the model
59       * listeners to trigger the proper events associated with adding, deleting,
60       * or updating an entity.
61       *
62       * @param        company the entity to add, update, or merge
63       * @param        merge boolean value for whether to merge the entity. The
64       *                default value is false. Setting merge to true is more
65       *                expensive and should only be true when company is
66       *                transient. See LEP-5473 for a detailed discussion of this
67       *                method.
68       * @return        true if the portlet can be displayed via Ajax
69       */
70      public static com.liferay.portal.model.Company update(
71          com.liferay.portal.model.Company company, boolean merge)
72          throws com.liferay.portal.SystemException {
73          return getPersistence().update(company, merge);
74      }
75  
76      public static com.liferay.portal.model.Company updateImpl(
77          com.liferay.portal.model.Company company, boolean merge)
78          throws com.liferay.portal.SystemException {
79          return getPersistence().updateImpl(company, merge);
80      }
81  
82      public static com.liferay.portal.model.Company findByPrimaryKey(
83          long companyId)
84          throws com.liferay.portal.SystemException,
85              com.liferay.portal.NoSuchCompanyException {
86          return getPersistence().findByPrimaryKey(companyId);
87      }
88  
89      public static com.liferay.portal.model.Company fetchByPrimaryKey(
90          long companyId) throws com.liferay.portal.SystemException {
91          return getPersistence().fetchByPrimaryKey(companyId);
92      }
93  
94      public static com.liferay.portal.model.Company findByWebId(
95          java.lang.String webId)
96          throws com.liferay.portal.SystemException,
97              com.liferay.portal.NoSuchCompanyException {
98          return getPersistence().findByWebId(webId);
99      }
100 
101     public static com.liferay.portal.model.Company fetchByWebId(
102         java.lang.String webId) throws com.liferay.portal.SystemException {
103         return getPersistence().fetchByWebId(webId);
104     }
105 
106     public static com.liferay.portal.model.Company findByVirtualHost(
107         java.lang.String virtualHost)
108         throws com.liferay.portal.SystemException,
109             com.liferay.portal.NoSuchCompanyException {
110         return getPersistence().findByVirtualHost(virtualHost);
111     }
112 
113     public static com.liferay.portal.model.Company fetchByVirtualHost(
114         java.lang.String virtualHost) throws com.liferay.portal.SystemException {
115         return getPersistence().fetchByVirtualHost(virtualHost);
116     }
117 
118     public static com.liferay.portal.model.Company findByMx(java.lang.String mx)
119         throws com.liferay.portal.SystemException,
120             com.liferay.portal.NoSuchCompanyException {
121         return getPersistence().findByMx(mx);
122     }
123 
124     public static com.liferay.portal.model.Company fetchByMx(
125         java.lang.String mx) throws com.liferay.portal.SystemException {
126         return getPersistence().fetchByMx(mx);
127     }
128 
129     public static com.liferay.portal.model.Company findByLogoId(long logoId)
130         throws com.liferay.portal.SystemException,
131             com.liferay.portal.NoSuchCompanyException {
132         return getPersistence().findByLogoId(logoId);
133     }
134 
135     public static com.liferay.portal.model.Company fetchByLogoId(long logoId)
136         throws com.liferay.portal.SystemException {
137         return getPersistence().fetchByLogoId(logoId);
138     }
139 
140     public static java.util.List<com.liferay.portal.model.Company> findWithDynamicQuery(
141         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
142         throws com.liferay.portal.SystemException {
143         return getPersistence().findWithDynamicQuery(queryInitializer);
144     }
145 
146     public static java.util.List<com.liferay.portal.model.Company> findWithDynamicQuery(
147         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
148         int begin, int end) throws com.liferay.portal.SystemException {
149         return getPersistence()
150                    .findWithDynamicQuery(queryInitializer, begin, end);
151     }
152 
153     public static java.util.List<com.liferay.portal.model.Company> findAll()
154         throws com.liferay.portal.SystemException {
155         return getPersistence().findAll();
156     }
157 
158     public static java.util.List<com.liferay.portal.model.Company> findAll(
159         int begin, int end) throws com.liferay.portal.SystemException {
160         return getPersistence().findAll(begin, end);
161     }
162 
163     public static java.util.List<com.liferay.portal.model.Company> findAll(
164         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.SystemException {
166         return getPersistence().findAll(begin, end, obc);
167     }
168 
169     public static void removeByWebId(java.lang.String webId)
170         throws com.liferay.portal.SystemException,
171             com.liferay.portal.NoSuchCompanyException {
172         getPersistence().removeByWebId(webId);
173     }
174 
175     public static void removeByVirtualHost(java.lang.String virtualHost)
176         throws com.liferay.portal.SystemException,
177             com.liferay.portal.NoSuchCompanyException {
178         getPersistence().removeByVirtualHost(virtualHost);
179     }
180 
181     public static void removeByMx(java.lang.String mx)
182         throws com.liferay.portal.SystemException,
183             com.liferay.portal.NoSuchCompanyException {
184         getPersistence().removeByMx(mx);
185     }
186 
187     public static void removeByLogoId(long logoId)
188         throws com.liferay.portal.SystemException,
189             com.liferay.portal.NoSuchCompanyException {
190         getPersistence().removeByLogoId(logoId);
191     }
192 
193     public static void removeAll() throws com.liferay.portal.SystemException {
194         getPersistence().removeAll();
195     }
196 
197     public static int countByWebId(java.lang.String webId)
198         throws com.liferay.portal.SystemException {
199         return getPersistence().countByWebId(webId);
200     }
201 
202     public static int countByVirtualHost(java.lang.String virtualHost)
203         throws com.liferay.portal.SystemException {
204         return getPersistence().countByVirtualHost(virtualHost);
205     }
206 
207     public static int countByMx(java.lang.String mx)
208         throws com.liferay.portal.SystemException {
209         return getPersistence().countByMx(mx);
210     }
211 
212     public static int countByLogoId(long logoId)
213         throws com.liferay.portal.SystemException {
214         return getPersistence().countByLogoId(logoId);
215     }
216 
217     public static int countAll() throws com.liferay.portal.SystemException {
218         return getPersistence().countAll();
219     }
220 
221     public static CompanyPersistence getPersistence() {
222         return _getUtil()._persistence;
223     }
224 
225     public void setPersistence(CompanyPersistence persistence) {
226         _persistence = persistence;
227     }
228 
229     private static CompanyUtil _getUtil() {
230         if (_util == null) {
231             _util = (CompanyUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
232         }
233 
234         return _util;
235     }
236 
237     private static final String _UTIL = CompanyUtil.class.getName();
238     private static CompanyUtil _util;
239     private CompanyPersistence _persistence;
240 }