001    /**
002     * Copyright (c) 2000-2013 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.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import com.liferay.portlet.trash.model.TrashVersion;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the trash version service. This utility wraps {@link TrashVersionPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
030     *
031     * <p>
032     * Caching information and settings can be found in <code>portal.properties</code>
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see TrashVersionPersistence
037     * @see TrashVersionPersistenceImpl
038     * @generated
039     */
040    public class TrashVersionUtil {
041            /*
042             * NOTE FOR DEVELOPERS:
043             *
044             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
045             */
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
049             */
050            public static void clearCache() {
051                    getPersistence().clearCache();
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
056             */
057            public static void clearCache(TrashVersion trashVersion) {
058                    getPersistence().clearCache(trashVersion);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
063             */
064            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
065                    throws SystemException {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<TrashVersion> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) throws SystemException {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery);
075            }
076    
077            /**
078             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
079             */
080            public static List<TrashVersion> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end)
082                    throws SystemException {
083                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
084            }
085    
086            /**
087             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
088             */
089            public static List<TrashVersion> findWithDynamicQuery(
090                    DynamicQuery dynamicQuery, int start, int end,
091                    OrderByComparator orderByComparator) throws SystemException {
092                    return getPersistence()
093                                       .findWithDynamicQuery(dynamicQuery, start, end,
094                            orderByComparator);
095            }
096    
097            /**
098             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
099             */
100            public static TrashVersion update(TrashVersion trashVersion)
101                    throws SystemException {
102                    return getPersistence().update(trashVersion);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static TrashVersion update(TrashVersion trashVersion,
109                    ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(trashVersion, serviceContext);
111            }
112    
113            /**
114            * Returns all the trash versions where entryId = &#63;.
115            *
116            * @param entryId the entry ID
117            * @return the matching trash versions
118            * @throws SystemException if a system exception occurred
119            */
120            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByEntryId(
121                    long entryId)
122                    throws com.liferay.portal.kernel.exception.SystemException {
123                    return getPersistence().findByEntryId(entryId);
124            }
125    
126            /**
127            * Returns a range of all the trash versions where entryId = &#63;.
128            *
129            * <p>
130            * 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.
131            * </p>
132            *
133            * @param entryId the entry ID
134            * @param start the lower bound of the range of trash versions
135            * @param end the upper bound of the range of trash versions (not inclusive)
136            * @return the range of matching trash versions
137            * @throws SystemException if a system exception occurred
138            */
139            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByEntryId(
140                    long entryId, int start, int end)
141                    throws com.liferay.portal.kernel.exception.SystemException {
142                    return getPersistence().findByEntryId(entryId, start, end);
143            }
144    
145            /**
146            * Returns an ordered range of all the trash versions where entryId = &#63;.
147            *
148            * <p>
149            * 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.
150            * </p>
151            *
152            * @param entryId the entry ID
153            * @param start the lower bound of the range of trash versions
154            * @param end the upper bound of the range of trash versions (not inclusive)
155            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
156            * @return the ordered range of matching trash versions
157            * @throws SystemException if a system exception occurred
158            */
159            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByEntryId(
160                    long entryId, int start, int end,
161                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence()
164                                       .findByEntryId(entryId, start, end, orderByComparator);
165            }
166    
167            /**
168            * Returns the first trash version in the ordered set where entryId = &#63;.
169            *
170            * @param entryId the entry ID
171            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
172            * @return the first matching trash version
173            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public static com.liferay.portlet.trash.model.TrashVersion findByEntryId_First(
177                    long entryId,
178                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
179                    throws com.liferay.portal.kernel.exception.SystemException,
180                            com.liferay.portlet.trash.NoSuchVersionException {
181                    return getPersistence().findByEntryId_First(entryId, orderByComparator);
182            }
183    
184            /**
185            * Returns the first trash version in the ordered set where entryId = &#63;.
186            *
187            * @param entryId the entry ID
188            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
189            * @return the first matching trash version, or <code>null</code> if a matching trash version could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portlet.trash.model.TrashVersion fetchByEntryId_First(
193                    long entryId,
194                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
195                    throws com.liferay.portal.kernel.exception.SystemException {
196                    return getPersistence().fetchByEntryId_First(entryId, orderByComparator);
197            }
198    
199            /**
200            * Returns the last trash version in the ordered set where entryId = &#63;.
201            *
202            * @param entryId the entry ID
203            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
204            * @return the last matching trash version
205            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
206            * @throws SystemException if a system exception occurred
207            */
208            public static com.liferay.portlet.trash.model.TrashVersion findByEntryId_Last(
209                    long entryId,
210                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
211                    throws com.liferay.portal.kernel.exception.SystemException,
212                            com.liferay.portlet.trash.NoSuchVersionException {
213                    return getPersistence().findByEntryId_Last(entryId, orderByComparator);
214            }
215    
216            /**
217            * Returns the last trash version in the ordered set where entryId = &#63;.
218            *
219            * @param entryId the entry ID
220            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
221            * @return the last matching trash version, or <code>null</code> if a matching trash version could not be found
222            * @throws SystemException if a system exception occurred
223            */
224            public static com.liferay.portlet.trash.model.TrashVersion fetchByEntryId_Last(
225                    long entryId,
226                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getPersistence().fetchByEntryId_Last(entryId, orderByComparator);
229            }
230    
231            /**
232            * Returns the trash versions before and after the current trash version in the ordered set where entryId = &#63;.
233            *
234            * @param versionId the primary key of the current trash version
235            * @param entryId the entry ID
236            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
237            * @return the previous, current, and next trash version
238            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portlet.trash.model.TrashVersion[] findByEntryId_PrevAndNext(
242                    long versionId, long entryId,
243                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
244                    throws com.liferay.portal.kernel.exception.SystemException,
245                            com.liferay.portlet.trash.NoSuchVersionException {
246                    return getPersistence()
247                                       .findByEntryId_PrevAndNext(versionId, entryId,
248                            orderByComparator);
249            }
250    
251            /**
252            * Removes all the trash versions where entryId = &#63; from the database.
253            *
254            * @param entryId the entry ID
255            * @throws SystemException if a system exception occurred
256            */
257            public static void removeByEntryId(long entryId)
258                    throws com.liferay.portal.kernel.exception.SystemException {
259                    getPersistence().removeByEntryId(entryId);
260            }
261    
262            /**
263            * Returns the number of trash versions where entryId = &#63;.
264            *
265            * @param entryId the entry ID
266            * @return the number of matching trash versions
267            * @throws SystemException if a system exception occurred
268            */
269            public static int countByEntryId(long entryId)
270                    throws com.liferay.portal.kernel.exception.SystemException {
271                    return getPersistence().countByEntryId(entryId);
272            }
273    
274            /**
275            * Returns all the trash versions where entryId = &#63; and classNameId = &#63;.
276            *
277            * @param entryId the entry ID
278            * @param classNameId the class name ID
279            * @return the matching trash versions
280            * @throws SystemException if a system exception occurred
281            */
282            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByE_C(
283                    long entryId, long classNameId)
284                    throws com.liferay.portal.kernel.exception.SystemException {
285                    return getPersistence().findByE_C(entryId, classNameId);
286            }
287    
288            /**
289            * Returns a range of all the trash versions where entryId = &#63; and classNameId = &#63;.
290            *
291            * <p>
292            * 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.
293            * </p>
294            *
295            * @param entryId the entry ID
296            * @param classNameId the class name ID
297            * @param start the lower bound of the range of trash versions
298            * @param end the upper bound of the range of trash versions (not inclusive)
299            * @return the range of matching trash versions
300            * @throws SystemException if a system exception occurred
301            */
302            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByE_C(
303                    long entryId, long classNameId, int start, int end)
304                    throws com.liferay.portal.kernel.exception.SystemException {
305                    return getPersistence().findByE_C(entryId, classNameId, start, end);
306            }
307    
308            /**
309            * Returns an ordered range of all the trash versions where entryId = &#63; and classNameId = &#63;.
310            *
311            * <p>
312            * 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.
313            * </p>
314            *
315            * @param entryId the entry ID
316            * @param classNameId the class name ID
317            * @param start the lower bound of the range of trash versions
318            * @param end the upper bound of the range of trash versions (not inclusive)
319            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
320            * @return the ordered range of matching trash versions
321            * @throws SystemException if a system exception occurred
322            */
323            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByE_C(
324                    long entryId, long classNameId, int start, int end,
325                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
326                    throws com.liferay.portal.kernel.exception.SystemException {
327                    return getPersistence()
328                                       .findByE_C(entryId, classNameId, start, end,
329                            orderByComparator);
330            }
331    
332            /**
333            * Returns the first trash version in the ordered set where entryId = &#63; and classNameId = &#63;.
334            *
335            * @param entryId the entry ID
336            * @param classNameId the class name ID
337            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
338            * @return the first matching trash version
339            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
340            * @throws SystemException if a system exception occurred
341            */
342            public static com.liferay.portlet.trash.model.TrashVersion findByE_C_First(
343                    long entryId, long classNameId,
344                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
345                    throws com.liferay.portal.kernel.exception.SystemException,
346                            com.liferay.portlet.trash.NoSuchVersionException {
347                    return getPersistence()
348                                       .findByE_C_First(entryId, classNameId, orderByComparator);
349            }
350    
351            /**
352            * Returns the first trash version in the ordered set where entryId = &#63; and classNameId = &#63;.
353            *
354            * @param entryId the entry ID
355            * @param classNameId the class name ID
356            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
357            * @return the first matching trash version, or <code>null</code> if a matching trash version could not be found
358            * @throws SystemException if a system exception occurred
359            */
360            public static com.liferay.portlet.trash.model.TrashVersion fetchByE_C_First(
361                    long entryId, long classNameId,
362                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
363                    throws com.liferay.portal.kernel.exception.SystemException {
364                    return getPersistence()
365                                       .fetchByE_C_First(entryId, classNameId, orderByComparator);
366            }
367    
368            /**
369            * Returns the last trash version in the ordered set where entryId = &#63; and classNameId = &#63;.
370            *
371            * @param entryId the entry ID
372            * @param classNameId the class name ID
373            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
374            * @return the last matching trash version
375            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
376            * @throws SystemException if a system exception occurred
377            */
378            public static com.liferay.portlet.trash.model.TrashVersion findByE_C_Last(
379                    long entryId, long classNameId,
380                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
381                    throws com.liferay.portal.kernel.exception.SystemException,
382                            com.liferay.portlet.trash.NoSuchVersionException {
383                    return getPersistence()
384                                       .findByE_C_Last(entryId, classNameId, orderByComparator);
385            }
386    
387            /**
388            * Returns the last trash version in the ordered set where entryId = &#63; and classNameId = &#63;.
389            *
390            * @param entryId the entry ID
391            * @param classNameId the class name ID
392            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
393            * @return the last matching trash version, or <code>null</code> if a matching trash version could not be found
394            * @throws SystemException if a system exception occurred
395            */
396            public static com.liferay.portlet.trash.model.TrashVersion fetchByE_C_Last(
397                    long entryId, long classNameId,
398                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
399                    throws com.liferay.portal.kernel.exception.SystemException {
400                    return getPersistence()
401                                       .fetchByE_C_Last(entryId, classNameId, orderByComparator);
402            }
403    
404            /**
405            * Returns the trash versions before and after the current trash version in the ordered set where entryId = &#63; and classNameId = &#63;.
406            *
407            * @param versionId the primary key of the current trash version
408            * @param entryId the entry ID
409            * @param classNameId the class name ID
410            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
411            * @return the previous, current, and next trash version
412            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
413            * @throws SystemException if a system exception occurred
414            */
415            public static com.liferay.portlet.trash.model.TrashVersion[] findByE_C_PrevAndNext(
416                    long versionId, long entryId, long classNameId,
417                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
418                    throws com.liferay.portal.kernel.exception.SystemException,
419                            com.liferay.portlet.trash.NoSuchVersionException {
420                    return getPersistence()
421                                       .findByE_C_PrevAndNext(versionId, entryId, classNameId,
422                            orderByComparator);
423            }
424    
425            /**
426            * Removes all the trash versions where entryId = &#63; and classNameId = &#63; from the database.
427            *
428            * @param entryId the entry ID
429            * @param classNameId the class name ID
430            * @throws SystemException if a system exception occurred
431            */
432            public static void removeByE_C(long entryId, long classNameId)
433                    throws com.liferay.portal.kernel.exception.SystemException {
434                    getPersistence().removeByE_C(entryId, classNameId);
435            }
436    
437            /**
438            * Returns the number of trash versions where entryId = &#63; and classNameId = &#63;.
439            *
440            * @param entryId the entry ID
441            * @param classNameId the class name ID
442            * @return the number of matching trash versions
443            * @throws SystemException if a system exception occurred
444            */
445            public static int countByE_C(long entryId, long classNameId)
446                    throws com.liferay.portal.kernel.exception.SystemException {
447                    return getPersistence().countByE_C(entryId, classNameId);
448            }
449    
450            /**
451            * Returns all the trash versions where classNameId = &#63; and classPK = &#63;.
452            *
453            * @param classNameId the class name ID
454            * @param classPK the class p k
455            * @return the matching trash versions
456            * @throws SystemException if a system exception occurred
457            */
458            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByC_C(
459                    long classNameId, long classPK)
460                    throws com.liferay.portal.kernel.exception.SystemException {
461                    return getPersistence().findByC_C(classNameId, classPK);
462            }
463    
464            /**
465            * Returns a range of all the trash versions where classNameId = &#63; and classPK = &#63;.
466            *
467            * <p>
468            * 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.
469            * </p>
470            *
471            * @param classNameId the class name ID
472            * @param classPK the class p k
473            * @param start the lower bound of the range of trash versions
474            * @param end the upper bound of the range of trash versions (not inclusive)
475            * @return the range of matching trash versions
476            * @throws SystemException if a system exception occurred
477            */
478            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByC_C(
479                    long classNameId, long classPK, int start, int end)
480                    throws com.liferay.portal.kernel.exception.SystemException {
481                    return getPersistence().findByC_C(classNameId, classPK, start, end);
482            }
483    
484            /**
485            * Returns an ordered range of all the trash versions where classNameId = &#63; and classPK = &#63;.
486            *
487            * <p>
488            * 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.
489            * </p>
490            *
491            * @param classNameId the class name ID
492            * @param classPK the class p k
493            * @param start the lower bound of the range of trash versions
494            * @param end the upper bound of the range of trash versions (not inclusive)
495            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
496            * @return the ordered range of matching trash versions
497            * @throws SystemException if a system exception occurred
498            */
499            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByC_C(
500                    long classNameId, long classPK, int start, int end,
501                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
502                    throws com.liferay.portal.kernel.exception.SystemException {
503                    return getPersistence()
504                                       .findByC_C(classNameId, classPK, start, end,
505                            orderByComparator);
506            }
507    
508            /**
509            * Returns the first trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
510            *
511            * @param classNameId the class name ID
512            * @param classPK the class p k
513            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
514            * @return the first matching trash version
515            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
516            * @throws SystemException if a system exception occurred
517            */
518            public static com.liferay.portlet.trash.model.TrashVersion findByC_C_First(
519                    long classNameId, long classPK,
520                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
521                    throws com.liferay.portal.kernel.exception.SystemException,
522                            com.liferay.portlet.trash.NoSuchVersionException {
523                    return getPersistence()
524                                       .findByC_C_First(classNameId, classPK, orderByComparator);
525            }
526    
527            /**
528            * Returns the first trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
529            *
530            * @param classNameId the class name ID
531            * @param classPK the class p k
532            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
533            * @return the first matching trash version, or <code>null</code> if a matching trash version could not be found
534            * @throws SystemException if a system exception occurred
535            */
536            public static com.liferay.portlet.trash.model.TrashVersion fetchByC_C_First(
537                    long classNameId, long classPK,
538                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
539                    throws com.liferay.portal.kernel.exception.SystemException {
540                    return getPersistence()
541                                       .fetchByC_C_First(classNameId, classPK, orderByComparator);
542            }
543    
544            /**
545            * Returns the last trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
546            *
547            * @param classNameId the class name ID
548            * @param classPK the class p k
549            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
550            * @return the last matching trash version
551            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
552            * @throws SystemException if a system exception occurred
553            */
554            public static com.liferay.portlet.trash.model.TrashVersion findByC_C_Last(
555                    long classNameId, long classPK,
556                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
557                    throws com.liferay.portal.kernel.exception.SystemException,
558                            com.liferay.portlet.trash.NoSuchVersionException {
559                    return getPersistence()
560                                       .findByC_C_Last(classNameId, classPK, orderByComparator);
561            }
562    
563            /**
564            * Returns the last trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
565            *
566            * @param classNameId the class name ID
567            * @param classPK the class p k
568            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
569            * @return the last matching trash version, or <code>null</code> if a matching trash version could not be found
570            * @throws SystemException if a system exception occurred
571            */
572            public static com.liferay.portlet.trash.model.TrashVersion fetchByC_C_Last(
573                    long classNameId, long classPK,
574                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
575                    throws com.liferay.portal.kernel.exception.SystemException {
576                    return getPersistence()
577                                       .fetchByC_C_Last(classNameId, classPK, orderByComparator);
578            }
579    
580            /**
581            * Returns the trash versions before and after the current trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
582            *
583            * @param versionId the primary key of the current trash version
584            * @param classNameId the class name ID
585            * @param classPK the class p k
586            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
587            * @return the previous, current, and next trash version
588            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
589            * @throws SystemException if a system exception occurred
590            */
591            public static com.liferay.portlet.trash.model.TrashVersion[] findByC_C_PrevAndNext(
592                    long versionId, long classNameId, long classPK,
593                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
594                    throws com.liferay.portal.kernel.exception.SystemException,
595                            com.liferay.portlet.trash.NoSuchVersionException {
596                    return getPersistence()
597                                       .findByC_C_PrevAndNext(versionId, classNameId, classPK,
598                            orderByComparator);
599            }
600    
601            /**
602            * Removes all the trash versions where classNameId = &#63; and classPK = &#63; from the database.
603            *
604            * @param classNameId the class name ID
605            * @param classPK the class p k
606            * @throws SystemException if a system exception occurred
607            */
608            public static void removeByC_C(long classNameId, long classPK)
609                    throws com.liferay.portal.kernel.exception.SystemException {
610                    getPersistence().removeByC_C(classNameId, classPK);
611            }
612    
613            /**
614            * Returns the number of trash versions where classNameId = &#63; and classPK = &#63;.
615            *
616            * @param classNameId the class name ID
617            * @param classPK the class p k
618            * @return the number of matching trash versions
619            * @throws SystemException if a system exception occurred
620            */
621            public static int countByC_C(long classNameId, long classPK)
622                    throws com.liferay.portal.kernel.exception.SystemException {
623                    return getPersistence().countByC_C(classNameId, classPK);
624            }
625    
626            /**
627            * Returns the trash version where entryId = &#63; and classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portlet.trash.NoSuchVersionException} if it could not be found.
628            *
629            * @param entryId the entry ID
630            * @param classNameId the class name ID
631            * @param classPK the class p k
632            * @return the matching trash version
633            * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found
634            * @throws SystemException if a system exception occurred
635            */
636            public static com.liferay.portlet.trash.model.TrashVersion findByE_C_C(
637                    long entryId, long classNameId, long classPK)
638                    throws com.liferay.portal.kernel.exception.SystemException,
639                            com.liferay.portlet.trash.NoSuchVersionException {
640                    return getPersistence().findByE_C_C(entryId, classNameId, classPK);
641            }
642    
643            /**
644            * Returns the trash version where entryId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
645            *
646            * @param entryId the entry ID
647            * @param classNameId the class name ID
648            * @param classPK the class p k
649            * @return the matching trash version, or <code>null</code> if a matching trash version could not be found
650            * @throws SystemException if a system exception occurred
651            */
652            public static com.liferay.portlet.trash.model.TrashVersion fetchByE_C_C(
653                    long entryId, long classNameId, long classPK)
654                    throws com.liferay.portal.kernel.exception.SystemException {
655                    return getPersistence().fetchByE_C_C(entryId, classNameId, classPK);
656            }
657    
658            /**
659            * Returns the trash version where entryId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
660            *
661            * @param entryId the entry ID
662            * @param classNameId the class name ID
663            * @param classPK the class p k
664            * @param retrieveFromCache whether to use the finder cache
665            * @return the matching trash version, or <code>null</code> if a matching trash version could not be found
666            * @throws SystemException if a system exception occurred
667            */
668            public static com.liferay.portlet.trash.model.TrashVersion fetchByE_C_C(
669                    long entryId, long classNameId, long classPK, boolean retrieveFromCache)
670                    throws com.liferay.portal.kernel.exception.SystemException {
671                    return getPersistence()
672                                       .fetchByE_C_C(entryId, classNameId, classPK,
673                            retrieveFromCache);
674            }
675    
676            /**
677            * Removes the trash version where entryId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
678            *
679            * @param entryId the entry ID
680            * @param classNameId the class name ID
681            * @param classPK the class p k
682            * @return the trash version that was removed
683            * @throws SystemException if a system exception occurred
684            */
685            public static com.liferay.portlet.trash.model.TrashVersion removeByE_C_C(
686                    long entryId, long classNameId, long classPK)
687                    throws com.liferay.portal.kernel.exception.SystemException,
688                            com.liferay.portlet.trash.NoSuchVersionException {
689                    return getPersistence().removeByE_C_C(entryId, classNameId, classPK);
690            }
691    
692            /**
693            * Returns the number of trash versions where entryId = &#63; and classNameId = &#63; and classPK = &#63;.
694            *
695            * @param entryId the entry ID
696            * @param classNameId the class name ID
697            * @param classPK the class p k
698            * @return the number of matching trash versions
699            * @throws SystemException if a system exception occurred
700            */
701            public static int countByE_C_C(long entryId, long classNameId, long classPK)
702                    throws com.liferay.portal.kernel.exception.SystemException {
703                    return getPersistence().countByE_C_C(entryId, classNameId, classPK);
704            }
705    
706            /**
707            * Caches the trash version in the entity cache if it is enabled.
708            *
709            * @param trashVersion the trash version
710            */
711            public static void cacheResult(
712                    com.liferay.portlet.trash.model.TrashVersion trashVersion) {
713                    getPersistence().cacheResult(trashVersion);
714            }
715    
716            /**
717            * Caches the trash versions in the entity cache if it is enabled.
718            *
719            * @param trashVersions the trash versions
720            */
721            public static void cacheResult(
722                    java.util.List<com.liferay.portlet.trash.model.TrashVersion> trashVersions) {
723                    getPersistence().cacheResult(trashVersions);
724            }
725    
726            /**
727            * Creates a new trash version with the primary key. Does not add the trash version to the database.
728            *
729            * @param versionId the primary key for the new trash version
730            * @return the new trash version
731            */
732            public static com.liferay.portlet.trash.model.TrashVersion create(
733                    long versionId) {
734                    return getPersistence().create(versionId);
735            }
736    
737            /**
738            * Removes the trash version with the primary key from the database. Also notifies the appropriate model listeners.
739            *
740            * @param versionId the primary key of the trash version
741            * @return the trash version that was removed
742            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
743            * @throws SystemException if a system exception occurred
744            */
745            public static com.liferay.portlet.trash.model.TrashVersion remove(
746                    long versionId)
747                    throws com.liferay.portal.kernel.exception.SystemException,
748                            com.liferay.portlet.trash.NoSuchVersionException {
749                    return getPersistence().remove(versionId);
750            }
751    
752            public static com.liferay.portlet.trash.model.TrashVersion updateImpl(
753                    com.liferay.portlet.trash.model.TrashVersion trashVersion)
754                    throws com.liferay.portal.kernel.exception.SystemException {
755                    return getPersistence().updateImpl(trashVersion);
756            }
757    
758            /**
759            * Returns the trash version with the primary key or throws a {@link com.liferay.portlet.trash.NoSuchVersionException} if it could not be found.
760            *
761            * @param versionId the primary key of the trash version
762            * @return the trash version
763            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
764            * @throws SystemException if a system exception occurred
765            */
766            public static com.liferay.portlet.trash.model.TrashVersion findByPrimaryKey(
767                    long versionId)
768                    throws com.liferay.portal.kernel.exception.SystemException,
769                            com.liferay.portlet.trash.NoSuchVersionException {
770                    return getPersistence().findByPrimaryKey(versionId);
771            }
772    
773            /**
774            * Returns the trash version with the primary key or returns <code>null</code> if it could not be found.
775            *
776            * @param versionId the primary key of the trash version
777            * @return the trash version, or <code>null</code> if a trash version with the primary key could not be found
778            * @throws SystemException if a system exception occurred
779            */
780            public static com.liferay.portlet.trash.model.TrashVersion fetchByPrimaryKey(
781                    long versionId)
782                    throws com.liferay.portal.kernel.exception.SystemException {
783                    return getPersistence().fetchByPrimaryKey(versionId);
784            }
785    
786            /**
787            * Returns all the trash versions.
788            *
789            * @return the trash versions
790            * @throws SystemException if a system exception occurred
791            */
792            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll()
793                    throws com.liferay.portal.kernel.exception.SystemException {
794                    return getPersistence().findAll();
795            }
796    
797            /**
798            * Returns a range of all the trash versions.
799            *
800            * <p>
801            * 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.
802            * </p>
803            *
804            * @param start the lower bound of the range of trash versions
805            * @param end the upper bound of the range of trash versions (not inclusive)
806            * @return the range of trash versions
807            * @throws SystemException if a system exception occurred
808            */
809            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll(
810                    int start, int end)
811                    throws com.liferay.portal.kernel.exception.SystemException {
812                    return getPersistence().findAll(start, end);
813            }
814    
815            /**
816            * Returns an ordered range of all the trash versions.
817            *
818            * <p>
819            * 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.
820            * </p>
821            *
822            * @param start the lower bound of the range of trash versions
823            * @param end the upper bound of the range of trash versions (not inclusive)
824            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
825            * @return the ordered range of trash versions
826            * @throws SystemException if a system exception occurred
827            */
828            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll(
829                    int start, int end,
830                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
831                    throws com.liferay.portal.kernel.exception.SystemException {
832                    return getPersistence().findAll(start, end, orderByComparator);
833            }
834    
835            /**
836            * Removes all the trash versions from the database.
837            *
838            * @throws SystemException if a system exception occurred
839            */
840            public static void removeAll()
841                    throws com.liferay.portal.kernel.exception.SystemException {
842                    getPersistence().removeAll();
843            }
844    
845            /**
846            * Returns the number of trash versions.
847            *
848            * @return the number of trash versions
849            * @throws SystemException if a system exception occurred
850            */
851            public static int countAll()
852                    throws com.liferay.portal.kernel.exception.SystemException {
853                    return getPersistence().countAll();
854            }
855    
856            public static TrashVersionPersistence getPersistence() {
857                    if (_persistence == null) {
858                            _persistence = (TrashVersionPersistence)PortalBeanLocatorUtil.locate(TrashVersionPersistence.class.getName());
859    
860                            ReferenceRegistry.registerReference(TrashVersionUtil.class,
861                                    "_persistence");
862                    }
863    
864                    return _persistence;
865            }
866    
867            /**
868             * @deprecated As of 6.2.0
869             */
870            public void setPersistence(TrashVersionPersistence persistence) {
871            }
872    
873            private static TrashVersionPersistence _persistence;
874    }