001    /**
002     * Copyright (c) 2000-2012 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#update(com.liferay.portal.model.BaseModel)
098             */
099            public static ServiceComponent update(ServiceComponent serviceComponent)
100                    throws SystemException {
101                    return getPersistence().update(serviceComponent);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static ServiceComponent update(ServiceComponent serviceComponent,
108                    ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(serviceComponent, serviceContext);
110            }
111    
112            /**
113            * Returns all the service components where buildNamespace = &#63;.
114            *
115            * @param buildNamespace the build namespace
116            * @return the matching service components
117            * @throws SystemException if a system exception occurred
118            */
119            public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace(
120                    java.lang.String buildNamespace)
121                    throws com.liferay.portal.kernel.exception.SystemException {
122                    return getPersistence().findByBuildNamespace(buildNamespace);
123            }
124    
125            /**
126            * Returns a range of all the service components where buildNamespace = &#63;.
127            *
128            * <p>
129            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
130            * </p>
131            *
132            * @param buildNamespace the build namespace
133            * @param start the lower bound of the range of service components
134            * @param end the upper bound of the range of service components (not inclusive)
135            * @return the range of matching service components
136            * @throws SystemException if a system exception occurred
137            */
138            public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace(
139                    java.lang.String buildNamespace, int start, int end)
140                    throws com.liferay.portal.kernel.exception.SystemException {
141                    return getPersistence().findByBuildNamespace(buildNamespace, start, end);
142            }
143    
144            /**
145            * Returns an ordered range of all the service components where buildNamespace = &#63;.
146            *
147            * <p>
148            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
149            * </p>
150            *
151            * @param buildNamespace the build namespace
152            * @param start the lower bound of the range of service components
153            * @param end the upper bound of the range of service components (not inclusive)
154            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
155            * @return the ordered range of matching service components
156            * @throws SystemException if a system exception occurred
157            */
158            public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace(
159                    java.lang.String buildNamespace, int start, int end,
160                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
161                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence()
163                                       .findByBuildNamespace(buildNamespace, start, end,
164                            orderByComparator);
165            }
166    
167            /**
168            * Returns the first service component in the ordered set where buildNamespace = &#63;.
169            *
170            * @param buildNamespace the build namespace
171            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
172            * @return the first matching service component
173            * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_First(
177                    java.lang.String buildNamespace,
178                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
179                    throws com.liferay.portal.NoSuchServiceComponentException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return getPersistence()
182                                       .findByBuildNamespace_First(buildNamespace, orderByComparator);
183            }
184    
185            /**
186            * Returns the first service component in the ordered set where buildNamespace = &#63;.
187            *
188            * @param buildNamespace the build namespace
189            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
190            * @return the first matching service component, or <code>null</code> if a matching service component could not be found
191            * @throws SystemException if a system exception occurred
192            */
193            public static com.liferay.portal.model.ServiceComponent fetchByBuildNamespace_First(
194                    java.lang.String buildNamespace,
195                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    return getPersistence()
198                                       .fetchByBuildNamespace_First(buildNamespace,
199                            orderByComparator);
200            }
201    
202            /**
203            * Returns the last service component in the ordered set where buildNamespace = &#63;.
204            *
205            * @param buildNamespace the build namespace
206            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
207            * @return the last matching service component
208            * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found
209            * @throws SystemException if a system exception occurred
210            */
211            public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_Last(
212                    java.lang.String buildNamespace,
213                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
214                    throws com.liferay.portal.NoSuchServiceComponentException,
215                            com.liferay.portal.kernel.exception.SystemException {
216                    return getPersistence()
217                                       .findByBuildNamespace_Last(buildNamespace, orderByComparator);
218            }
219    
220            /**
221            * Returns the last service component in the ordered set where buildNamespace = &#63;.
222            *
223            * @param buildNamespace the build namespace
224            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
225            * @return the last matching service component, or <code>null</code> if a matching service component could not be found
226            * @throws SystemException if a system exception occurred
227            */
228            public static com.liferay.portal.model.ServiceComponent fetchByBuildNamespace_Last(
229                    java.lang.String buildNamespace,
230                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
231                    throws com.liferay.portal.kernel.exception.SystemException {
232                    return getPersistence()
233                                       .fetchByBuildNamespace_Last(buildNamespace, orderByComparator);
234            }
235    
236            /**
237            * Returns the service components before and after the current service component in the ordered set where buildNamespace = &#63;.
238            *
239            * @param serviceComponentId the primary key of the current service component
240            * @param buildNamespace the build namespace
241            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
242            * @return the previous, current, and next service component
243            * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found
244            * @throws SystemException if a system exception occurred
245            */
246            public static com.liferay.portal.model.ServiceComponent[] findByBuildNamespace_PrevAndNext(
247                    long serviceComponentId, java.lang.String buildNamespace,
248                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
249                    throws com.liferay.portal.NoSuchServiceComponentException,
250                            com.liferay.portal.kernel.exception.SystemException {
251                    return getPersistence()
252                                       .findByBuildNamespace_PrevAndNext(serviceComponentId,
253                            buildNamespace, orderByComparator);
254            }
255    
256            /**
257            * Removes all the service components where buildNamespace = &#63; from the database.
258            *
259            * @param buildNamespace the build namespace
260            * @throws SystemException if a system exception occurred
261            */
262            public static void removeByBuildNamespace(java.lang.String buildNamespace)
263                    throws com.liferay.portal.kernel.exception.SystemException {
264                    getPersistence().removeByBuildNamespace(buildNamespace);
265            }
266    
267            /**
268            * Returns the number of service components where buildNamespace = &#63;.
269            *
270            * @param buildNamespace the build namespace
271            * @return the number of matching service components
272            * @throws SystemException if a system exception occurred
273            */
274            public static int countByBuildNamespace(java.lang.String buildNamespace)
275                    throws com.liferay.portal.kernel.exception.SystemException {
276                    return getPersistence().countByBuildNamespace(buildNamespace);
277            }
278    
279            /**
280            * Returns the service component where buildNamespace = &#63; and buildNumber = &#63; or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found.
281            *
282            * @param buildNamespace the build namespace
283            * @param buildNumber the build number
284            * @return the 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 findByBNS_BNU(
289                    java.lang.String buildNamespace, long buildNumber)
290                    throws com.liferay.portal.NoSuchServiceComponentException,
291                            com.liferay.portal.kernel.exception.SystemException {
292                    return getPersistence().findByBNS_BNU(buildNamespace, buildNumber);
293            }
294    
295            /**
296            * 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.
297            *
298            * @param buildNamespace the build namespace
299            * @param buildNumber the build number
300            * @return the matching service component, or <code>null</code> if a matching service component could not be found
301            * @throws SystemException if a system exception occurred
302            */
303            public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU(
304                    java.lang.String buildNamespace, long buildNumber)
305                    throws com.liferay.portal.kernel.exception.SystemException {
306                    return getPersistence().fetchByBNS_BNU(buildNamespace, buildNumber);
307            }
308    
309            /**
310            * 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.
311            *
312            * @param buildNamespace the build namespace
313            * @param buildNumber the build number
314            * @param retrieveFromCache whether to use the finder cache
315            * @return the matching service component, or <code>null</code> if a matching service component could not be found
316            * @throws SystemException if a system exception occurred
317            */
318            public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU(
319                    java.lang.String buildNamespace, long buildNumber,
320                    boolean retrieveFromCache)
321                    throws com.liferay.portal.kernel.exception.SystemException {
322                    return getPersistence()
323                                       .fetchByBNS_BNU(buildNamespace, buildNumber,
324                            retrieveFromCache);
325            }
326    
327            /**
328            * Removes the service component where buildNamespace = &#63; and buildNumber = &#63; from the database.
329            *
330            * @param buildNamespace the build namespace
331            * @param buildNumber the build number
332            * @return the service component that was removed
333            * @throws SystemException if a system exception occurred
334            */
335            public static com.liferay.portal.model.ServiceComponent removeByBNS_BNU(
336                    java.lang.String buildNamespace, long buildNumber)
337                    throws com.liferay.portal.NoSuchServiceComponentException,
338                            com.liferay.portal.kernel.exception.SystemException {
339                    return getPersistence().removeByBNS_BNU(buildNamespace, buildNumber);
340            }
341    
342            /**
343            * Returns the number of service components where buildNamespace = &#63; and buildNumber = &#63;.
344            *
345            * @param buildNamespace the build namespace
346            * @param buildNumber the build number
347            * @return the number of matching service components
348            * @throws SystemException if a system exception occurred
349            */
350            public static int countByBNS_BNU(java.lang.String buildNamespace,
351                    long buildNumber)
352                    throws com.liferay.portal.kernel.exception.SystemException {
353                    return getPersistence().countByBNS_BNU(buildNamespace, buildNumber);
354            }
355    
356            /**
357            * Caches the service component in the entity cache if it is enabled.
358            *
359            * @param serviceComponent the service component
360            */
361            public static void cacheResult(
362                    com.liferay.portal.model.ServiceComponent serviceComponent) {
363                    getPersistence().cacheResult(serviceComponent);
364            }
365    
366            /**
367            * Caches the service components in the entity cache if it is enabled.
368            *
369            * @param serviceComponents the service components
370            */
371            public static void cacheResult(
372                    java.util.List<com.liferay.portal.model.ServiceComponent> serviceComponents) {
373                    getPersistence().cacheResult(serviceComponents);
374            }
375    
376            /**
377            * Creates a new service component with the primary key. Does not add the service component to the database.
378            *
379            * @param serviceComponentId the primary key for the new service component
380            * @return the new service component
381            */
382            public static com.liferay.portal.model.ServiceComponent create(
383                    long serviceComponentId) {
384                    return getPersistence().create(serviceComponentId);
385            }
386    
387            /**
388            * Removes the service component with the primary key from the database. Also notifies the appropriate model listeners.
389            *
390            * @param serviceComponentId the primary key of the service component
391            * @return the service component that was removed
392            * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found
393            * @throws SystemException if a system exception occurred
394            */
395            public static com.liferay.portal.model.ServiceComponent remove(
396                    long serviceComponentId)
397                    throws com.liferay.portal.NoSuchServiceComponentException,
398                            com.liferay.portal.kernel.exception.SystemException {
399                    return getPersistence().remove(serviceComponentId);
400            }
401    
402            public static com.liferay.portal.model.ServiceComponent updateImpl(
403                    com.liferay.portal.model.ServiceComponent serviceComponent)
404                    throws com.liferay.portal.kernel.exception.SystemException {
405                    return getPersistence().updateImpl(serviceComponent);
406            }
407    
408            /**
409            * Returns the service component with the primary key or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found.
410            *
411            * @param serviceComponentId the primary key of the service component
412            * @return the service component
413            * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found
414            * @throws SystemException if a system exception occurred
415            */
416            public static com.liferay.portal.model.ServiceComponent findByPrimaryKey(
417                    long serviceComponentId)
418                    throws com.liferay.portal.NoSuchServiceComponentException,
419                            com.liferay.portal.kernel.exception.SystemException {
420                    return getPersistence().findByPrimaryKey(serviceComponentId);
421            }
422    
423            /**
424            * Returns the service component with the primary key or returns <code>null</code> if it could not be found.
425            *
426            * @param serviceComponentId the primary key of the service component
427            * @return the service component, or <code>null</code> if a service component with the primary key could not be found
428            * @throws SystemException if a system exception occurred
429            */
430            public static com.liferay.portal.model.ServiceComponent fetchByPrimaryKey(
431                    long serviceComponentId)
432                    throws com.liferay.portal.kernel.exception.SystemException {
433                    return getPersistence().fetchByPrimaryKey(serviceComponentId);
434            }
435    
436            /**
437            * Returns all the service components.
438            *
439            * @return the service components
440            * @throws SystemException if a system exception occurred
441            */
442            public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll()
443                    throws com.liferay.portal.kernel.exception.SystemException {
444                    return getPersistence().findAll();
445            }
446    
447            /**
448            * Returns a range of all the service components.
449            *
450            * <p>
451            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
452            * </p>
453            *
454            * @param start the lower bound of the range of service components
455            * @param end the upper bound of the range of service components (not inclusive)
456            * @return the range of service components
457            * @throws SystemException if a system exception occurred
458            */
459            public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll(
460                    int start, int end)
461                    throws com.liferay.portal.kernel.exception.SystemException {
462                    return getPersistence().findAll(start, end);
463            }
464    
465            /**
466            * Returns an ordered range of all the service components.
467            *
468            * <p>
469            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
470            * </p>
471            *
472            * @param start the lower bound of the range of service components
473            * @param end the upper bound of the range of service components (not inclusive)
474            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
475            * @return the ordered range of service components
476            * @throws SystemException if a system exception occurred
477            */
478            public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll(
479                    int start, int end,
480                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
481                    throws com.liferay.portal.kernel.exception.SystemException {
482                    return getPersistence().findAll(start, end, orderByComparator);
483            }
484    
485            /**
486            * Removes all the service components from the database.
487            *
488            * @throws SystemException if a system exception occurred
489            */
490            public static void removeAll()
491                    throws com.liferay.portal.kernel.exception.SystemException {
492                    getPersistence().removeAll();
493            }
494    
495            /**
496            * Returns the number of service components.
497            *
498            * @return the number of service components
499            * @throws SystemException if a system exception occurred
500            */
501            public static int countAll()
502                    throws com.liferay.portal.kernel.exception.SystemException {
503                    return getPersistence().countAll();
504            }
505    
506            public static ServiceComponentPersistence getPersistence() {
507                    if (_persistence == null) {
508                            _persistence = (ServiceComponentPersistence)PortalBeanLocatorUtil.locate(ServiceComponentPersistence.class.getName());
509    
510                            ReferenceRegistry.registerReference(ServiceComponentUtil.class,
511                                    "_persistence");
512                    }
513    
514                    return _persistence;
515            }
516    
517            /**
518             * @deprecated
519             */
520            public void setPersistence(ServiceComponentPersistence persistence) {
521            }
522    
523            private static ServiceComponentPersistence _persistence;
524    }