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