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