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