1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="ServiceComponentUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class ServiceComponentUtil {
29      public static void cacheResult(
30          com.liferay.portal.model.ServiceComponent serviceComponent) {
31          getPersistence().cacheResult(serviceComponent);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portal.model.ServiceComponent> serviceComponents) {
36          getPersistence().cacheResult(serviceComponents);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portal.model.ServiceComponent create(
44          long serviceComponentId) {
45          return getPersistence().create(serviceComponentId);
46      }
47  
48      public static com.liferay.portal.model.ServiceComponent remove(
49          long serviceComponentId)
50          throws com.liferay.portal.NoSuchServiceComponentException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(serviceComponentId);
53      }
54  
55      public static com.liferay.portal.model.ServiceComponent remove(
56          com.liferay.portal.model.ServiceComponent serviceComponent)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(serviceComponent);
59      }
60  
61      /**
62       * @deprecated Use <code>update(ServiceComponent serviceComponent, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.ServiceComponent update(
65          com.liferay.portal.model.ServiceComponent serviceComponent)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(serviceComponent);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        serviceComponent the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when serviceComponent is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.ServiceComponent update(
84          com.liferay.portal.model.ServiceComponent serviceComponent,
85          boolean merge) throws com.liferay.portal.SystemException {
86          return getPersistence().update(serviceComponent, merge);
87      }
88  
89      public static com.liferay.portal.model.ServiceComponent updateImpl(
90          com.liferay.portal.model.ServiceComponent serviceComponent,
91          boolean merge) throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(serviceComponent, merge);
93      }
94  
95      public static com.liferay.portal.model.ServiceComponent findByPrimaryKey(
96          long serviceComponentId)
97          throws com.liferay.portal.NoSuchServiceComponentException,
98              com.liferay.portal.SystemException {
99          return getPersistence().findByPrimaryKey(serviceComponentId);
100     }
101 
102     public static com.liferay.portal.model.ServiceComponent fetchByPrimaryKey(
103         long serviceComponentId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(serviceComponentId);
105     }
106 
107     public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace(
108         java.lang.String buildNamespace)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().findByBuildNamespace(buildNamespace);
111     }
112 
113     public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace(
114         java.lang.String buildNamespace, int start, int end)
115         throws com.liferay.portal.SystemException {
116         return getPersistence().findByBuildNamespace(buildNamespace, start, end);
117     }
118 
119     public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace(
120         java.lang.String buildNamespace, int start, int end,
121         com.liferay.portal.kernel.util.OrderByComparator obc)
122         throws com.liferay.portal.SystemException {
123         return getPersistence()
124                    .findByBuildNamespace(buildNamespace, start, end, obc);
125     }
126 
127     public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_First(
128         java.lang.String buildNamespace,
129         com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.NoSuchServiceComponentException,
131             com.liferay.portal.SystemException {
132         return getPersistence().findByBuildNamespace_First(buildNamespace, obc);
133     }
134 
135     public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_Last(
136         java.lang.String buildNamespace,
137         com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.NoSuchServiceComponentException,
139             com.liferay.portal.SystemException {
140         return getPersistence().findByBuildNamespace_Last(buildNamespace, obc);
141     }
142 
143     public static com.liferay.portal.model.ServiceComponent[] findByBuildNamespace_PrevAndNext(
144         long serviceComponentId, java.lang.String buildNamespace,
145         com.liferay.portal.kernel.util.OrderByComparator obc)
146         throws com.liferay.portal.NoSuchServiceComponentException,
147             com.liferay.portal.SystemException {
148         return getPersistence()
149                    .findByBuildNamespace_PrevAndNext(serviceComponentId,
150             buildNamespace, obc);
151     }
152 
153     public static com.liferay.portal.model.ServiceComponent findByBNS_BNU(
154         java.lang.String buildNamespace, long buildNumber)
155         throws com.liferay.portal.NoSuchServiceComponentException,
156             com.liferay.portal.SystemException {
157         return getPersistence().findByBNS_BNU(buildNamespace, buildNumber);
158     }
159 
160     public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU(
161         java.lang.String buildNamespace, long buildNumber)
162         throws com.liferay.portal.SystemException {
163         return getPersistence().fetchByBNS_BNU(buildNamespace, buildNumber);
164     }
165 
166     public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU(
167         java.lang.String buildNamespace, long buildNumber,
168         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
169         return getPersistence()
170                    .fetchByBNS_BNU(buildNamespace, buildNumber,
171             retrieveFromCache);
172     }
173 
174     public static java.util.List<Object> findWithDynamicQuery(
175         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
176         throws com.liferay.portal.SystemException {
177         return getPersistence().findWithDynamicQuery(dynamicQuery);
178     }
179 
180     public static java.util.List<Object> findWithDynamicQuery(
181         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
182         int end) throws com.liferay.portal.SystemException {
183         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
184     }
185 
186     public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll()
187         throws com.liferay.portal.SystemException {
188         return getPersistence().findAll();
189     }
190 
191     public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll(
192         int start, int end) throws com.liferay.portal.SystemException {
193         return getPersistence().findAll(start, end);
194     }
195 
196     public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll(
197         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
198         throws com.liferay.portal.SystemException {
199         return getPersistence().findAll(start, end, obc);
200     }
201 
202     public static void removeByBuildNamespace(java.lang.String buildNamespace)
203         throws com.liferay.portal.SystemException {
204         getPersistence().removeByBuildNamespace(buildNamespace);
205     }
206 
207     public static void removeByBNS_BNU(java.lang.String buildNamespace,
208         long buildNumber)
209         throws com.liferay.portal.NoSuchServiceComponentException,
210             com.liferay.portal.SystemException {
211         getPersistence().removeByBNS_BNU(buildNamespace, buildNumber);
212     }
213 
214     public static void removeAll() throws com.liferay.portal.SystemException {
215         getPersistence().removeAll();
216     }
217 
218     public static int countByBuildNamespace(java.lang.String buildNamespace)
219         throws com.liferay.portal.SystemException {
220         return getPersistence().countByBuildNamespace(buildNamespace);
221     }
222 
223     public static int countByBNS_BNU(java.lang.String buildNamespace,
224         long buildNumber) throws com.liferay.portal.SystemException {
225         return getPersistence().countByBNS_BNU(buildNamespace, buildNumber);
226     }
227 
228     public static int countAll() throws com.liferay.portal.SystemException {
229         return getPersistence().countAll();
230     }
231 
232     public static ServiceComponentPersistence getPersistence() {
233         return _persistence;
234     }
235 
236     public void setPersistence(ServiceComponentPersistence persistence) {
237         _persistence = persistence;
238     }
239 
240     private static ServiceComponentPersistence _persistence;
241 }