001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.model.Portlet;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * @author    Brian Wing Shun Chan
028     * @see       PortletPersistence
029     * @see       PortletPersistenceImpl
030     * @generated
031     */
032    public class PortletUtil {
033            /**
034             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
035             */
036            public static void clearCache() {
037                    getPersistence().clearCache();
038            }
039    
040            /**
041             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
042             */
043            public static void clearCache(Portlet portlet) {
044                    getPersistence().clearCache(portlet);
045            }
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
049             */
050            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
051                    throws SystemException {
052                    return getPersistence().countWithDynamicQuery(dynamicQuery);
053            }
054    
055            /**
056             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
057             */
058            public static List<Portlet> findWithDynamicQuery(DynamicQuery dynamicQuery)
059                    throws SystemException {
060                    return getPersistence().findWithDynamicQuery(dynamicQuery);
061            }
062    
063            /**
064             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
065             */
066            public static List<Portlet> findWithDynamicQuery(
067                    DynamicQuery dynamicQuery, int start, int end)
068                    throws SystemException {
069                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
070            }
071    
072            /**
073             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
074             */
075            public static List<Portlet> findWithDynamicQuery(
076                    DynamicQuery dynamicQuery, int start, int end,
077                    OrderByComparator orderByComparator) throws SystemException {
078                    return getPersistence()
079                                       .findWithDynamicQuery(dynamicQuery, start, end,
080                            orderByComparator);
081            }
082    
083            /**
084             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
085             */
086            public static Portlet remove(Portlet portlet) throws SystemException {
087                    return getPersistence().remove(portlet);
088            }
089    
090            /**
091             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
092             */
093            public static Portlet update(Portlet portlet, boolean merge)
094                    throws SystemException {
095                    return getPersistence().update(portlet, merge);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
100             */
101            public static Portlet update(Portlet portlet, boolean merge,
102                    ServiceContext serviceContext) throws SystemException {
103                    return getPersistence().update(portlet, merge, serviceContext);
104            }
105    
106            public static void cacheResult(com.liferay.portal.model.Portlet portlet) {
107                    getPersistence().cacheResult(portlet);
108            }
109    
110            public static void cacheResult(
111                    java.util.List<com.liferay.portal.model.Portlet> portlets) {
112                    getPersistence().cacheResult(portlets);
113            }
114    
115            public static com.liferay.portal.model.Portlet create(long id) {
116                    return getPersistence().create(id);
117            }
118    
119            public static com.liferay.portal.model.Portlet remove(long id)
120                    throws com.liferay.portal.NoSuchPortletException,
121                            com.liferay.portal.kernel.exception.SystemException {
122                    return getPersistence().remove(id);
123            }
124    
125            public static com.liferay.portal.model.Portlet updateImpl(
126                    com.liferay.portal.model.Portlet portlet, boolean merge)
127                    throws com.liferay.portal.kernel.exception.SystemException {
128                    return getPersistence().updateImpl(portlet, merge);
129            }
130    
131            public static com.liferay.portal.model.Portlet findByPrimaryKey(long id)
132                    throws com.liferay.portal.NoSuchPortletException,
133                            com.liferay.portal.kernel.exception.SystemException {
134                    return getPersistence().findByPrimaryKey(id);
135            }
136    
137            public static com.liferay.portal.model.Portlet fetchByPrimaryKey(long id)
138                    throws com.liferay.portal.kernel.exception.SystemException {
139                    return getPersistence().fetchByPrimaryKey(id);
140            }
141    
142            public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
143                    long companyId)
144                    throws com.liferay.portal.kernel.exception.SystemException {
145                    return getPersistence().findByCompanyId(companyId);
146            }
147    
148            public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
149                    long companyId, int start, int end)
150                    throws com.liferay.portal.kernel.exception.SystemException {
151                    return getPersistence().findByCompanyId(companyId, start, end);
152            }
153    
154            public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
155                    long companyId, int start, int end,
156                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getPersistence()
159                                       .findByCompanyId(companyId, start, end, orderByComparator);
160            }
161    
162            public static com.liferay.portal.model.Portlet findByCompanyId_First(
163                    long companyId,
164                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165                    throws com.liferay.portal.NoSuchPortletException,
166                            com.liferay.portal.kernel.exception.SystemException {
167                    return getPersistence()
168                                       .findByCompanyId_First(companyId, orderByComparator);
169            }
170    
171            public static com.liferay.portal.model.Portlet findByCompanyId_Last(
172                    long companyId,
173                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
174                    throws com.liferay.portal.NoSuchPortletException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    return getPersistence()
177                                       .findByCompanyId_Last(companyId, orderByComparator);
178            }
179    
180            public static com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext(
181                    long id, long companyId,
182                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
183                    throws com.liferay.portal.NoSuchPortletException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getPersistence()
186                                       .findByCompanyId_PrevAndNext(id, companyId, orderByComparator);
187            }
188    
189            public static com.liferay.portal.model.Portlet findByC_P(long companyId,
190                    java.lang.String portletId)
191                    throws com.liferay.portal.NoSuchPortletException,
192                            com.liferay.portal.kernel.exception.SystemException {
193                    return getPersistence().findByC_P(companyId, portletId);
194            }
195    
196            public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
197                    java.lang.String portletId)
198                    throws com.liferay.portal.kernel.exception.SystemException {
199                    return getPersistence().fetchByC_P(companyId, portletId);
200            }
201    
202            public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
203                    java.lang.String portletId, boolean retrieveFromCache)
204                    throws com.liferay.portal.kernel.exception.SystemException {
205                    return getPersistence()
206                                       .fetchByC_P(companyId, portletId, retrieveFromCache);
207            }
208    
209            public static java.util.List<com.liferay.portal.model.Portlet> findAll()
210                    throws com.liferay.portal.kernel.exception.SystemException {
211                    return getPersistence().findAll();
212            }
213    
214            public static java.util.List<com.liferay.portal.model.Portlet> findAll(
215                    int start, int end)
216                    throws com.liferay.portal.kernel.exception.SystemException {
217                    return getPersistence().findAll(start, end);
218            }
219    
220            public static java.util.List<com.liferay.portal.model.Portlet> findAll(
221                    int start, int end,
222                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
223                    throws com.liferay.portal.kernel.exception.SystemException {
224                    return getPersistence().findAll(start, end, orderByComparator);
225            }
226    
227            public static void removeByCompanyId(long companyId)
228                    throws com.liferay.portal.kernel.exception.SystemException {
229                    getPersistence().removeByCompanyId(companyId);
230            }
231    
232            public static void removeByC_P(long companyId, java.lang.String portletId)
233                    throws com.liferay.portal.NoSuchPortletException,
234                            com.liferay.portal.kernel.exception.SystemException {
235                    getPersistence().removeByC_P(companyId, portletId);
236            }
237    
238            public static void removeAll()
239                    throws com.liferay.portal.kernel.exception.SystemException {
240                    getPersistence().removeAll();
241            }
242    
243            public static int countByCompanyId(long companyId)
244                    throws com.liferay.portal.kernel.exception.SystemException {
245                    return getPersistence().countByCompanyId(companyId);
246            }
247    
248            public static int countByC_P(long companyId, java.lang.String portletId)
249                    throws com.liferay.portal.kernel.exception.SystemException {
250                    return getPersistence().countByC_P(companyId, portletId);
251            }
252    
253            public static int countAll()
254                    throws com.liferay.portal.kernel.exception.SystemException {
255                    return getPersistence().countAll();
256            }
257    
258            public static PortletPersistence getPersistence() {
259                    if (_persistence == null) {
260                            _persistence = (PortletPersistence)PortalBeanLocatorUtil.locate(PortletPersistence.class.getName());
261                    }
262    
263                    return _persistence;
264            }
265    
266            public void setPersistence(PortletPersistence persistence) {
267                    _persistence = persistence;
268            }
269    
270            private static PortletPersistence _persistence;
271    }