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.model.Portlet;
020    
021    /**
022     * The persistence interface for the portlet service.
023     *
024     * <p>
025     * Caching information and settings can be found in <code>portal.properties</code>
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see PortletPersistenceImpl
030     * @see PortletUtil
031     * @generated
032     */
033    @ProviderType
034    public interface PortletPersistence extends BasePersistence<Portlet> {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify or reference this interface directly. Always use {@link PortletUtil} to access the portlet persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
039             */
040    
041            /**
042            * Returns all the portlets where companyId = &#63;.
043            *
044            * @param companyId the company ID
045            * @return the matching portlets
046            * @throws SystemException if a system exception occurred
047            */
048            public java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
049                    long companyId)
050                    throws com.liferay.portal.kernel.exception.SystemException;
051    
052            /**
053            * Returns a range of all the portlets where companyId = &#63;.
054            *
055            * <p>
056            * 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.PortletModelImpl}. 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.
057            * </p>
058            *
059            * @param companyId the company ID
060            * @param start the lower bound of the range of portlets
061            * @param end the upper bound of the range of portlets (not inclusive)
062            * @return the range of matching portlets
063            * @throws SystemException if a system exception occurred
064            */
065            public java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
066                    long companyId, int start, int end)
067                    throws com.liferay.portal.kernel.exception.SystemException;
068    
069            /**
070            * Returns an ordered range of all the portlets where companyId = &#63;.
071            *
072            * <p>
073            * 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.PortletModelImpl}. 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.
074            * </p>
075            *
076            * @param companyId the company ID
077            * @param start the lower bound of the range of portlets
078            * @param end the upper bound of the range of portlets (not inclusive)
079            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
080            * @return the ordered range of matching portlets
081            * @throws SystemException if a system exception occurred
082            */
083            public java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
084                    long companyId, int start, int end,
085                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
086                    throws com.liferay.portal.kernel.exception.SystemException;
087    
088            /**
089            * Returns the first portlet in the ordered set where companyId = &#63;.
090            *
091            * @param companyId the company ID
092            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
093            * @return the first matching portlet
094            * @throws com.liferay.portal.NoSuchPortletException if a matching portlet could not be found
095            * @throws SystemException if a system exception occurred
096            */
097            public com.liferay.portal.model.Portlet findByCompanyId_First(
098                    long companyId,
099                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
100                    throws com.liferay.portal.NoSuchPortletException,
101                            com.liferay.portal.kernel.exception.SystemException;
102    
103            /**
104            * Returns the first portlet in the ordered set where companyId = &#63;.
105            *
106            * @param companyId the company ID
107            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
108            * @return the first matching portlet, or <code>null</code> if a matching portlet could not be found
109            * @throws SystemException if a system exception occurred
110            */
111            public com.liferay.portal.model.Portlet fetchByCompanyId_First(
112                    long companyId,
113                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
114                    throws com.liferay.portal.kernel.exception.SystemException;
115    
116            /**
117            * Returns the last portlet in the ordered set where companyId = &#63;.
118            *
119            * @param companyId the company ID
120            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
121            * @return the last matching portlet
122            * @throws com.liferay.portal.NoSuchPortletException if a matching portlet could not be found
123            * @throws SystemException if a system exception occurred
124            */
125            public com.liferay.portal.model.Portlet findByCompanyId_Last(
126                    long companyId,
127                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
128                    throws com.liferay.portal.NoSuchPortletException,
129                            com.liferay.portal.kernel.exception.SystemException;
130    
131            /**
132            * Returns the last portlet in the ordered set where companyId = &#63;.
133            *
134            * @param companyId the company ID
135            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
136            * @return the last matching portlet, or <code>null</code> if a matching portlet could not be found
137            * @throws SystemException if a system exception occurred
138            */
139            public com.liferay.portal.model.Portlet fetchByCompanyId_Last(
140                    long companyId,
141                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
142                    throws com.liferay.portal.kernel.exception.SystemException;
143    
144            /**
145            * Returns the portlets before and after the current portlet in the ordered set where companyId = &#63;.
146            *
147            * @param id the primary key of the current portlet
148            * @param companyId the company ID
149            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
150            * @return the previous, current, and next portlet
151            * @throws com.liferay.portal.NoSuchPortletException if a portlet with the primary key could not be found
152            * @throws SystemException if a system exception occurred
153            */
154            public com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext(
155                    long id, long companyId,
156                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
157                    throws com.liferay.portal.NoSuchPortletException,
158                            com.liferay.portal.kernel.exception.SystemException;
159    
160            /**
161            * Removes all the portlets where companyId = &#63; from the database.
162            *
163            * @param companyId the company ID
164            * @throws SystemException if a system exception occurred
165            */
166            public void removeByCompanyId(long companyId)
167                    throws com.liferay.portal.kernel.exception.SystemException;
168    
169            /**
170            * Returns the number of portlets where companyId = &#63;.
171            *
172            * @param companyId the company ID
173            * @return the number of matching portlets
174            * @throws SystemException if a system exception occurred
175            */
176            public int countByCompanyId(long companyId)
177                    throws com.liferay.portal.kernel.exception.SystemException;
178    
179            /**
180            * Returns the portlet where companyId = &#63; and portletId = &#63; or throws a {@link com.liferay.portal.NoSuchPortletException} if it could not be found.
181            *
182            * @param companyId the company ID
183            * @param portletId the portlet ID
184            * @return the matching portlet
185            * @throws com.liferay.portal.NoSuchPortletException if a matching portlet could not be found
186            * @throws SystemException if a system exception occurred
187            */
188            public com.liferay.portal.model.Portlet findByC_P(long companyId,
189                    java.lang.String portletId)
190                    throws com.liferay.portal.NoSuchPortletException,
191                            com.liferay.portal.kernel.exception.SystemException;
192    
193            /**
194            * Returns the portlet where companyId = &#63; and portletId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
195            *
196            * @param companyId the company ID
197            * @param portletId the portlet ID
198            * @return the matching portlet, or <code>null</code> if a matching portlet could not be found
199            * @throws SystemException if a system exception occurred
200            */
201            public com.liferay.portal.model.Portlet fetchByC_P(long companyId,
202                    java.lang.String portletId)
203                    throws com.liferay.portal.kernel.exception.SystemException;
204    
205            /**
206            * Returns the portlet where companyId = &#63; and portletId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
207            *
208            * @param companyId the company ID
209            * @param portletId the portlet ID
210            * @param retrieveFromCache whether to use the finder cache
211            * @return the matching portlet, or <code>null</code> if a matching portlet could not be found
212            * @throws SystemException if a system exception occurred
213            */
214            public com.liferay.portal.model.Portlet fetchByC_P(long companyId,
215                    java.lang.String portletId, boolean retrieveFromCache)
216                    throws com.liferay.portal.kernel.exception.SystemException;
217    
218            /**
219            * Removes the portlet where companyId = &#63; and portletId = &#63; from the database.
220            *
221            * @param companyId the company ID
222            * @param portletId the portlet ID
223            * @return the portlet that was removed
224            * @throws SystemException if a system exception occurred
225            */
226            public com.liferay.portal.model.Portlet removeByC_P(long companyId,
227                    java.lang.String portletId)
228                    throws com.liferay.portal.NoSuchPortletException,
229                            com.liferay.portal.kernel.exception.SystemException;
230    
231            /**
232            * Returns the number of portlets where companyId = &#63; and portletId = &#63;.
233            *
234            * @param companyId the company ID
235            * @param portletId the portlet ID
236            * @return the number of matching portlets
237            * @throws SystemException if a system exception occurred
238            */
239            public int countByC_P(long companyId, java.lang.String portletId)
240                    throws com.liferay.portal.kernel.exception.SystemException;
241    
242            /**
243            * Caches the portlet in the entity cache if it is enabled.
244            *
245            * @param portlet the portlet
246            */
247            public void cacheResult(com.liferay.portal.model.Portlet portlet);
248    
249            /**
250            * Caches the portlets in the entity cache if it is enabled.
251            *
252            * @param portlets the portlets
253            */
254            public void cacheResult(
255                    java.util.List<com.liferay.portal.model.Portlet> portlets);
256    
257            /**
258            * Creates a new portlet with the primary key. Does not add the portlet to the database.
259            *
260            * @param id the primary key for the new portlet
261            * @return the new portlet
262            */
263            public com.liferay.portal.model.Portlet create(long id);
264    
265            /**
266            * Removes the portlet with the primary key from the database. Also notifies the appropriate model listeners.
267            *
268            * @param id the primary key of the portlet
269            * @return the portlet that was removed
270            * @throws com.liferay.portal.NoSuchPortletException if a portlet with the primary key could not be found
271            * @throws SystemException if a system exception occurred
272            */
273            public com.liferay.portal.model.Portlet remove(long id)
274                    throws com.liferay.portal.NoSuchPortletException,
275                            com.liferay.portal.kernel.exception.SystemException;
276    
277            public com.liferay.portal.model.Portlet updateImpl(
278                    com.liferay.portal.model.Portlet portlet)
279                    throws com.liferay.portal.kernel.exception.SystemException;
280    
281            /**
282            * Returns the portlet with the primary key or throws a {@link com.liferay.portal.NoSuchPortletException} if it could not be found.
283            *
284            * @param id the primary key of the portlet
285            * @return the portlet
286            * @throws com.liferay.portal.NoSuchPortletException if a portlet with the primary key could not be found
287            * @throws SystemException if a system exception occurred
288            */
289            public com.liferay.portal.model.Portlet findByPrimaryKey(long id)
290                    throws com.liferay.portal.NoSuchPortletException,
291                            com.liferay.portal.kernel.exception.SystemException;
292    
293            /**
294            * Returns the portlet with the primary key or returns <code>null</code> if it could not be found.
295            *
296            * @param id the primary key of the portlet
297            * @return the portlet, or <code>null</code> if a portlet with the primary key could not be found
298            * @throws SystemException if a system exception occurred
299            */
300            public com.liferay.portal.model.Portlet fetchByPrimaryKey(long id)
301                    throws com.liferay.portal.kernel.exception.SystemException;
302    
303            /**
304            * Returns all the portlets.
305            *
306            * @return the portlets
307            * @throws SystemException if a system exception occurred
308            */
309            public java.util.List<com.liferay.portal.model.Portlet> findAll()
310                    throws com.liferay.portal.kernel.exception.SystemException;
311    
312            /**
313            * Returns a range of all the portlets.
314            *
315            * <p>
316            * 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.PortletModelImpl}. 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.
317            * </p>
318            *
319            * @param start the lower bound of the range of portlets
320            * @param end the upper bound of the range of portlets (not inclusive)
321            * @return the range of portlets
322            * @throws SystemException if a system exception occurred
323            */
324            public java.util.List<com.liferay.portal.model.Portlet> findAll(int start,
325                    int end) throws com.liferay.portal.kernel.exception.SystemException;
326    
327            /**
328            * Returns an ordered range of all the portlets.
329            *
330            * <p>
331            * 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.PortletModelImpl}. 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.
332            * </p>
333            *
334            * @param start the lower bound of the range of portlets
335            * @param end the upper bound of the range of portlets (not inclusive)
336            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
337            * @return the ordered range of portlets
338            * @throws SystemException if a system exception occurred
339            */
340            public java.util.List<com.liferay.portal.model.Portlet> findAll(int start,
341                    int end,
342                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
343                    throws com.liferay.portal.kernel.exception.SystemException;
344    
345            /**
346            * Removes all the portlets from the database.
347            *
348            * @throws SystemException if a system exception occurred
349            */
350            public void removeAll()
351                    throws com.liferay.portal.kernel.exception.SystemException;
352    
353            /**
354            * Returns the number of portlets.
355            *
356            * @return the number of portlets
357            * @throws SystemException if a system exception occurred
358            */
359            public int countAll()
360                    throws com.liferay.portal.kernel.exception.SystemException;
361    }