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.documentlibrary.service.persistence; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.kernel.util.ReferenceRegistry; 022 import com.liferay.portal.service.ServiceContext; 023 024 import com.liferay.portlet.documentlibrary.model.DLSync; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the d l sync service. This utility wraps {@link DLSyncPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see DLSyncPersistence 037 * @see DLSyncPersistenceImpl 038 * @generated 039 */ 040 public class DLSyncUtil { 041 /* 042 * NOTE FOR DEVELOPERS: 043 * 044 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 045 */ 046 047 /** 048 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 049 */ 050 public static void clearCache() { 051 getPersistence().clearCache(); 052 } 053 054 /** 055 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 056 */ 057 public static void clearCache(DLSync dlSync) { 058 getPersistence().clearCache(dlSync); 059 } 060 061 /** 062 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 063 */ 064 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 065 throws SystemException { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<DLSync> findWithDynamicQuery(DynamicQuery dynamicQuery) 073 throws SystemException { 074 return getPersistence().findWithDynamicQuery(dynamicQuery); 075 } 076 077 /** 078 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 079 */ 080 public static List<DLSync> findWithDynamicQuery(DynamicQuery dynamicQuery, 081 int start, int end) throws SystemException { 082 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 083 } 084 085 /** 086 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 087 */ 088 public static List<DLSync> findWithDynamicQuery(DynamicQuery dynamicQuery, 089 int start, int end, OrderByComparator orderByComparator) 090 throws SystemException { 091 return getPersistence() 092 .findWithDynamicQuery(dynamicQuery, start, end, 093 orderByComparator); 094 } 095 096 /** 097 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 098 */ 099 public static DLSync update(DLSync dlSync) throws SystemException { 100 return getPersistence().update(dlSync); 101 } 102 103 /** 104 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 105 */ 106 public static DLSync update(DLSync dlSync, ServiceContext serviceContext) 107 throws SystemException { 108 return getPersistence().update(dlSync, serviceContext); 109 } 110 111 /** 112 * Caches the d l sync in the entity cache if it is enabled. 113 * 114 * @param dlSync the d l sync 115 */ 116 public static void cacheResult( 117 com.liferay.portlet.documentlibrary.model.DLSync dlSync) { 118 getPersistence().cacheResult(dlSync); 119 } 120 121 /** 122 * Caches the d l syncs in the entity cache if it is enabled. 123 * 124 * @param dlSyncs the d l syncs 125 */ 126 public static void cacheResult( 127 java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> dlSyncs) { 128 getPersistence().cacheResult(dlSyncs); 129 } 130 131 /** 132 * Creates a new d l sync with the primary key. Does not add the d l sync to the database. 133 * 134 * @param syncId the primary key for the new d l sync 135 * @return the new d l sync 136 */ 137 public static com.liferay.portlet.documentlibrary.model.DLSync create( 138 long syncId) { 139 return getPersistence().create(syncId); 140 } 141 142 /** 143 * Removes the d l sync with the primary key from the database. Also notifies the appropriate model listeners. 144 * 145 * @param syncId the primary key of the d l sync 146 * @return the d l sync that was removed 147 * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a d l sync with the primary key could not be found 148 * @throws SystemException if a system exception occurred 149 */ 150 public static com.liferay.portlet.documentlibrary.model.DLSync remove( 151 long syncId) 152 throws com.liferay.portal.kernel.exception.SystemException, 153 com.liferay.portlet.documentlibrary.NoSuchSyncException { 154 return getPersistence().remove(syncId); 155 } 156 157 public static com.liferay.portlet.documentlibrary.model.DLSync updateImpl( 158 com.liferay.portlet.documentlibrary.model.DLSync dlSync) 159 throws com.liferay.portal.kernel.exception.SystemException { 160 return getPersistence().updateImpl(dlSync); 161 } 162 163 /** 164 * Returns the d l sync with the primary key or throws a {@link com.liferay.portlet.documentlibrary.NoSuchSyncException} if it could not be found. 165 * 166 * @param syncId the primary key of the d l sync 167 * @return the d l sync 168 * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a d l sync with the primary key could not be found 169 * @throws SystemException if a system exception occurred 170 */ 171 public static com.liferay.portlet.documentlibrary.model.DLSync findByPrimaryKey( 172 long syncId) 173 throws com.liferay.portal.kernel.exception.SystemException, 174 com.liferay.portlet.documentlibrary.NoSuchSyncException { 175 return getPersistence().findByPrimaryKey(syncId); 176 } 177 178 /** 179 * Returns the d l sync with the primary key or returns <code>null</code> if it could not be found. 180 * 181 * @param syncId the primary key of the d l sync 182 * @return the d l sync, or <code>null</code> if a d l sync with the primary key could not be found 183 * @throws SystemException if a system exception occurred 184 */ 185 public static com.liferay.portlet.documentlibrary.model.DLSync fetchByPrimaryKey( 186 long syncId) throws com.liferay.portal.kernel.exception.SystemException { 187 return getPersistence().fetchByPrimaryKey(syncId); 188 } 189 190 /** 191 * Returns the d l sync where fileId = ? or throws a {@link com.liferay.portlet.documentlibrary.NoSuchSyncException} if it could not be found. 192 * 193 * @param fileId the file ID 194 * @return the matching d l sync 195 * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a matching d l sync could not be found 196 * @throws SystemException if a system exception occurred 197 */ 198 public static com.liferay.portlet.documentlibrary.model.DLSync findByFileId( 199 long fileId) 200 throws com.liferay.portal.kernel.exception.SystemException, 201 com.liferay.portlet.documentlibrary.NoSuchSyncException { 202 return getPersistence().findByFileId(fileId); 203 } 204 205 /** 206 * Returns the d l sync where fileId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 207 * 208 * @param fileId the file ID 209 * @return the matching d l sync, or <code>null</code> if a matching d l sync could not be found 210 * @throws SystemException if a system exception occurred 211 */ 212 public static com.liferay.portlet.documentlibrary.model.DLSync fetchByFileId( 213 long fileId) throws com.liferay.portal.kernel.exception.SystemException { 214 return getPersistence().fetchByFileId(fileId); 215 } 216 217 /** 218 * Returns the d l sync where fileId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 219 * 220 * @param fileId the file ID 221 * @param retrieveFromCache whether to use the finder cache 222 * @return the matching d l sync, or <code>null</code> if a matching d l sync could not be found 223 * @throws SystemException if a system exception occurred 224 */ 225 public static com.liferay.portlet.documentlibrary.model.DLSync fetchByFileId( 226 long fileId, boolean retrieveFromCache) 227 throws com.liferay.portal.kernel.exception.SystemException { 228 return getPersistence().fetchByFileId(fileId, retrieveFromCache); 229 } 230 231 /** 232 * Returns all the d l syncs where companyId = ? and modifiedDate ≥ ? and repositoryId = ?. 233 * 234 * @param companyId the company ID 235 * @param modifiedDate the modified date 236 * @param repositoryId the repository ID 237 * @return the matching d l syncs 238 * @throws SystemException if a system exception occurred 239 */ 240 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findByC_M_R( 241 long companyId, java.util.Date modifiedDate, long repositoryId) 242 throws com.liferay.portal.kernel.exception.SystemException { 243 return getPersistence() 244 .findByC_M_R(companyId, modifiedDate, repositoryId); 245 } 246 247 /** 248 * Returns a range of all the d l syncs where companyId = ? and modifiedDate ≥ ? and repositoryId = ?. 249 * 250 * <p> 251 * 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. 252 * </p> 253 * 254 * @param companyId the company ID 255 * @param modifiedDate the modified date 256 * @param repositoryId the repository ID 257 * @param start the lower bound of the range of d l syncs 258 * @param end the upper bound of the range of d l syncs (not inclusive) 259 * @return the range of matching d l syncs 260 * @throws SystemException if a system exception occurred 261 */ 262 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findByC_M_R( 263 long companyId, java.util.Date modifiedDate, long repositoryId, 264 int start, int end) 265 throws com.liferay.portal.kernel.exception.SystemException { 266 return getPersistence() 267 .findByC_M_R(companyId, modifiedDate, repositoryId, start, 268 end); 269 } 270 271 /** 272 * Returns an ordered range of all the d l syncs where companyId = ? and modifiedDate ≥ ? and repositoryId = ?. 273 * 274 * <p> 275 * 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. 276 * </p> 277 * 278 * @param companyId the company ID 279 * @param modifiedDate the modified date 280 * @param repositoryId the repository ID 281 * @param start the lower bound of the range of d l syncs 282 * @param end the upper bound of the range of d l syncs (not inclusive) 283 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 284 * @return the ordered range of matching d l syncs 285 * @throws SystemException if a system exception occurred 286 */ 287 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findByC_M_R( 288 long companyId, java.util.Date modifiedDate, long repositoryId, 289 int start, int end, 290 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 291 throws com.liferay.portal.kernel.exception.SystemException { 292 return getPersistence() 293 .findByC_M_R(companyId, modifiedDate, repositoryId, start, 294 end, orderByComparator); 295 } 296 297 /** 298 * Returns the first d l sync in the ordered set where companyId = ? and modifiedDate ≥ ? and repositoryId = ?. 299 * 300 * @param companyId the company ID 301 * @param modifiedDate the modified date 302 * @param repositoryId the repository ID 303 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 304 * @return the first matching d l sync 305 * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a matching d l sync could not be found 306 * @throws SystemException if a system exception occurred 307 */ 308 public static com.liferay.portlet.documentlibrary.model.DLSync findByC_M_R_First( 309 long companyId, java.util.Date modifiedDate, long repositoryId, 310 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 311 throws com.liferay.portal.kernel.exception.SystemException, 312 com.liferay.portlet.documentlibrary.NoSuchSyncException { 313 return getPersistence() 314 .findByC_M_R_First(companyId, modifiedDate, repositoryId, 315 orderByComparator); 316 } 317 318 /** 319 * Returns the first d l sync in the ordered set where companyId = ? and modifiedDate ≥ ? and repositoryId = ?. 320 * 321 * @param companyId the company ID 322 * @param modifiedDate the modified date 323 * @param repositoryId the repository ID 324 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 325 * @return the first matching d l sync, or <code>null</code> if a matching d l sync could not be found 326 * @throws SystemException if a system exception occurred 327 */ 328 public static com.liferay.portlet.documentlibrary.model.DLSync fetchByC_M_R_First( 329 long companyId, java.util.Date modifiedDate, long repositoryId, 330 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 331 throws com.liferay.portal.kernel.exception.SystemException { 332 return getPersistence() 333 .fetchByC_M_R_First(companyId, modifiedDate, repositoryId, 334 orderByComparator); 335 } 336 337 /** 338 * Returns the last d l sync in the ordered set where companyId = ? and modifiedDate ≥ ? and repositoryId = ?. 339 * 340 * @param companyId the company ID 341 * @param modifiedDate the modified date 342 * @param repositoryId the repository ID 343 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 344 * @return the last matching d l sync 345 * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a matching d l sync could not be found 346 * @throws SystemException if a system exception occurred 347 */ 348 public static com.liferay.portlet.documentlibrary.model.DLSync findByC_M_R_Last( 349 long companyId, java.util.Date modifiedDate, long repositoryId, 350 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 351 throws com.liferay.portal.kernel.exception.SystemException, 352 com.liferay.portlet.documentlibrary.NoSuchSyncException { 353 return getPersistence() 354 .findByC_M_R_Last(companyId, modifiedDate, repositoryId, 355 orderByComparator); 356 } 357 358 /** 359 * Returns the last d l sync in the ordered set where companyId = ? and modifiedDate ≥ ? and repositoryId = ?. 360 * 361 * @param companyId the company ID 362 * @param modifiedDate the modified date 363 * @param repositoryId the repository ID 364 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 365 * @return the last matching d l sync, or <code>null</code> if a matching d l sync could not be found 366 * @throws SystemException if a system exception occurred 367 */ 368 public static com.liferay.portlet.documentlibrary.model.DLSync fetchByC_M_R_Last( 369 long companyId, java.util.Date modifiedDate, long repositoryId, 370 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 371 throws com.liferay.portal.kernel.exception.SystemException { 372 return getPersistence() 373 .fetchByC_M_R_Last(companyId, modifiedDate, repositoryId, 374 orderByComparator); 375 } 376 377 /** 378 * Returns the d l syncs before and after the current d l sync in the ordered set where companyId = ? and modifiedDate ≥ ? and repositoryId = ?. 379 * 380 * @param syncId the primary key of the current d l sync 381 * @param companyId the company ID 382 * @param modifiedDate the modified date 383 * @param repositoryId the repository ID 384 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 385 * @return the previous, current, and next d l sync 386 * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a d l sync with the primary key could not be found 387 * @throws SystemException if a system exception occurred 388 */ 389 public static com.liferay.portlet.documentlibrary.model.DLSync[] findByC_M_R_PrevAndNext( 390 long syncId, long companyId, java.util.Date modifiedDate, 391 long repositoryId, 392 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 393 throws com.liferay.portal.kernel.exception.SystemException, 394 com.liferay.portlet.documentlibrary.NoSuchSyncException { 395 return getPersistence() 396 .findByC_M_R_PrevAndNext(syncId, companyId, modifiedDate, 397 repositoryId, orderByComparator); 398 } 399 400 /** 401 * Returns all the d l syncs. 402 * 403 * @return the d l syncs 404 * @throws SystemException if a system exception occurred 405 */ 406 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findAll() 407 throws com.liferay.portal.kernel.exception.SystemException { 408 return getPersistence().findAll(); 409 } 410 411 /** 412 * Returns a range of all the d l syncs. 413 * 414 * <p> 415 * 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. 416 * </p> 417 * 418 * @param start the lower bound of the range of d l syncs 419 * @param end the upper bound of the range of d l syncs (not inclusive) 420 * @return the range of d l syncs 421 * @throws SystemException if a system exception occurred 422 */ 423 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findAll( 424 int start, int end) 425 throws com.liferay.portal.kernel.exception.SystemException { 426 return getPersistence().findAll(start, end); 427 } 428 429 /** 430 * Returns an ordered range of all the d l syncs. 431 * 432 * <p> 433 * 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. 434 * </p> 435 * 436 * @param start the lower bound of the range of d l syncs 437 * @param end the upper bound of the range of d l syncs (not inclusive) 438 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 439 * @return the ordered range of d l syncs 440 * @throws SystemException if a system exception occurred 441 */ 442 public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findAll( 443 int start, int end, 444 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 445 throws com.liferay.portal.kernel.exception.SystemException { 446 return getPersistence().findAll(start, end, orderByComparator); 447 } 448 449 /** 450 * Removes the d l sync where fileId = ? from the database. 451 * 452 * @param fileId the file ID 453 * @return the d l sync that was removed 454 * @throws SystemException if a system exception occurred 455 */ 456 public static com.liferay.portlet.documentlibrary.model.DLSync removeByFileId( 457 long fileId) 458 throws com.liferay.portal.kernel.exception.SystemException, 459 com.liferay.portlet.documentlibrary.NoSuchSyncException { 460 return getPersistence().removeByFileId(fileId); 461 } 462 463 /** 464 * Removes all the d l syncs where companyId = ? and modifiedDate ≥ ? and repositoryId = ? from the database. 465 * 466 * @param companyId the company ID 467 * @param modifiedDate the modified date 468 * @param repositoryId the repository ID 469 * @throws SystemException if a system exception occurred 470 */ 471 public static void removeByC_M_R(long companyId, 472 java.util.Date modifiedDate, long repositoryId) 473 throws com.liferay.portal.kernel.exception.SystemException { 474 getPersistence().removeByC_M_R(companyId, modifiedDate, repositoryId); 475 } 476 477 /** 478 * Removes all the d l syncs from the database. 479 * 480 * @throws SystemException if a system exception occurred 481 */ 482 public static void removeAll() 483 throws com.liferay.portal.kernel.exception.SystemException { 484 getPersistence().removeAll(); 485 } 486 487 /** 488 * Returns the number of d l syncs where fileId = ?. 489 * 490 * @param fileId the file ID 491 * @return the number of matching d l syncs 492 * @throws SystemException if a system exception occurred 493 */ 494 public static int countByFileId(long fileId) 495 throws com.liferay.portal.kernel.exception.SystemException { 496 return getPersistence().countByFileId(fileId); 497 } 498 499 /** 500 * Returns the number of d l syncs where companyId = ? and modifiedDate ≥ ? and repositoryId = ?. 501 * 502 * @param companyId the company ID 503 * @param modifiedDate the modified date 504 * @param repositoryId the repository ID 505 * @return the number of matching d l syncs 506 * @throws SystemException if a system exception occurred 507 */ 508 public static int countByC_M_R(long companyId, java.util.Date modifiedDate, 509 long repositoryId) 510 throws com.liferay.portal.kernel.exception.SystemException { 511 return getPersistence() 512 .countByC_M_R(companyId, modifiedDate, repositoryId); 513 } 514 515 /** 516 * Returns the number of d l syncs. 517 * 518 * @return the number of d l syncs 519 * @throws SystemException if a system exception occurred 520 */ 521 public static int countAll() 522 throws com.liferay.portal.kernel.exception.SystemException { 523 return getPersistence().countAll(); 524 } 525 526 public static DLSyncPersistence getPersistence() { 527 if (_persistence == null) { 528 _persistence = (DLSyncPersistence)PortalBeanLocatorUtil.locate(DLSyncPersistence.class.getName()); 529 530 ReferenceRegistry.registerReference(DLSyncUtil.class, "_persistence"); 531 } 532 533 return _persistence; 534 } 535 536 /** 537 * @deprecated 538 */ 539 public void setPersistence(DLSyncPersistence persistence) { 540 } 541 542 private static DLSyncPersistence _persistence; 543 }