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