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