001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.model.ServiceComponent;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * The persistence utility for the service component service. This utility wraps {@link ServiceComponentPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
028     *
029     * <p>
030     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
031     * </p>
032     *
033     * <p>
034     * Caching information and settings can be found in <code>portal.properties</code>
035     * </p>
036     *
037     * @author Brian Wing Shun Chan
038     * @see ServiceComponentPersistence
039     * @see ServiceComponentPersistenceImpl
040     * @generated
041     */
042    public class ServiceComponentUtil {
043            /**
044             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
045             */
046            public static void clearCache() {
047                    getPersistence().clearCache();
048            }
049    
050            /**
051             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
052             */
053            public static void clearCache(ServiceComponent serviceComponent) {
054                    getPersistence().clearCache(serviceComponent);
055            }
056    
057            /**
058             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
059             */
060            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
061                    throws SystemException {
062                    return getPersistence().countWithDynamicQuery(dynamicQuery);
063            }
064    
065            /**
066             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
067             */
068            public static List<ServiceComponent> findWithDynamicQuery(
069                    DynamicQuery dynamicQuery) throws SystemException {
070                    return getPersistence().findWithDynamicQuery(dynamicQuery);
071            }
072    
073            /**
074             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
075             */
076            public static List<ServiceComponent> findWithDynamicQuery(
077                    DynamicQuery dynamicQuery, int start, int end)
078                    throws SystemException {
079                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
080            }
081    
082            /**
083             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
084             */
085            public static List<ServiceComponent> findWithDynamicQuery(
086                    DynamicQuery dynamicQuery, int start, int end,
087                    OrderByComparator orderByComparator) throws SystemException {
088                    return getPersistence()
089                                       .findWithDynamicQuery(dynamicQuery, start, end,
090                            orderByComparator);
091            }
092    
093            /**
094             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
095             */
096            public static ServiceComponent remove(ServiceComponent serviceComponent)
097                    throws SystemException {
098                    return getPersistence().remove(serviceComponent);
099            }
100    
101            /**
102             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
103             */
104            public static ServiceComponent update(ServiceComponent serviceComponent,
105                    boolean merge) throws SystemException {
106                    return getPersistence().update(serviceComponent, merge);
107            }
108    
109            /**
110             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
111             */
112            public static ServiceComponent update(ServiceComponent serviceComponent,
113                    boolean merge, ServiceContext serviceContext) throws SystemException {
114                    return getPersistence().update(serviceComponent, merge, serviceContext);
115            }
116    
117            /**
118            * Caches the service component in the entity cache if it is enabled.
119            *
120            * @param serviceComponent the service component to cache
121            */
122            public static void cacheResult(
123                    com.liferay.portal.model.ServiceComponent serviceComponent) {
124                    getPersistence().cacheResult(serviceComponent);
125            }
126    
127            /**
128            * Caches the service components in the entity cache if it is enabled.
129            *
130            * @param serviceComponents the service components to cache
131            */
132            public static void cacheResult(
133                    java.util.List<com.liferay.portal.model.ServiceComponent> serviceComponents) {
134                    getPersistence().cacheResult(serviceComponents);
135            }
136    
137            /**
138            * Creates a new service component with the primary key. Does not add the service component to the database.
139            *
140            * @param serviceComponentId the primary key for the new service component
141            * @return the new service component
142            */
143            public static com.liferay.portal.model.ServiceComponent create(
144                    long serviceComponentId) {
145                    return getPersistence().create(serviceComponentId);
146            }
147    
148            /**
149            * Removes the service component with the primary key from the database. Also notifies the appropriate model listeners.
150            *
151            * @param serviceComponentId the primary key of the service component to remove
152            * @return the service component that was removed
153            * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found
154            * @throws SystemException if a system exception occurred
155            */
156            public static com.liferay.portal.model.ServiceComponent remove(
157                    long serviceComponentId)
158                    throws com.liferay.portal.NoSuchServiceComponentException,
159                            com.liferay.portal.kernel.exception.SystemException {
160                    return getPersistence().remove(serviceComponentId);
161            }
162    
163            public static com.liferay.portal.model.ServiceComponent updateImpl(
164                    com.liferay.portal.model.ServiceComponent serviceComponent,
165                    boolean merge)
166                    throws com.liferay.portal.kernel.exception.SystemException {
167                    return getPersistence().updateImpl(serviceComponent, merge);
168            }
169    
170            /**
171            * Finds the service component with the primary key or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found.
172            *
173            * @param serviceComponentId the primary key of the service component to find
174            * @return the service component
175            * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found
176            * @throws SystemException if a system exception occurred
177            */
178            public static com.liferay.portal.model.ServiceComponent findByPrimaryKey(
179                    long serviceComponentId)
180                    throws com.liferay.portal.NoSuchServiceComponentException,
181                            com.liferay.portal.kernel.exception.SystemException {
182                    return getPersistence().findByPrimaryKey(serviceComponentId);
183            }
184    
185            /**
186            * Finds the service component with the primary key or returns <code>null</code> if it could not be found.
187            *
188            * @param serviceComponentId the primary key of the service component to find
189            * @return the service component, or <code>null</code> if a service component with the primary key could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portal.model.ServiceComponent fetchByPrimaryKey(
193                    long serviceComponentId)
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    return getPersistence().fetchByPrimaryKey(serviceComponentId);
196            }
197    
198            /**
199            * Finds all the service components where buildNamespace = &#63;.
200            *
201            * @param buildNamespace the build namespace to search with
202            * @return the matching service components
203            * @throws SystemException if a system exception occurred
204            */
205            public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace(
206                    java.lang.String buildNamespace)
207                    throws com.liferay.portal.kernel.exception.SystemException {
208                    return getPersistence().findByBuildNamespace(buildNamespace);
209            }
210    
211            /**
212            * Finds a range of all the service components where buildNamespace = &#63;.
213            *
214            * <p>
215            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
216            * </p>
217            *
218            * @param buildNamespace the build namespace to search with
219            * @param start the lower bound of the range of service components to return
220            * @param end the upper bound of the range of service components to return (not inclusive)
221            * @return the range of matching service components
222            * @throws SystemException if a system exception occurred
223            */
224            public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace(
225                    java.lang.String buildNamespace, int start, int end)
226                    throws com.liferay.portal.kernel.exception.SystemException {
227                    return getPersistence().findByBuildNamespace(buildNamespace, start, end);
228            }
229    
230            /**
231            * Finds an ordered range of all the service components where buildNamespace = &#63;.
232            *
233            * <p>
234            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
235            * </p>
236            *
237            * @param buildNamespace the build namespace to search with
238            * @param start the lower bound of the range of service components to return
239            * @param end the upper bound of the range of service components to return (not inclusive)
240            * @param orderByComparator the comparator to order the results by
241            * @return the ordered range of matching service components
242            * @throws SystemException if a system exception occurred
243            */
244            public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace(
245                    java.lang.String buildNamespace, int start, int end,
246                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    return getPersistence()
249                                       .findByBuildNamespace(buildNamespace, start, end,
250                            orderByComparator);
251            }
252    
253            /**
254            * Finds the first service component in the ordered set where buildNamespace = &#63;.
255            *
256            * <p>
257            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
258            * </p>
259            *
260            * @param buildNamespace the build namespace to search with
261            * @param orderByComparator the comparator to order the set by
262            * @return the first matching service component
263            * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found
264            * @throws SystemException if a system exception occurred
265            */
266            public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_First(
267                    java.lang.String buildNamespace,
268                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
269                    throws com.liferay.portal.NoSuchServiceComponentException,
270                            com.liferay.portal.kernel.exception.SystemException {
271                    return getPersistence()
272                                       .findByBuildNamespace_First(buildNamespace, orderByComparator);
273            }
274    
275            /**
276            * Finds the last service component in the ordered set where buildNamespace = &#63;.
277            *
278            * <p>
279            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
280            * </p>
281            *
282            * @param buildNamespace the build namespace to search with
283            * @param orderByComparator the comparator to order the set by
284            * @return the last matching service component
285            * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found
286            * @throws SystemException if a system exception occurred
287            */
288            public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_Last(
289                    java.lang.String buildNamespace,
290                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
291                    throws com.liferay.portal.NoSuchServiceComponentException,
292                            com.liferay.portal.kernel.exception.SystemException {
293                    return getPersistence()
294                                       .findByBuildNamespace_Last(buildNamespace, orderByComparator);
295            }
296    
297            /**
298            * Finds the service components before and after the current service component in the ordered set where buildNamespace = &#63;.
299            *
300            * <p>
301            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
302            * </p>
303            *
304            * @param serviceComponentId the primary key of the current service component
305            * @param buildNamespace the build namespace to search with
306            * @param orderByComparator the comparator to order the set by
307            * @return the previous, current, and next service component
308            * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found
309            * @throws SystemException if a system exception occurred
310            */
311            public static com.liferay.portal.model.ServiceComponent[] findByBuildNamespace_PrevAndNext(
312                    long serviceComponentId, java.lang.String buildNamespace,
313                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
314                    throws com.liferay.portal.NoSuchServiceComponentException,
315                            com.liferay.portal.kernel.exception.SystemException {
316                    return getPersistence()
317                                       .findByBuildNamespace_PrevAndNext(serviceComponentId,
318                            buildNamespace, orderByComparator);
319            }
320    
321            /**
322            * Finds the service component where buildNamespace = &#63; and buildNumber = &#63; or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found.
323            *
324            * @param buildNamespace the build namespace to search with
325            * @param buildNumber the build number to search with
326            * @return the matching service component
327            * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found
328            * @throws SystemException if a system exception occurred
329            */
330            public static com.liferay.portal.model.ServiceComponent findByBNS_BNU(
331                    java.lang.String buildNamespace, long buildNumber)
332                    throws com.liferay.portal.NoSuchServiceComponentException,
333                            com.liferay.portal.kernel.exception.SystemException {
334                    return getPersistence().findByBNS_BNU(buildNamespace, buildNumber);
335            }
336    
337            /**
338            * Finds the service component where buildNamespace = &#63; and buildNumber = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
339            *
340            * @param buildNamespace the build namespace to search with
341            * @param buildNumber the build number to search with
342            * @return the matching service component, or <code>null</code> if a matching service component could not be found
343            * @throws SystemException if a system exception occurred
344            */
345            public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU(
346                    java.lang.String buildNamespace, long buildNumber)
347                    throws com.liferay.portal.kernel.exception.SystemException {
348                    return getPersistence().fetchByBNS_BNU(buildNamespace, buildNumber);
349            }
350    
351            /**
352            * Finds the service component where buildNamespace = &#63; and buildNumber = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
353            *
354            * @param buildNamespace the build namespace to search with
355            * @param buildNumber the build number to search with
356            * @return the matching service component, or <code>null</code> if a matching service component could not be found
357            * @throws SystemException if a system exception occurred
358            */
359            public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU(
360                    java.lang.String buildNamespace, long buildNumber,
361                    boolean retrieveFromCache)
362                    throws com.liferay.portal.kernel.exception.SystemException {
363                    return getPersistence()
364                                       .fetchByBNS_BNU(buildNamespace, buildNumber,
365                            retrieveFromCache);
366            }
367    
368            /**
369            * Finds all the service components.
370            *
371            * @return the service components
372            * @throws SystemException if a system exception occurred
373            */
374            public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll()
375                    throws com.liferay.portal.kernel.exception.SystemException {
376                    return getPersistence().findAll();
377            }
378    
379            /**
380            * Finds a range of all the service components.
381            *
382            * <p>
383            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
384            * </p>
385            *
386            * @param start the lower bound of the range of service components to return
387            * @param end the upper bound of the range of service components to return (not inclusive)
388            * @return the range of service components
389            * @throws SystemException if a system exception occurred
390            */
391            public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll(
392                    int start, int end)
393                    throws com.liferay.portal.kernel.exception.SystemException {
394                    return getPersistence().findAll(start, end);
395            }
396    
397            /**
398            * Finds an ordered range of all the service components.
399            *
400            * <p>
401            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
402            * </p>
403            *
404            * @param start the lower bound of the range of service components to return
405            * @param end the upper bound of the range of service components to return (not inclusive)
406            * @param orderByComparator the comparator to order the results by
407            * @return the ordered range of service components
408            * @throws SystemException if a system exception occurred
409            */
410            public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll(
411                    int start, int end,
412                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
413                    throws com.liferay.portal.kernel.exception.SystemException {
414                    return getPersistence().findAll(start, end, orderByComparator);
415            }
416    
417            /**
418            * Removes all the service components where buildNamespace = &#63; from the database.
419            *
420            * @param buildNamespace the build namespace to search with
421            * @throws SystemException if a system exception occurred
422            */
423            public static void removeByBuildNamespace(java.lang.String buildNamespace)
424                    throws com.liferay.portal.kernel.exception.SystemException {
425                    getPersistence().removeByBuildNamespace(buildNamespace);
426            }
427    
428            /**
429            * Removes the service component where buildNamespace = &#63; and buildNumber = &#63; from the database.
430            *
431            * @param buildNamespace the build namespace to search with
432            * @param buildNumber the build number to search with
433            * @throws SystemException if a system exception occurred
434            */
435            public static void removeByBNS_BNU(java.lang.String buildNamespace,
436                    long buildNumber)
437                    throws com.liferay.portal.NoSuchServiceComponentException,
438                            com.liferay.portal.kernel.exception.SystemException {
439                    getPersistence().removeByBNS_BNU(buildNamespace, buildNumber);
440            }
441    
442            /**
443            * Removes all the service components from the database.
444            *
445            * @throws SystemException if a system exception occurred
446            */
447            public static void removeAll()
448                    throws com.liferay.portal.kernel.exception.SystemException {
449                    getPersistence().removeAll();
450            }
451    
452            /**
453            * Counts all the service components where buildNamespace = &#63;.
454            *
455            * @param buildNamespace the build namespace to search with
456            * @return the number of matching service components
457            * @throws SystemException if a system exception occurred
458            */
459            public static int countByBuildNamespace(java.lang.String buildNamespace)
460                    throws com.liferay.portal.kernel.exception.SystemException {
461                    return getPersistence().countByBuildNamespace(buildNamespace);
462            }
463    
464            /**
465            * Counts all the service components where buildNamespace = &#63; and buildNumber = &#63;.
466            *
467            * @param buildNamespace the build namespace to search with
468            * @param buildNumber the build number to search with
469            * @return the number of matching service components
470            * @throws SystemException if a system exception occurred
471            */
472            public static int countByBNS_BNU(java.lang.String buildNamespace,
473                    long buildNumber)
474                    throws com.liferay.portal.kernel.exception.SystemException {
475                    return getPersistence().countByBNS_BNU(buildNamespace, buildNumber);
476            }
477    
478            /**
479            * Counts all the service components.
480            *
481            * @return the number of service components
482            * @throws SystemException if a system exception occurred
483            */
484            public static int countAll()
485                    throws com.liferay.portal.kernel.exception.SystemException {
486                    return getPersistence().countAll();
487            }
488    
489            public static ServiceComponentPersistence getPersistence() {
490                    if (_persistence == null) {
491                            _persistence = (ServiceComponentPersistence)PortalBeanLocatorUtil.locate(ServiceComponentPersistence.class.getName());
492                    }
493    
494                    return _persistence;
495            }
496    
497            public void setPersistence(ServiceComponentPersistence persistence) {
498                    _persistence = persistence;
499            }
500    
501            private static ServiceComponentPersistence _persistence;
502    }