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 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 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 = ?. 114 * 115 * @param entryId the entry ID 116 * @return the matching trash versions 117 */ 118 public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByEntryId( 119 long entryId) { 120 return getPersistence().findByEntryId(entryId); 121 } 122 123 /** 124 * Returns a range of all the trash versions where entryId = ?. 125 * 126 * <p> 127 * 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. 128 * </p> 129 * 130 * @param entryId the entry ID 131 * @param start the lower bound of the range of trash versions 132 * @param end the upper bound of the range of trash versions (not inclusive) 133 * @return the range of matching trash versions 134 */ 135 public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByEntryId( 136 long entryId, int start, int end) { 137 return getPersistence().findByEntryId(entryId, start, end); 138 } 139 140 /** 141 * Returns an ordered range of all the trash versions where entryId = ?. 142 * 143 * <p> 144 * 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. 145 * </p> 146 * 147 * @param entryId the entry ID 148 * @param start the lower bound of the range of trash versions 149 * @param end the upper bound of the range of trash versions (not inclusive) 150 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 151 * @return the ordered range of matching trash versions 152 */ 153 public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByEntryId( 154 long entryId, int start, int end, 155 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) { 156 return getPersistence() 157 .findByEntryId(entryId, start, end, orderByComparator); 158 } 159 160 /** 161 * Returns the first trash version in the ordered set where entryId = ?. 162 * 163 * @param entryId the entry ID 164 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 165 * @return the first matching trash version 166 * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found 167 */ 168 public static com.liferay.portlet.trash.model.TrashVersion findByEntryId_First( 169 long entryId, 170 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) 171 throws com.liferay.portlet.trash.NoSuchVersionException { 172 return getPersistence().findByEntryId_First(entryId, orderByComparator); 173 } 174 175 /** 176 * Returns the first trash version in the ordered set where entryId = ?. 177 * 178 * @param entryId the entry ID 179 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 180 * @return the first matching trash version, or <code>null</code> if a matching trash version could not be found 181 */ 182 public static com.liferay.portlet.trash.model.TrashVersion fetchByEntryId_First( 183 long entryId, 184 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) { 185 return getPersistence().fetchByEntryId_First(entryId, orderByComparator); 186 } 187 188 /** 189 * Returns the last trash version in the ordered set where entryId = ?. 190 * 191 * @param entryId the entry ID 192 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 193 * @return the last matching trash version 194 * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found 195 */ 196 public static com.liferay.portlet.trash.model.TrashVersion findByEntryId_Last( 197 long entryId, 198 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) 199 throws com.liferay.portlet.trash.NoSuchVersionException { 200 return getPersistence().findByEntryId_Last(entryId, orderByComparator); 201 } 202 203 /** 204 * Returns the last trash version in the ordered set where entryId = ?. 205 * 206 * @param entryId the entry ID 207 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 208 * @return the last matching trash version, or <code>null</code> if a matching trash version could not be found 209 */ 210 public static com.liferay.portlet.trash.model.TrashVersion fetchByEntryId_Last( 211 long entryId, 212 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) { 213 return getPersistence().fetchByEntryId_Last(entryId, orderByComparator); 214 } 215 216 /** 217 * Returns the trash versions before and after the current trash version in the ordered set where entryId = ?. 218 * 219 * @param versionId the primary key of the current trash version 220 * @param entryId the entry ID 221 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 222 * @return the previous, current, and next trash version 223 * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found 224 */ 225 public static com.liferay.portlet.trash.model.TrashVersion[] findByEntryId_PrevAndNext( 226 long versionId, long entryId, 227 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) 228 throws com.liferay.portlet.trash.NoSuchVersionException { 229 return getPersistence() 230 .findByEntryId_PrevAndNext(versionId, entryId, 231 orderByComparator); 232 } 233 234 /** 235 * Removes all the trash versions where entryId = ? from the database. 236 * 237 * @param entryId the entry ID 238 */ 239 public static void removeByEntryId(long entryId) { 240 getPersistence().removeByEntryId(entryId); 241 } 242 243 /** 244 * Returns the number of trash versions where entryId = ?. 245 * 246 * @param entryId the entry ID 247 * @return the number of matching trash versions 248 */ 249 public static int countByEntryId(long entryId) { 250 return getPersistence().countByEntryId(entryId); 251 } 252 253 /** 254 * Returns all the trash versions where entryId = ? and classNameId = ?. 255 * 256 * @param entryId the entry ID 257 * @param classNameId the class name ID 258 * @return the matching trash versions 259 */ 260 public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByE_C( 261 long entryId, long classNameId) { 262 return getPersistence().findByE_C(entryId, classNameId); 263 } 264 265 /** 266 * Returns a range of all the trash versions where entryId = ? and classNameId = ?. 267 * 268 * <p> 269 * 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. 270 * </p> 271 * 272 * @param entryId the entry ID 273 * @param classNameId the class name ID 274 * @param start the lower bound of the range of trash versions 275 * @param end the upper bound of the range of trash versions (not inclusive) 276 * @return the range of matching trash versions 277 */ 278 public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByE_C( 279 long entryId, long classNameId, int start, int end) { 280 return getPersistence().findByE_C(entryId, classNameId, start, end); 281 } 282 283 /** 284 * Returns an ordered range of all the trash versions where entryId = ? and classNameId = ?. 285 * 286 * <p> 287 * 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. 288 * </p> 289 * 290 * @param entryId the entry ID 291 * @param classNameId the class name ID 292 * @param start the lower bound of the range of trash versions 293 * @param end the upper bound of the range of trash versions (not inclusive) 294 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 295 * @return the ordered range of matching trash versions 296 */ 297 public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findByE_C( 298 long entryId, long classNameId, int start, int end, 299 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) { 300 return getPersistence() 301 .findByE_C(entryId, classNameId, start, end, 302 orderByComparator); 303 } 304 305 /** 306 * Returns the first trash version in the ordered set where entryId = ? and classNameId = ?. 307 * 308 * @param entryId the entry ID 309 * @param classNameId the class name ID 310 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 311 * @return the first matching trash version 312 * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found 313 */ 314 public static com.liferay.portlet.trash.model.TrashVersion findByE_C_First( 315 long entryId, long classNameId, 316 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) 317 throws com.liferay.portlet.trash.NoSuchVersionException { 318 return getPersistence() 319 .findByE_C_First(entryId, classNameId, orderByComparator); 320 } 321 322 /** 323 * Returns the first trash version in the ordered set where entryId = ? and classNameId = ?. 324 * 325 * @param entryId the entry ID 326 * @param classNameId the class name ID 327 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 328 * @return the first matching trash version, or <code>null</code> if a matching trash version could not be found 329 */ 330 public static com.liferay.portlet.trash.model.TrashVersion fetchByE_C_First( 331 long entryId, long classNameId, 332 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) { 333 return getPersistence() 334 .fetchByE_C_First(entryId, classNameId, orderByComparator); 335 } 336 337 /** 338 * Returns the last trash version in the ordered set where entryId = ? and classNameId = ?. 339 * 340 * @param entryId the entry ID 341 * @param classNameId the class name ID 342 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 343 * @return the last matching trash version 344 * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found 345 */ 346 public static com.liferay.portlet.trash.model.TrashVersion findByE_C_Last( 347 long entryId, long classNameId, 348 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) 349 throws com.liferay.portlet.trash.NoSuchVersionException { 350 return getPersistence() 351 .findByE_C_Last(entryId, classNameId, orderByComparator); 352 } 353 354 /** 355 * Returns the last trash version in the ordered set where entryId = ? and classNameId = ?. 356 * 357 * @param entryId the entry ID 358 * @param classNameId the class name ID 359 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 360 * @return the last matching trash version, or <code>null</code> if a matching trash version could not be found 361 */ 362 public static com.liferay.portlet.trash.model.TrashVersion fetchByE_C_Last( 363 long entryId, long classNameId, 364 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) { 365 return getPersistence() 366 .fetchByE_C_Last(entryId, classNameId, orderByComparator); 367 } 368 369 /** 370 * Returns the trash versions before and after the current trash version in the ordered set where entryId = ? and classNameId = ?. 371 * 372 * @param versionId the primary key of the current trash version 373 * @param entryId the entry ID 374 * @param classNameId the class name ID 375 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 376 * @return the previous, current, and next trash version 377 * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found 378 */ 379 public static com.liferay.portlet.trash.model.TrashVersion[] findByE_C_PrevAndNext( 380 long versionId, long entryId, long classNameId, 381 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) 382 throws com.liferay.portlet.trash.NoSuchVersionException { 383 return getPersistence() 384 .findByE_C_PrevAndNext(versionId, entryId, classNameId, 385 orderByComparator); 386 } 387 388 /** 389 * Removes all the trash versions where entryId = ? and classNameId = ? from the database. 390 * 391 * @param entryId the entry ID 392 * @param classNameId the class name ID 393 */ 394 public static void removeByE_C(long entryId, long classNameId) { 395 getPersistence().removeByE_C(entryId, classNameId); 396 } 397 398 /** 399 * Returns the number of trash versions where entryId = ? and classNameId = ?. 400 * 401 * @param entryId the entry ID 402 * @param classNameId the class name ID 403 * @return the number of matching trash versions 404 */ 405 public static int countByE_C(long entryId, long classNameId) { 406 return getPersistence().countByE_C(entryId, classNameId); 407 } 408 409 /** 410 * Returns the trash version where classNameId = ? and classPK = ? or throws a {@link com.liferay.portlet.trash.NoSuchVersionException} if it could not be found. 411 * 412 * @param classNameId the class name ID 413 * @param classPK the class p k 414 * @return the matching trash version 415 * @throws com.liferay.portlet.trash.NoSuchVersionException if a matching trash version could not be found 416 */ 417 public static com.liferay.portlet.trash.model.TrashVersion findByC_C( 418 long classNameId, long classPK) 419 throws com.liferay.portlet.trash.NoSuchVersionException { 420 return getPersistence().findByC_C(classNameId, classPK); 421 } 422 423 /** 424 * Returns the trash version where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 425 * 426 * @param classNameId the class name ID 427 * @param classPK the class p k 428 * @return the matching trash version, or <code>null</code> if a matching trash version could not be found 429 */ 430 public static com.liferay.portlet.trash.model.TrashVersion fetchByC_C( 431 long classNameId, long classPK) { 432 return getPersistence().fetchByC_C(classNameId, classPK); 433 } 434 435 /** 436 * Returns the trash version where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 437 * 438 * @param classNameId the class name ID 439 * @param classPK the class p k 440 * @param retrieveFromCache whether to use the finder cache 441 * @return the matching trash version, or <code>null</code> if a matching trash version could not be found 442 */ 443 public static com.liferay.portlet.trash.model.TrashVersion fetchByC_C( 444 long classNameId, long classPK, boolean retrieveFromCache) { 445 return getPersistence() 446 .fetchByC_C(classNameId, classPK, retrieveFromCache); 447 } 448 449 /** 450 * Removes the trash version where classNameId = ? and classPK = ? from the database. 451 * 452 * @param classNameId the class name ID 453 * @param classPK the class p k 454 * @return the trash version that was removed 455 */ 456 public static com.liferay.portlet.trash.model.TrashVersion removeByC_C( 457 long classNameId, long classPK) 458 throws com.liferay.portlet.trash.NoSuchVersionException { 459 return getPersistence().removeByC_C(classNameId, classPK); 460 } 461 462 /** 463 * Returns the number of trash versions where classNameId = ? and classPK = ?. 464 * 465 * @param classNameId the class name ID 466 * @param classPK the class p k 467 * @return the number of matching trash versions 468 */ 469 public static int countByC_C(long classNameId, long classPK) { 470 return getPersistence().countByC_C(classNameId, classPK); 471 } 472 473 /** 474 * Caches the trash version in the entity cache if it is enabled. 475 * 476 * @param trashVersion the trash version 477 */ 478 public static void cacheResult( 479 com.liferay.portlet.trash.model.TrashVersion trashVersion) { 480 getPersistence().cacheResult(trashVersion); 481 } 482 483 /** 484 * Caches the trash versions in the entity cache if it is enabled. 485 * 486 * @param trashVersions the trash versions 487 */ 488 public static void cacheResult( 489 java.util.List<com.liferay.portlet.trash.model.TrashVersion> trashVersions) { 490 getPersistence().cacheResult(trashVersions); 491 } 492 493 /** 494 * Creates a new trash version with the primary key. Does not add the trash version to the database. 495 * 496 * @param versionId the primary key for the new trash version 497 * @return the new trash version 498 */ 499 public static com.liferay.portlet.trash.model.TrashVersion create( 500 long versionId) { 501 return getPersistence().create(versionId); 502 } 503 504 /** 505 * Removes the trash version with the primary key from the database. Also notifies the appropriate model listeners. 506 * 507 * @param versionId the primary key of the trash version 508 * @return the trash version that was removed 509 * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found 510 */ 511 public static com.liferay.portlet.trash.model.TrashVersion remove( 512 long versionId) throws com.liferay.portlet.trash.NoSuchVersionException { 513 return getPersistence().remove(versionId); 514 } 515 516 public static com.liferay.portlet.trash.model.TrashVersion updateImpl( 517 com.liferay.portlet.trash.model.TrashVersion trashVersion) { 518 return getPersistence().updateImpl(trashVersion); 519 } 520 521 /** 522 * Returns the trash version with the primary key or throws a {@link com.liferay.portlet.trash.NoSuchVersionException} if it could not be found. 523 * 524 * @param versionId the primary key of the trash version 525 * @return the trash version 526 * @throws com.liferay.portlet.trash.NoSuchVersionException if a trash version with the primary key could not be found 527 */ 528 public static com.liferay.portlet.trash.model.TrashVersion findByPrimaryKey( 529 long versionId) throws com.liferay.portlet.trash.NoSuchVersionException { 530 return getPersistence().findByPrimaryKey(versionId); 531 } 532 533 /** 534 * Returns the trash version with the primary key or returns <code>null</code> if it could not be found. 535 * 536 * @param versionId the primary key of the trash version 537 * @return the trash version, or <code>null</code> if a trash version with the primary key could not be found 538 */ 539 public static com.liferay.portlet.trash.model.TrashVersion fetchByPrimaryKey( 540 long versionId) { 541 return getPersistence().fetchByPrimaryKey(versionId); 542 } 543 544 public static java.util.Map<java.io.Serializable, com.liferay.portlet.trash.model.TrashVersion> fetchByPrimaryKeys( 545 java.util.Set<java.io.Serializable> primaryKeys) { 546 return getPersistence().fetchByPrimaryKeys(primaryKeys); 547 } 548 549 /** 550 * Returns all the trash versions. 551 * 552 * @return the trash versions 553 */ 554 public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll() { 555 return getPersistence().findAll(); 556 } 557 558 /** 559 * Returns a range of all the trash versions. 560 * 561 * <p> 562 * 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. 563 * </p> 564 * 565 * @param start the lower bound of the range of trash versions 566 * @param end the upper bound of the range of trash versions (not inclusive) 567 * @return the range of trash versions 568 */ 569 public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll( 570 int start, int end) { 571 return getPersistence().findAll(start, end); 572 } 573 574 /** 575 * Returns an ordered range of all the trash versions. 576 * 577 * <p> 578 * 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. 579 * </p> 580 * 581 * @param start the lower bound of the range of trash versions 582 * @param end the upper bound of the range of trash versions (not inclusive) 583 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 584 * @return the ordered range of trash versions 585 */ 586 public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> findAll( 587 int start, int end, 588 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashVersion> orderByComparator) { 589 return getPersistence().findAll(start, end, orderByComparator); 590 } 591 592 /** 593 * Removes all the trash versions from the database. 594 */ 595 public static void removeAll() { 596 getPersistence().removeAll(); 597 } 598 599 /** 600 * Returns the number of trash versions. 601 * 602 * @return the number of trash versions 603 */ 604 public static int countAll() { 605 return getPersistence().countAll(); 606 } 607 608 public static TrashVersionPersistence getPersistence() { 609 if (_persistence == null) { 610 _persistence = (TrashVersionPersistence)PortalBeanLocatorUtil.locate(TrashVersionPersistence.class.getName()); 611 612 ReferenceRegistry.registerReference(TrashVersionUtil.class, 613 "_persistence"); 614 } 615 616 return _persistence; 617 } 618 619 /** 620 * @deprecated As of 6.2.0 621 */ 622 @Deprecated 623 public void setPersistence(TrashVersionPersistence persistence) { 624 } 625 626 private static TrashVersionPersistence _persistence; 627 }