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 classNameId = &#63; and classPK = &#63;.
276            *
277            * @param classNameId the class name ID
278            * @param classPK the class p k
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> findByC_C(
283                    long classNameId, long classPK)
284                    throws com.liferay.portal.kernel.exception.SystemException {
285                    return getPersistence().findByC_C(classNameId, classPK);
286            }
287    
288            /**
289            * Returns a range of all the trash versions where classNameId = &#63; and classPK = &#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 classNameId the class name ID
296            * @param classPK the class p k
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> findByC_C(
303                    long classNameId, long classPK, int start, int end)
304                    throws com.liferay.portal.kernel.exception.SystemException {
305                    return getPersistence().findByC_C(classNameId, classPK, start, end);
306            }
307    
308            /**
309            * Returns an ordered range of all the trash versions where classNameId = &#63; and classPK = &#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 classNameId the class name ID
316            * @param classPK the class p k
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> findByC_C(
324                    long classNameId, long classPK, int start, int end,
325                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
326                    throws com.liferay.portal.kernel.exception.SystemException {
327                    return getPersistence()
328                                       .findByC_C(classNameId, classPK, start, end,
329                            orderByComparator);
330            }
331    
332            /**
333            * Returns the first trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
334            *
335            * @param classNameId the class name ID
336            * @param classPK the class p k
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 findByC_C_First(
343                    long classNameId, long classPK,
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                                       .findByC_C_First(classNameId, classPK, orderByComparator);
349            }
350    
351            /**
352            * Returns the first trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
353            *
354            * @param classNameId the class name ID
355            * @param classPK the class p k
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 fetchByC_C_First(
361                    long classNameId, long classPK,
362                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
363                    throws com.liferay.portal.kernel.exception.SystemException {
364                    return getPersistence()
365                                       .fetchByC_C_First(classNameId, classPK, orderByComparator);
366            }
367    
368            /**
369            * Returns the last trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
370            *
371            * @param classNameId the class name ID
372            * @param classPK the class p k
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 findByC_C_Last(
379                    long classNameId, long classPK,
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                                       .findByC_C_Last(classNameId, classPK, orderByComparator);
385            }
386    
387            /**
388            * Returns the last trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
389            *
390            * @param classNameId the class name ID
391            * @param classPK the class p k
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 fetchByC_C_Last(
397                    long classNameId, long classPK,
398                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
399                    throws com.liferay.portal.kernel.exception.SystemException {
400                    return getPersistence()
401                                       .fetchByC_C_Last(classNameId, classPK, orderByComparator);
402            }
403    
404            /**
405            * Returns the trash versions before and after the current trash version in the ordered set where classNameId = &#63; and classPK = &#63;.
406            *
407            * @param versionId the primary key of the current trash version
408            * @param classNameId the class name ID
409            * @param classPK the class p k
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[] findByC_C_PrevAndNext(
416                    long versionId, long classNameId, long classPK,
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                                       .findByC_C_PrevAndNext(versionId, classNameId, classPK,
422                            orderByComparator);
423            }
424    
425            /**
426            * Removes all the trash versions where classNameId = &#63; and classPK = &#63; from the database.
427            *
428            * @param classNameId the class name ID
429            * @param classPK the class p k
430            * @throws SystemException if a system exception occurred
431            */
432            public static void removeByC_C(long classNameId, long classPK)
433                    throws com.liferay.portal.kernel.exception.SystemException {
434                    getPersistence().removeByC_C(classNameId, classPK);
435            }
436    
437            /**
438            * Returns the number of trash versions where classNameId = &#63; and classPK = &#63;.
439            *
440            * @param classNameId the class name ID
441            * @param classPK the class p k
442            * @return the number of matching trash versions
443            * @throws SystemException if a system exception occurred
444            */
445            public static int countByC_C(long classNameId, long classPK)
446                    throws com.liferay.portal.kernel.exception.SystemException {
447                    return getPersistence().countByC_C(classNameId, classPK);
448            }
449    
450            /**
451            * Caches the trash version in the entity cache if it is enabled.
452            *
453            * @param trashVersion the trash version
454            */
455            public static void cacheResult(
456                    com.liferay.portlet.trash.model.TrashVersion trashVersion) {
457                    getPersistence().cacheResult(trashVersion);
458            }
459    
460            /**
461            * Caches the trash versions in the entity cache if it is enabled.
462            *
463            * @param trashVersions the trash versions
464            */
465            public static void cacheResult(
466                    java.util.List<com.liferay.portlet.trash.model.TrashVersion> trashVersions) {
467                    getPersistence().cacheResult(trashVersions);
468            }
469    
470            /**
471            * Creates a new trash version with the primary key. Does not add the trash version to the database.
472            *
473            * @param versionId the primary key for the new trash version
474            * @return the new trash version
475            */
476            public static com.liferay.portlet.trash.model.TrashVersion create(
477                    long versionId) {
478                    return getPersistence().create(versionId);
479            }
480    
481            /**
482            * Removes the trash version with the primary key from the database. Also notifies the appropriate model listeners.
483            *
484            * @param versionId the primary key of the trash version
485            * @return the trash version that was removed
486            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
487            * @throws SystemException if a system exception occurred
488            */
489            public static com.liferay.portlet.trash.model.TrashVersion remove(
490                    long versionId)
491                    throws com.liferay.portal.kernel.exception.SystemException,
492                            com.liferay.portlet.trash.NoSuchVersionException {
493                    return getPersistence().remove(versionId);
494            }
495    
496            public static com.liferay.portlet.trash.model.TrashVersion updateImpl(
497                    com.liferay.portlet.trash.model.TrashVersion trashVersion)
498                    throws com.liferay.portal.kernel.exception.SystemException {
499                    return getPersistence().updateImpl(trashVersion);
500            }
501    
502            /**
503            * Returns the trash version with the primary key or throws a {@link com.liferay.portlet.trash.NoSuchVersionException} if it could not be found.
504            *
505            * @param versionId the primary key of the trash version
506            * @return the trash version
507            * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found
508            * @throws SystemException if a system exception occurred
509            */
510            public static com.liferay.portlet.trash.model.TrashVersion findByPrimaryKey(
511                    long versionId)
512                    throws com.liferay.portal.kernel.exception.SystemException,
513                            com.liferay.portlet.trash.NoSuchVersionException {
514                    return getPersistence().findByPrimaryKey(versionId);
515            }
516    
517            /**
518            * Returns the trash version with the primary key or returns <code>null</code> if it could not be found.
519            *
520            * @param versionId the primary key of the trash version
521            * @return the trash version, or <code>null</code> if a trash version with the primary key could not be found
522            * @throws SystemException if a system exception occurred
523            */
524            public static com.liferay.portlet.trash.model.TrashVersion fetchByPrimaryKey(
525                    long versionId)
526                    throws com.liferay.portal.kernel.exception.SystemException {
527                    return getPersistence().fetchByPrimaryKey(versionId);
528            }
529    
530            /**
531            * Returns all the trash versions.
532            *
533            * @return the trash versions
534            * @throws SystemException if a system exception occurred
535            */
536            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll()
537                    throws com.liferay.portal.kernel.exception.SystemException {
538                    return getPersistence().findAll();
539            }
540    
541            /**
542            * Returns a range of all the trash versions.
543            *
544            * <p>
545            * 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.
546            * </p>
547            *
548            * @param start the lower bound of the range of trash versions
549            * @param end the upper bound of the range of trash versions (not inclusive)
550            * @return the range of trash versions
551            * @throws SystemException if a system exception occurred
552            */
553            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll(
554                    int start, int end)
555                    throws com.liferay.portal.kernel.exception.SystemException {
556                    return getPersistence().findAll(start, end);
557            }
558    
559            /**
560            * Returns an ordered range of all the trash versions.
561            *
562            * <p>
563            * 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.
564            * </p>
565            *
566            * @param start the lower bound of the range of trash versions
567            * @param end the upper bound of the range of trash versions (not inclusive)
568            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
569            * @return the ordered range of trash versions
570            * @throws SystemException if a system exception occurred
571            */
572            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll(
573                    int start, int end,
574                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
575                    throws com.liferay.portal.kernel.exception.SystemException {
576                    return getPersistence().findAll(start, end, orderByComparator);
577            }
578    
579            /**
580            * Removes all the trash versions from the database.
581            *
582            * @throws SystemException if a system exception occurred
583            */
584            public static void removeAll()
585                    throws com.liferay.portal.kernel.exception.SystemException {
586                    getPersistence().removeAll();
587            }
588    
589            /**
590            * Returns the number of trash versions.
591            *
592            * @return the number of trash versions
593            * @throws SystemException if a system exception occurred
594            */
595            public static int countAll()
596                    throws com.liferay.portal.kernel.exception.SystemException {
597                    return getPersistence().countAll();
598            }
599    
600            public static TrashVersionPersistence getPersistence() {
601                    if (_persistence == null) {
602                            _persistence = (TrashVersionPersistence)PortalBeanLocatorUtil.locate(TrashVersionPersistence.class.getName());
603    
604                            ReferenceRegistry.registerReference(TrashVersionUtil.class,
605                                    "_persistence");
606                    }
607    
608                    return _persistence;
609            }
610    
611            /**
612             * @deprecated As of 6.2.0
613             */
614            public void setPersistence(TrashVersionPersistence persistence) {
615            }
616    
617            private static TrashVersionPersistence _persistence;
618    }