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