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