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  
26  /**
27   * <a href="ContactUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       ContactPersistence
36   * @see       ContactPersistenceImpl
37   * @generated
38   */
39  public class ContactUtil {
40      public static void cacheResult(com.liferay.portal.model.Contact contact) {
41          getPersistence().cacheResult(contact);
42      }
43  
44      public static void cacheResult(
45          java.util.List<com.liferay.portal.model.Contact> contacts) {
46          getPersistence().cacheResult(contacts);
47      }
48  
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      public static com.liferay.portal.model.Contact create(long contactId) {
54          return getPersistence().create(contactId);
55      }
56  
57      public static com.liferay.portal.model.Contact remove(long contactId)
58          throws com.liferay.portal.NoSuchContactException,
59              com.liferay.portal.SystemException {
60          return getPersistence().remove(contactId);
61      }
62  
63      public static com.liferay.portal.model.Contact remove(
64          com.liferay.portal.model.Contact contact)
65          throws com.liferay.portal.SystemException {
66          return getPersistence().remove(contact);
67      }
68  
69      /**
70       * @deprecated Use {@link #update(Contact, boolean merge)}.
71       */
72      public static com.liferay.portal.model.Contact update(
73          com.liferay.portal.model.Contact contact)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(contact);
76      }
77  
78      /**
79       * Add, update, or merge, the entity. This method also calls the model
80       * listeners to trigger the proper events associated with adding, deleting,
81       * or updating an entity.
82       *
83       * @param  contact the entity to add, update, or merge
84       * @param  merge boolean value for whether to merge the entity. The default
85       *         value is false. Setting merge to true is more expensive and
86       *         should only be true when contact is transient. See
87       *         LEP-5473 for a detailed discussion of this method.
88       * @return the entity that was added, updated, or merged
89       */
90      public static com.liferay.portal.model.Contact update(
91          com.liferay.portal.model.Contact contact, boolean merge)
92          throws com.liferay.portal.SystemException {
93          return getPersistence().update(contact, merge);
94      }
95  
96      public static com.liferay.portal.model.Contact updateImpl(
97          com.liferay.portal.model.Contact contact, boolean merge)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().updateImpl(contact, merge);
100     }
101 
102     public static com.liferay.portal.model.Contact findByPrimaryKey(
103         long contactId)
104         throws com.liferay.portal.NoSuchContactException,
105             com.liferay.portal.SystemException {
106         return getPersistence().findByPrimaryKey(contactId);
107     }
108 
109     public static com.liferay.portal.model.Contact fetchByPrimaryKey(
110         long contactId) throws com.liferay.portal.SystemException {
111         return getPersistence().fetchByPrimaryKey(contactId);
112     }
113 
114     public static java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
115         long companyId) throws com.liferay.portal.SystemException {
116         return getPersistence().findByCompanyId(companyId);
117     }
118 
119     public static java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
120         long companyId, int start, int end)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByCompanyId(companyId, start, end);
123     }
124 
125     public static java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
126         long companyId, int start, int end,
127         com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.SystemException {
129         return getPersistence().findByCompanyId(companyId, start, end, obc);
130     }
131 
132     public static com.liferay.portal.model.Contact findByCompanyId_First(
133         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.NoSuchContactException,
135             com.liferay.portal.SystemException {
136         return getPersistence().findByCompanyId_First(companyId, obc);
137     }
138 
139     public static com.liferay.portal.model.Contact findByCompanyId_Last(
140         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
141         throws com.liferay.portal.NoSuchContactException,
142             com.liferay.portal.SystemException {
143         return getPersistence().findByCompanyId_Last(companyId, obc);
144     }
145 
146     public static com.liferay.portal.model.Contact[] findByCompanyId_PrevAndNext(
147         long contactId, long companyId,
148         com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.NoSuchContactException,
150             com.liferay.portal.SystemException {
151         return getPersistence()
152                    .findByCompanyId_PrevAndNext(contactId, companyId, obc);
153     }
154 
155     public static java.util.List<Object> findWithDynamicQuery(
156         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157         throws com.liferay.portal.SystemException {
158         return getPersistence().findWithDynamicQuery(dynamicQuery);
159     }
160 
161     public static java.util.List<Object> findWithDynamicQuery(
162         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
163         int end) throws com.liferay.portal.SystemException {
164         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
165     }
166 
167     public static java.util.List<com.liferay.portal.model.Contact> findAll()
168         throws com.liferay.portal.SystemException {
169         return getPersistence().findAll();
170     }
171 
172     public static java.util.List<com.liferay.portal.model.Contact> findAll(
173         int start, int end) throws com.liferay.portal.SystemException {
174         return getPersistence().findAll(start, end);
175     }
176 
177     public static java.util.List<com.liferay.portal.model.Contact> findAll(
178         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
179         throws com.liferay.portal.SystemException {
180         return getPersistence().findAll(start, end, obc);
181     }
182 
183     public static void removeByCompanyId(long companyId)
184         throws com.liferay.portal.SystemException {
185         getPersistence().removeByCompanyId(companyId);
186     }
187 
188     public static void removeAll() throws com.liferay.portal.SystemException {
189         getPersistence().removeAll();
190     }
191 
192     public static int countByCompanyId(long companyId)
193         throws com.liferay.portal.SystemException {
194         return getPersistence().countByCompanyId(companyId);
195     }
196 
197     public static int countAll() throws com.liferay.portal.SystemException {
198         return getPersistence().countAll();
199     }
200 
201     public static ContactPersistence getPersistence() {
202         return _persistence;
203     }
204 
205     public void setPersistence(ContactPersistence persistence) {
206         _persistence = persistence;
207     }
208 
209     private static ContactPersistence _persistence;
210 }