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