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