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