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.Contact;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="ContactUtil.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       ContactPersistence
35   * @see       ContactPersistenceImpl
36   * @generated
37   */
38  public class ContactUtil {
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(Contact)
48       */
49      public static void clearCache(Contact contact) {
50          getPersistence().clearCache(contact);
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 Contact remove(Contact contact) throws SystemException {
81          return getPersistence().remove(contact);
82      }
83  
84      /**
85       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
86       */
87      public static Contact update(Contact contact, boolean merge)
88          throws SystemException {
89          return getPersistence().update(contact, merge);
90      }
91  
92      public static void cacheResult(com.liferay.portal.model.Contact contact) {
93          getPersistence().cacheResult(contact);
94      }
95  
96      public static void cacheResult(
97          java.util.List<com.liferay.portal.model.Contact> contacts) {
98          getPersistence().cacheResult(contacts);
99      }
100 
101     public static com.liferay.portal.model.Contact create(long contactId) {
102         return getPersistence().create(contactId);
103     }
104 
105     public static com.liferay.portal.model.Contact remove(long contactId)
106         throws com.liferay.portal.NoSuchContactException,
107             com.liferay.portal.SystemException {
108         return getPersistence().remove(contactId);
109     }
110 
111     /**
112      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
113      */
114     public static com.liferay.portal.model.Contact update(
115         com.liferay.portal.model.Contact contact)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().update(contact);
118     }
119 
120     public static com.liferay.portal.model.Contact updateImpl(
121         com.liferay.portal.model.Contact contact, boolean merge)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().updateImpl(contact, merge);
124     }
125 
126     public static com.liferay.portal.model.Contact findByPrimaryKey(
127         long contactId)
128         throws com.liferay.portal.NoSuchContactException,
129             com.liferay.portal.SystemException {
130         return getPersistence().findByPrimaryKey(contactId);
131     }
132 
133     public static com.liferay.portal.model.Contact fetchByPrimaryKey(
134         long contactId) throws com.liferay.portal.SystemException {
135         return getPersistence().fetchByPrimaryKey(contactId);
136     }
137 
138     public static java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
139         long companyId) throws com.liferay.portal.SystemException {
140         return getPersistence().findByCompanyId(companyId);
141     }
142 
143     public static java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
144         long companyId, int start, int end)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().findByCompanyId(companyId, start, end);
147     }
148 
149     public static java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
150         long companyId, int start, int end,
151         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
152         throws com.liferay.portal.SystemException {
153         return getPersistence()
154                    .findByCompanyId(companyId, start, end, orderByComparator);
155     }
156 
157     public static com.liferay.portal.model.Contact findByCompanyId_First(
158         long companyId,
159         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
160         throws com.liferay.portal.NoSuchContactException,
161             com.liferay.portal.SystemException {
162         return getPersistence()
163                    .findByCompanyId_First(companyId, orderByComparator);
164     }
165 
166     public static com.liferay.portal.model.Contact findByCompanyId_Last(
167         long companyId,
168         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
169         throws com.liferay.portal.NoSuchContactException,
170             com.liferay.portal.SystemException {
171         return getPersistence()
172                    .findByCompanyId_Last(companyId, orderByComparator);
173     }
174 
175     public static com.liferay.portal.model.Contact[] findByCompanyId_PrevAndNext(
176         long contactId, long companyId,
177         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
178         throws com.liferay.portal.NoSuchContactException,
179             com.liferay.portal.SystemException {
180         return getPersistence()
181                    .findByCompanyId_PrevAndNext(contactId, companyId,
182             orderByComparator);
183     }
184 
185     public static java.util.List<com.liferay.portal.model.Contact> findAll()
186         throws com.liferay.portal.SystemException {
187         return getPersistence().findAll();
188     }
189 
190     public static java.util.List<com.liferay.portal.model.Contact> findAll(
191         int start, int end) throws com.liferay.portal.SystemException {
192         return getPersistence().findAll(start, end);
193     }
194 
195     public static java.util.List<com.liferay.portal.model.Contact> findAll(
196         int start, int end,
197         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
198         throws com.liferay.portal.SystemException {
199         return getPersistence().findAll(start, end, orderByComparator);
200     }
201 
202     public static void removeByCompanyId(long companyId)
203         throws com.liferay.portal.SystemException {
204         getPersistence().removeByCompanyId(companyId);
205     }
206 
207     public static void removeAll() throws com.liferay.portal.SystemException {
208         getPersistence().removeAll();
209     }
210 
211     public static int countByCompanyId(long companyId)
212         throws com.liferay.portal.SystemException {
213         return getPersistence().countByCompanyId(companyId);
214     }
215 
216     public static int countAll() throws com.liferay.portal.SystemException {
217         return getPersistence().countAll();
218     }
219 
220     public static ContactPersistence getPersistence() {
221         if (_persistence == null) {
222             _persistence = (ContactPersistence)PortalBeanLocatorUtil.locate(ContactPersistence.class.getName());
223 
224             ReferenceRegistry.registerReference(ContactUtil.class,
225                 "_persistence");
226         }
227 
228         return _persistence;
229     }
230 
231     public void setPersistence(ContactPersistence persistence) {
232         _persistence = persistence;
233 
234         ReferenceRegistry.registerReference(ContactUtil.class, "_persistence");
235     }
236 
237     private static ContactPersistence _persistence;
238 }