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