001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.trash.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.util.OrderByComparator;
022    import com.liferay.portal.kernel.util.ReferenceRegistry;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import com.liferay.portlet.trash.model.TrashVersion;
026    
027    import java.util.List;
028    
029    /**
030     * The persistence utility for the trash version service. This utility wraps {@link com.liferay.portlet.trash.service.persistence.impl.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.
031     *
032     * <p>
033     * Caching information and settings can be found in <code>portal.properties</code>
034     * </p>
035     *
036     * @author Brian Wing Shun Chan
037     * @see TrashVersionPersistence
038     * @see com.liferay.portlet.trash.service.persistence.impl.TrashVersionPersistenceImpl
039     * @generated
040     */
041    @ProviderType
042    public class TrashVersionUtil {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
047             */
048    
049            /**
050             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
051             */
052            public static void clearCache() {
053                    getPersistence().clearCache();
054            }
055    
056            /**
057             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
058             */
059            public static void clearCache(TrashVersion trashVersion) {
060                    getPersistence().clearCache(trashVersion);
061            }
062    
063            /**
064             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
065             */
066            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
067                    return getPersistence().countWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
072             */
073            public static List<TrashVersion> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery) {
075                    return getPersistence().findWithDynamicQuery(dynamicQuery);
076            }
077    
078            /**
079             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
080             */
081            public static List<TrashVersion> findWithDynamicQuery(
082                    DynamicQuery dynamicQuery, int start, int end) {
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<TrashVersion> orderByComparator) {
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                    return getPersistence().update(trashVersion);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static TrashVersion update(TrashVersion trashVersion,
108                    ServiceContext serviceContext) {
109                    return getPersistence().update(trashVersion, serviceContext);
110            }
111    
112            /**
113            * Returns all the trash versions where entryId = &#63;.
114            *
115            * @param entryId the entry ID
116            * @return the matching trash versions
117            */
118            public static List<TrashVersion> findByEntryId(long entryId) {
119                    return getPersistence().findByEntryId(entryId);
120            }
121    
122            /**
123            * Returns a range of all the trash versions where entryId = &#63;.
124            *
125            * <p>
126            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
127            * </p>
128            *
129            * @param entryId the entry ID
130            * @param start the lower bound of the range of trash versions
131            * @param end the upper bound of the range of trash versions (not inclusive)
132            * @return the range of matching trash versions
133            */
134            public static List<TrashVersion> findByEntryId(long entryId, int start,
135                    int end) {
136                    return getPersistence().findByEntryId(entryId, start, end);
137            }
138    
139            /**
140            * Returns an ordered range of all the trash versions where entryId = &#63;.
141            *
142            * <p>
143            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
144            * </p>
145            *
146            * @param entryId the entry ID
147            * @param start the lower bound of the range of trash versions
148            * @param end the upper bound of the range of trash versions (not inclusive)
149            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
150            * @return the ordered range of matching trash versions
151            */
152            public static List<TrashVersion> findByEntryId(long entryId, int start,
153                    int end, OrderByComparator<TrashVersion> orderByComparator) {
154                    return getPersistence()
155                                       .findByEntryId(entryId, start, end, orderByComparator);
156            }
157    
158            /**
159            * Returns an ordered range of all the trash versions where entryId = &#63;.
160            *
161            * <p>
162            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
163            * </p>
164            *
165            * @param entryId the entry ID
166            * @param start the lower bound of the range of trash versions
167            * @param end the upper bound of the range of trash versions (not inclusive)
168            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
169            * @param retrieveFromCache whether to retrieve from the finder cache
170            * @return the ordered range of matching trash versions
171            */
172            public static List<TrashVersion> findByEntryId(long entryId, int start,
173                    int end, OrderByComparator<TrashVersion> orderByComparator,
174                    boolean retrieveFromCache) {
175                    return getPersistence()
176                                       .findByEntryId(entryId, start, end, orderByComparator,
177                            retrieveFromCache);
178            }
179    
180            /**
181            * Returns the first trash version in the ordered set where entryId = &#63;.
182            *
183            * @param entryId the entry ID
184            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
185            * @return the first matching trash version
186            * @throws NoSuchVersionException if a matching trash version could not be found
187            */
188            public static TrashVersion findByEntryId_First(long entryId,
189                    OrderByComparator<TrashVersion> orderByComparator)
190                    throws com.liferay.portlet.trash.exception.NoSuchVersionException {
191                    return getPersistence().findByEntryId_First(entryId, orderByComparator);
192            }
193    
194            /**
195            * Returns the first trash version in the ordered set where entryId = &#63;.
196            *
197            * @param entryId the entry ID
198            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
199            * @return the first matching trash version, or <code>null</code> if a matching trash version could not be found
200            */
201            public static TrashVersion fetchByEntryId_First(long entryId,
202                    OrderByComparator<TrashVersion> orderByComparator) {
203                    return getPersistence().fetchByEntryId_First(entryId, orderByComparator);
204            }
205    
206            /**
207            * Returns the last trash version in the ordered set where entryId = &#63;.
208            *
209            * @param entryId the entry ID
210            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
211            * @return the last matching trash version
212            * @throws NoSuchVersionException if a matching trash version could not be found
213            */
214            public static TrashVersion findByEntryId_Last(long entryId,
215                    OrderByComparator<TrashVersion> orderByComparator)
216                    throws com.liferay.portlet.trash.exception.NoSuchVersionException {
217                    return getPersistence().findByEntryId_Last(entryId, orderByComparator);
218            }
219    
220            /**
221            * Returns the last trash version in the ordered set where entryId = &#63;.
222            *
223            * @param entryId the entry ID
224            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
225            * @return the last matching trash version, or <code>null</code> if a matching trash version could not be found
226            */
227            public static TrashVersion fetchByEntryId_Last(long entryId,
228                    OrderByComparator<TrashVersion> orderByComparator) {
229                    return getPersistence().fetchByEntryId_Last(entryId, orderByComparator);
230            }
231    
232            /**
233            * Returns the trash versions before and after the current trash version in the ordered set where entryId = &#63;.
234            *
235            * @param versionId the primary key of the current trash version
236            * @param entryId the entry ID
237            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
238            * @return the previous, current, and next trash version
239            * @throws NoSuchVersionException if a trash version with the primary key could not be found
240            */
241            public static TrashVersion[] findByEntryId_PrevAndNext(long versionId,
242                    long entryId, OrderByComparator<TrashVersion> orderByComparator)
243                    throws com.liferay.portlet.trash.exception.NoSuchVersionException {
244                    return getPersistence()
245                                       .findByEntryId_PrevAndNext(versionId, entryId,
246                            orderByComparator);
247            }
248    
249            /**
250            * Removes all the trash versions where entryId = &#63; from the database.
251            *
252            * @param entryId the entry ID
253            */
254            public static void removeByEntryId(long entryId) {
255                    getPersistence().removeByEntryId(entryId);
256            }
257    
258            /**
259            * Returns the number of trash versions where entryId = &#63;.
260            *
261            * @param entryId the entry ID
262            * @return the number of matching trash versions
263            */
264            public static int countByEntryId(long entryId) {
265                    return getPersistence().countByEntryId(entryId);
266            }
267    
268            /**
269            * Returns all the trash versions where entryId = &#63; and classNameId = &#63;.
270            *
271            * @param entryId the entry ID
272            * @param classNameId the class name ID
273            * @return the matching trash versions
274            */
275            public static List<TrashVersion> findByE_C(long entryId, long classNameId) {
276                    return getPersistence().findByE_C(entryId, classNameId);
277            }
278    
279            /**
280            * Returns a range of all the trash versions where entryId = &#63; and classNameId = &#63;.
281            *
282            * <p>
283            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
284            * </p>
285            *
286            * @param entryId the entry ID
287            * @param classNameId the class name ID
288            * @param start the lower bound of the range of trash versions
289            * @param end the upper bound of the range of trash versions (not inclusive)
290            * @return the range of matching trash versions
291            */
292            public static List<TrashVersion> findByE_C(long entryId, long classNameId,
293                    int start, int end) {
294                    return getPersistence().findByE_C(entryId, classNameId, start, end);
295            }
296    
297            /**
298            * Returns an ordered range of all the trash versions where entryId = &#63; and classNameId = &#63;.
299            *
300            * <p>
301            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
302            * </p>
303            *
304            * @param entryId the entry ID
305            * @param classNameId the class name ID
306            * @param start the lower bound of the range of trash versions
307            * @param end the upper bound of the range of trash versions (not inclusive)
308            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
309            * @return the ordered range of matching trash versions
310            */
311            public static List<TrashVersion> findByE_C(long entryId, long classNameId,
312                    int start, int end, OrderByComparator<TrashVersion> orderByComparator) {
313                    return getPersistence()
314                                       .findByE_C(entryId, classNameId, start, end,
315                            orderByComparator);
316            }
317    
318            /**
319            * Returns an ordered range of all the trash versions where entryId = &#63; and classNameId = &#63;.
320            *
321            * <p>
322            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
323            * </p>
324            *
325            * @param entryId the entry ID
326            * @param classNameId the class name ID
327            * @param start the lower bound of the range of trash versions
328            * @param end the upper bound of the range of trash versions (not inclusive)
329            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
330            * @param retrieveFromCache whether to retrieve from the finder cache
331            * @return the ordered range of matching trash versions
332            */
333            public static List<TrashVersion> findByE_C(long entryId, long classNameId,
334                    int start, int end, OrderByComparator<TrashVersion> orderByComparator,
335                    boolean retrieveFromCache) {
336                    return getPersistence()
337                                       .findByE_C(entryId, classNameId, start, end,
338                            orderByComparator, retrieveFromCache);
339            }
340    
341            /**
342            * Returns the first trash version in the ordered set where entryId = &#63; and classNameId = &#63;.
343            *
344            * @param entryId the entry ID
345            * @param classNameId the class name ID
346            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
347            * @return the first matching trash version
348            * @throws NoSuchVersionException if a matching trash version could not be found
349            */
350            public static TrashVersion findByE_C_First(long entryId, long classNameId,
351                    OrderByComparator<TrashVersion> orderByComparator)
352                    throws com.liferay.portlet.trash.exception.NoSuchVersionException {
353                    return getPersistence()
354                                       .findByE_C_First(entryId, classNameId, orderByComparator);
355            }
356    
357            /**
358            * Returns the first trash version in the ordered set where entryId = &#63; and classNameId = &#63;.
359            *
360            * @param entryId the entry ID
361            * @param classNameId the class name ID
362            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
363            * @return the first matching trash version, or <code>null</code> if a matching trash version could not be found
364            */
365            public static TrashVersion fetchByE_C_First(long entryId, long classNameId,
366                    OrderByComparator<TrashVersion> orderByComparator) {
367                    return getPersistence()
368                                       .fetchByE_C_First(entryId, classNameId, orderByComparator);
369            }
370    
371            /**
372            * Returns the last trash version in the ordered set where entryId = &#63; and classNameId = &#63;.
373            *
374            * @param entryId the entry ID
375            * @param classNameId the class name ID
376            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
377            * @return the last matching trash version
378            * @throws NoSuchVersionException if a matching trash version could not be found
379            */
380            public static TrashVersion findByE_C_Last(long entryId, long classNameId,
381                    OrderByComparator<TrashVersion> orderByComparator)
382                    throws com.liferay.portlet.trash.exception.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            */
395            public static TrashVersion fetchByE_C_Last(long entryId, long classNameId,
396                    OrderByComparator<TrashVersion> orderByComparator) {
397                    return getPersistence()
398                                       .fetchByE_C_Last(entryId, classNameId, orderByComparator);
399            }
400    
401            /**
402            * Returns the trash versions before and after the current trash version in the ordered set where entryId = &#63; and classNameId = &#63;.
403            *
404            * @param versionId the primary key of the current trash version
405            * @param entryId the entry ID
406            * @param classNameId the class name ID
407            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
408            * @return the previous, current, and next trash version
409            * @throws NoSuchVersionException if a trash version with the primary key could not be found
410            */
411            public static TrashVersion[] findByE_C_PrevAndNext(long versionId,
412                    long entryId, long classNameId,
413                    OrderByComparator<TrashVersion> orderByComparator)
414                    throws com.liferay.portlet.trash.exception.NoSuchVersionException {
415                    return getPersistence()
416                                       .findByE_C_PrevAndNext(versionId, entryId, classNameId,
417                            orderByComparator);
418            }
419    
420            /**
421            * Removes all the trash versions where entryId = &#63; and classNameId = &#63; from the database.
422            *
423            * @param entryId the entry ID
424            * @param classNameId the class name ID
425            */
426            public static void removeByE_C(long entryId, long classNameId) {
427                    getPersistence().removeByE_C(entryId, classNameId);
428            }
429    
430            /**
431            * Returns the number of trash versions where entryId = &#63; and classNameId = &#63;.
432            *
433            * @param entryId the entry ID
434            * @param classNameId the class name ID
435            * @return the number of matching trash versions
436            */
437            public static int countByE_C(long entryId, long classNameId) {
438                    return getPersistence().countByE_C(entryId, classNameId);
439            }
440    
441            /**
442            * Returns the trash version where classNameId = &#63; and classPK = &#63; or throws a {@link NoSuchVersionException} if it could not be found.
443            *
444            * @param classNameId the class name ID
445            * @param classPK the class p k
446            * @return the matching trash version
447            * @throws NoSuchVersionException if a matching trash version could not be found
448            */
449            public static TrashVersion findByC_C(long classNameId, long classPK)
450                    throws com.liferay.portlet.trash.exception.NoSuchVersionException {
451                    return getPersistence().findByC_C(classNameId, classPK);
452            }
453    
454            /**
455            * Returns the trash version where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
456            *
457            * @param classNameId the class name ID
458            * @param classPK the class p k
459            * @return the matching trash version, or <code>null</code> if a matching trash version could not be found
460            */
461            public static TrashVersion fetchByC_C(long classNameId, long classPK) {
462                    return getPersistence().fetchByC_C(classNameId, classPK);
463            }
464    
465            /**
466            * Returns the trash version where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
467            *
468            * @param classNameId the class name ID
469            * @param classPK the class p k
470            * @param retrieveFromCache whether to retrieve from the finder cache
471            * @return the matching trash version, or <code>null</code> if a matching trash version could not be found
472            */
473            public static TrashVersion fetchByC_C(long classNameId, long classPK,
474                    boolean retrieveFromCache) {
475                    return getPersistence()
476                                       .fetchByC_C(classNameId, classPK, retrieveFromCache);
477            }
478    
479            /**
480            * Removes the trash version where classNameId = &#63; and classPK = &#63; from the database.
481            *
482            * @param classNameId the class name ID
483            * @param classPK the class p k
484            * @return the trash version that was removed
485            */
486            public static TrashVersion removeByC_C(long classNameId, long classPK)
487                    throws com.liferay.portlet.trash.exception.NoSuchVersionException {
488                    return getPersistence().removeByC_C(classNameId, classPK);
489            }
490    
491            /**
492            * Returns the number of trash versions where classNameId = &#63; and classPK = &#63;.
493            *
494            * @param classNameId the class name ID
495            * @param classPK the class p k
496            * @return the number of matching trash versions
497            */
498            public static int countByC_C(long classNameId, long classPK) {
499                    return getPersistence().countByC_C(classNameId, classPK);
500            }
501    
502            /**
503            * Caches the trash version in the entity cache if it is enabled.
504            *
505            * @param trashVersion the trash version
506            */
507            public static void cacheResult(TrashVersion trashVersion) {
508                    getPersistence().cacheResult(trashVersion);
509            }
510    
511            /**
512            * Caches the trash versions in the entity cache if it is enabled.
513            *
514            * @param trashVersions the trash versions
515            */
516            public static void cacheResult(List<TrashVersion> trashVersions) {
517                    getPersistence().cacheResult(trashVersions);
518            }
519    
520            /**
521            * Creates a new trash version with the primary key. Does not add the trash version to the database.
522            *
523            * @param versionId the primary key for the new trash version
524            * @return the new trash version
525            */
526            public static TrashVersion create(long versionId) {
527                    return getPersistence().create(versionId);
528            }
529    
530            /**
531            * Removes the trash version with the primary key from the database. Also notifies the appropriate model listeners.
532            *
533            * @param versionId the primary key of the trash version
534            * @return the trash version that was removed
535            * @throws NoSuchVersionException if a trash version with the primary key could not be found
536            */
537            public static TrashVersion remove(long versionId)
538                    throws com.liferay.portlet.trash.exception.NoSuchVersionException {
539                    return getPersistence().remove(versionId);
540            }
541    
542            public static TrashVersion updateImpl(TrashVersion trashVersion) {
543                    return getPersistence().updateImpl(trashVersion);
544            }
545    
546            /**
547            * Returns the trash version with the primary key or throws a {@link NoSuchVersionException} if it could not be found.
548            *
549            * @param versionId the primary key of the trash version
550            * @return the trash version
551            * @throws NoSuchVersionException if a trash version with the primary key could not be found
552            */
553            public static TrashVersion findByPrimaryKey(long versionId)
554                    throws com.liferay.portlet.trash.exception.NoSuchVersionException {
555                    return getPersistence().findByPrimaryKey(versionId);
556            }
557    
558            /**
559            * Returns the trash version with the primary key or returns <code>null</code> if it could not be found.
560            *
561            * @param versionId the primary key of the trash version
562            * @return the trash version, or <code>null</code> if a trash version with the primary key could not be found
563            */
564            public static TrashVersion fetchByPrimaryKey(long versionId) {
565                    return getPersistence().fetchByPrimaryKey(versionId);
566            }
567    
568            public static java.util.Map<java.io.Serializable, TrashVersion> fetchByPrimaryKeys(
569                    java.util.Set<java.io.Serializable> primaryKeys) {
570                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
571            }
572    
573            /**
574            * Returns all the trash versions.
575            *
576            * @return the trash versions
577            */
578            public static List<TrashVersion> findAll() {
579                    return getPersistence().findAll();
580            }
581    
582            /**
583            * Returns a range of all the trash versions.
584            *
585            * <p>
586            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
587            * </p>
588            *
589            * @param start the lower bound of the range of trash versions
590            * @param end the upper bound of the range of trash versions (not inclusive)
591            * @return the range of trash versions
592            */
593            public static List<TrashVersion> findAll(int start, int end) {
594                    return getPersistence().findAll(start, end);
595            }
596    
597            /**
598            * Returns an ordered range of all the trash versions.
599            *
600            * <p>
601            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
602            * </p>
603            *
604            * @param start the lower bound of the range of trash versions
605            * @param end the upper bound of the range of trash versions (not inclusive)
606            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
607            * @return the ordered range of trash versions
608            */
609            public static List<TrashVersion> findAll(int start, int end,
610                    OrderByComparator<TrashVersion> orderByComparator) {
611                    return getPersistence().findAll(start, end, orderByComparator);
612            }
613    
614            /**
615            * Returns an ordered range of all the trash versions.
616            *
617            * <p>
618            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
619            * </p>
620            *
621            * @param start the lower bound of the range of trash versions
622            * @param end the upper bound of the range of trash versions (not inclusive)
623            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
624            * @param retrieveFromCache whether to retrieve from the finder cache
625            * @return the ordered range of trash versions
626            */
627            public static List<TrashVersion> findAll(int start, int end,
628                    OrderByComparator<TrashVersion> orderByComparator,
629                    boolean retrieveFromCache) {
630                    return getPersistence()
631                                       .findAll(start, end, orderByComparator, retrieveFromCache);
632            }
633    
634            /**
635            * Removes all the trash versions from the database.
636            */
637            public static void removeAll() {
638                    getPersistence().removeAll();
639            }
640    
641            /**
642            * Returns the number of trash versions.
643            *
644            * @return the number of trash versions
645            */
646            public static int countAll() {
647                    return getPersistence().countAll();
648            }
649    
650            public static TrashVersionPersistence getPersistence() {
651                    if (_persistence == null) {
652                            _persistence = (TrashVersionPersistence)PortalBeanLocatorUtil.locate(TrashVersionPersistence.class.getName());
653    
654                            ReferenceRegistry.registerReference(TrashVersionUtil.class,
655                                    "_persistence");
656                    }
657    
658                    return _persistence;
659            }
660    
661            private static TrashVersionPersistence _persistence;
662    }