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