001    /**
002     * Copyright (c) 2000-2012 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.portlet.trash.service.persistence;
016    
017    import com.liferay.portal.service.persistence.BasePersistence;
018    
019    import com.liferay.portlet.trash.model.TrashVersion;
020    
021    /**
022     * The persistence interface for the trash version 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 TrashVersionPersistenceImpl
030     * @see TrashVersionUtil
031     * @generated
032     */
033    public interface TrashVersionPersistence extends BasePersistence<TrashVersion> {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify or reference this interface directly. Always use {@link TrashVersionUtil} to access the trash version persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
038             */
039    
040            /**
041            * Caches the trash version in the entity cache if it is enabled.
042            *
043            * @param trashVersion the trash version
044            */
045            public void cacheResult(
046                    com.liferay.portlet.trash.model.TrashVersion trashVersion);
047    
048            /**
049            * Caches the trash versions in the entity cache if it is enabled.
050            *
051            * @param trashVersions the trash versions
052            */
053            public void cacheResult(
054                    java.util.List<com.liferay.portlet.trash.model.TrashVersion> trashVersions);
055    
056            /**
057            * Creates a new trash version with the primary key. Does not add the trash version to the database.
058            *
059            * @param versionId the primary key for the new trash version
060            * @return the new trash version
061            */
062            public com.liferay.portlet.trash.model.TrashVersion create(long versionId);
063    
064            /**
065            * Removes the trash version with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param versionId the primary key of the trash version
068            * @return the trash version that was removed
069            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public com.liferay.portlet.trash.model.TrashVersion remove(long versionId)
073                    throws com.liferay.portal.kernel.exception.SystemException,
074                            com.liferay.portlet.trash.NoSuchVersionException;
075    
076            public com.liferay.portlet.trash.model.TrashVersion updateImpl(
077                    com.liferay.portlet.trash.model.TrashVersion trashVersion)
078                    throws com.liferay.portal.kernel.exception.SystemException;
079    
080            /**
081            * Returns the trash version with the primary key or throws a {@link com.liferay.portlet.trash.NoSuchVersionException} if it could not be found.
082            *
083            * @param versionId the primary key of the trash version
084            * @return the trash version
085            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
086            * @throws SystemException if a system exception occurred
087            */
088            public com.liferay.portlet.trash.model.TrashVersion findByPrimaryKey(
089                    long versionId)
090                    throws com.liferay.portal.kernel.exception.SystemException,
091                            com.liferay.portlet.trash.NoSuchVersionException;
092    
093            /**
094            * Returns the trash version with the primary key or returns <code>null</code> if it could not be found.
095            *
096            * @param versionId the primary key of the trash version
097            * @return the trash version, or <code>null</code> if a trash version with the primary key could not be found
098            * @throws SystemException if a system exception occurred
099            */
100            public com.liferay.portlet.trash.model.TrashVersion fetchByPrimaryKey(
101                    long versionId)
102                    throws com.liferay.portal.kernel.exception.SystemException;
103    
104            /**
105            * Returns all the trash versions where entryId = &#63;.
106            *
107            * @param entryId the entry ID
108            * @return the matching trash versions
109            * @throws SystemException if a system exception occurred
110            */
111            public java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByEntryId(
112                    long entryId)
113                    throws com.liferay.portal.kernel.exception.SystemException;
114    
115            /**
116            * Returns a range of all the trash versions where entryId = &#63;.
117            *
118            * <p>
119            * 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.
120            * </p>
121            *
122            * @param entryId the entry ID
123            * @param start the lower bound of the range of trash versions
124            * @param end the upper bound of the range of trash versions (not inclusive)
125            * @return the range of matching trash versions
126            * @throws SystemException if a system exception occurred
127            */
128            public java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByEntryId(
129                    long entryId, int start, int end)
130                    throws com.liferay.portal.kernel.exception.SystemException;
131    
132            /**
133            * Returns an ordered range of all the trash versions where entryId = &#63;.
134            *
135            * <p>
136            * 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.
137            * </p>
138            *
139            * @param entryId the entry ID
140            * @param start the lower bound of the range of trash versions
141            * @param end the upper bound of the range of trash versions (not inclusive)
142            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
143            * @return the ordered range of matching trash versions
144            * @throws SystemException if a system exception occurred
145            */
146            public java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByEntryId(
147                    long entryId, int start, int end,
148                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
149                    throws com.liferay.portal.kernel.exception.SystemException;
150    
151            /**
152            * Returns the first trash version in the ordered set where entryId = &#63;.
153            *
154            * @param entryId the entry ID
155            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
156            * @return the first matching trash version
157            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
158            * @throws SystemException if a system exception occurred
159            */
160            public com.liferay.portlet.trash.model.TrashVersion findByEntryId_First(
161                    long entryId,
162                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
163                    throws com.liferay.portal.kernel.exception.SystemException,
164                            com.liferay.portlet.trash.NoSuchVersionException;
165    
166            /**
167            * Returns the first trash version in the ordered set where entryId = &#63;.
168            *
169            * @param entryId the entry ID
170            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
171            * @return the first matching trash version, or <code>null</code> if a matching trash version could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public com.liferay.portlet.trash.model.TrashVersion fetchByEntryId_First(
175                    long entryId,
176                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
177                    throws com.liferay.portal.kernel.exception.SystemException;
178    
179            /**
180            * Returns the last trash version in the ordered set where entryId = &#63;.
181            *
182            * @param entryId the entry ID
183            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
184            * @return the last matching trash version
185            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
186            * @throws SystemException if a system exception occurred
187            */
188            public com.liferay.portlet.trash.model.TrashVersion findByEntryId_Last(
189                    long entryId,
190                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
191                    throws com.liferay.portal.kernel.exception.SystemException,
192                            com.liferay.portlet.trash.NoSuchVersionException;
193    
194            /**
195            * Returns the last trash version in the ordered set where entryId = &#63;.
196            *
197            * @param entryId the entry ID
198            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
199            * @return the last matching trash version, or <code>null</code> if a matching trash version could not be found
200            * @throws SystemException if a system exception occurred
201            */
202            public com.liferay.portlet.trash.model.TrashVersion fetchByEntryId_Last(
203                    long entryId,
204                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
205                    throws com.liferay.portal.kernel.exception.SystemException;
206    
207            /**
208            * Returns the trash versions before and after the current trash version in the ordered set where entryId = &#63;.
209            *
210            * @param versionId the primary key of the current trash version
211            * @param entryId the entry ID
212            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
213            * @return the previous, current, and next trash version
214            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
215            * @throws SystemException if a system exception occurred
216            */
217            public com.liferay.portlet.trash.model.TrashVersion[] findByEntryId_PrevAndNext(
218                    long versionId, long entryId,
219                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
220                    throws com.liferay.portal.kernel.exception.SystemException,
221                            com.liferay.portlet.trash.NoSuchVersionException;
222    
223            /**
224            * Returns all the trash versions where classNameId = &#63; and classPK = &#63;.
225            *
226            * @param classNameId the class name ID
227            * @param classPK the class p k
228            * @return the matching trash versions
229            * @throws SystemException if a system exception occurred
230            */
231            public java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByC_C(
232                    long classNameId, long classPK)
233                    throws com.liferay.portal.kernel.exception.SystemException;
234    
235            /**
236            * Returns a range of all the trash versions where classNameId = &#63; and classPK = &#63;.
237            *
238            * <p>
239            * 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.
240            * </p>
241            *
242            * @param classNameId the class name ID
243            * @param classPK the class p k
244            * @param start the lower bound of the range of trash versions
245            * @param end the upper bound of the range of trash versions (not inclusive)
246            * @return the range of matching trash versions
247            * @throws SystemException if a system exception occurred
248            */
249            public java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByC_C(
250                    long classNameId, long classPK, int start, int end)
251                    throws com.liferay.portal.kernel.exception.SystemException;
252    
253            /**
254            * Returns an ordered range of all the trash versions where classNameId = &#63; and classPK = &#63;.
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 classNameId the class name ID
261            * @param classPK the class p k
262            * @param start the lower bound of the range of trash versions
263            * @param end the upper bound of the range of trash versions (not inclusive)
264            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
265            * @return the ordered range of matching trash versions
266            * @throws SystemException if a system exception occurred
267            */
268            public java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByC_C(
269                    long classNameId, long classPK, int start, int end,
270                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
271                    throws com.liferay.portal.kernel.exception.SystemException;
272    
273            /**
274            * Returns the first trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
275            *
276            * @param classNameId the class name ID
277            * @param classPK the class p k
278            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
279            * @return the first matching trash version
280            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
281            * @throws SystemException if a system exception occurred
282            */
283            public com.liferay.portlet.trash.model.TrashVersion findByC_C_First(
284                    long classNameId, long classPK,
285                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
286                    throws com.liferay.portal.kernel.exception.SystemException,
287                            com.liferay.portlet.trash.NoSuchVersionException;
288    
289            /**
290            * Returns the first trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
291            *
292            * @param classNameId the class name ID
293            * @param classPK the class p k
294            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
295            * @return the first matching trash version, or <code>null</code> if a matching trash version could not be found
296            * @throws SystemException if a system exception occurred
297            */
298            public com.liferay.portlet.trash.model.TrashVersion fetchByC_C_First(
299                    long classNameId, long classPK,
300                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
301                    throws com.liferay.portal.kernel.exception.SystemException;
302    
303            /**
304            * Returns the last trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
305            *
306            * @param classNameId the class name ID
307            * @param classPK the class p k
308            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
309            * @return the last matching trash version
310            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
311            * @throws SystemException if a system exception occurred
312            */
313            public com.liferay.portlet.trash.model.TrashVersion findByC_C_Last(
314                    long classNameId, long classPK,
315                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
316                    throws com.liferay.portal.kernel.exception.SystemException,
317                            com.liferay.portlet.trash.NoSuchVersionException;
318    
319            /**
320            * Returns the last trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
321            *
322            * @param classNameId the class name ID
323            * @param classPK the class p k
324            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
325            * @return the last matching trash version, or <code>null</code> if a matching trash version could not be found
326            * @throws SystemException if a system exception occurred
327            */
328            public com.liferay.portlet.trash.model.TrashVersion fetchByC_C_Last(
329                    long classNameId, long classPK,
330                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
331                    throws com.liferay.portal.kernel.exception.SystemException;
332    
333            /**
334            * Returns the trash versions before and after the current trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
335            *
336            * @param versionId the primary key of the current trash version
337            * @param classNameId the class name ID
338            * @param classPK the class p k
339            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
340            * @return the previous, current, and next trash version
341            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
342            * @throws SystemException if a system exception occurred
343            */
344            public com.liferay.portlet.trash.model.TrashVersion[] findByC_C_PrevAndNext(
345                    long versionId, long classNameId, long classPK,
346                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
347                    throws com.liferay.portal.kernel.exception.SystemException,
348                            com.liferay.portlet.trash.NoSuchVersionException;
349    
350            /**
351            * Returns all the trash versions.
352            *
353            * @return the trash versions
354            * @throws SystemException if a system exception occurred
355            */
356            public java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll()
357                    throws com.liferay.portal.kernel.exception.SystemException;
358    
359            /**
360            * Returns a range of all the trash versions.
361            *
362            * <p>
363            * 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.
364            * </p>
365            *
366            * @param start the lower bound of the range of trash versions
367            * @param end the upper bound of the range of trash versions (not inclusive)
368            * @return the range of trash versions
369            * @throws SystemException if a system exception occurred
370            */
371            public java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll(
372                    int start, int end)
373                    throws com.liferay.portal.kernel.exception.SystemException;
374    
375            /**
376            * Returns an ordered range of all the trash versions.
377            *
378            * <p>
379            * 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.
380            * </p>
381            *
382            * @param start the lower bound of the range of trash versions
383            * @param end the upper bound of the range of trash versions (not inclusive)
384            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
385            * @return the ordered range of trash versions
386            * @throws SystemException if a system exception occurred
387            */
388            public java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll(
389                    int start, int end,
390                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
391                    throws com.liferay.portal.kernel.exception.SystemException;
392    
393            /**
394            * Removes all the trash versions where entryId = &#63; from the database.
395            *
396            * @param entryId the entry ID
397            * @throws SystemException if a system exception occurred
398            */
399            public void removeByEntryId(long entryId)
400                    throws com.liferay.portal.kernel.exception.SystemException;
401    
402            /**
403            * Removes all the trash versions where classNameId = &#63; and classPK = &#63; from the database.
404            *
405            * @param classNameId the class name ID
406            * @param classPK the class p k
407            * @throws SystemException if a system exception occurred
408            */
409            public void removeByC_C(long classNameId, long classPK)
410                    throws com.liferay.portal.kernel.exception.SystemException;
411    
412            /**
413            * Removes all the trash versions from the database.
414            *
415            * @throws SystemException if a system exception occurred
416            */
417            public void removeAll()
418                    throws com.liferay.portal.kernel.exception.SystemException;
419    
420            /**
421            * Returns the number of trash versions where entryId = &#63;.
422            *
423            * @param entryId the entry ID
424            * @return the number of matching trash versions
425            * @throws SystemException if a system exception occurred
426            */
427            public int countByEntryId(long entryId)
428                    throws com.liferay.portal.kernel.exception.SystemException;
429    
430            /**
431            * Returns the number of trash versions where classNameId = &#63; and classPK = &#63;.
432            *
433            * @param classNameId the class name ID
434            * @param classPK the class p k
435            * @return the number of matching trash versions
436            * @throws SystemException if a system exception occurred
437            */
438            public int countByC_C(long classNameId, long classPK)
439                    throws com.liferay.portal.kernel.exception.SystemException;
440    
441            /**
442            * Returns the number of trash versions.
443            *
444            * @return the number of trash versions
445            * @throws SystemException if a system exception occurred
446            */
447            public int countAll()
448                    throws com.liferay.portal.kernel.exception.SystemException;
449    }