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.announcements.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.announcements.model.AnnouncementsDelivery; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the announcements delivery service. This utility wraps {@link AnnouncementsDeliveryPersistenceImpl} 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 AnnouncementsDeliveryPersistence 037 * @see AnnouncementsDeliveryPersistenceImpl 038 * @generated 039 */ 040 public class AnnouncementsDeliveryUtil { 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(AnnouncementsDelivery announcementsDelivery) { 058 getPersistence().clearCache(announcementsDelivery); 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<AnnouncementsDelivery> findWithDynamicQuery( 073 DynamicQuery dynamicQuery) 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<AnnouncementsDelivery> findWithDynamicQuery( 081 DynamicQuery dynamicQuery, int start, int end) 082 throws SystemException { 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<AnnouncementsDelivery> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator orderByComparator) throws SystemException { 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 AnnouncementsDelivery update( 101 AnnouncementsDelivery announcementsDelivery) throws SystemException { 102 return getPersistence().update(announcementsDelivery); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 107 */ 108 public static AnnouncementsDelivery update( 109 AnnouncementsDelivery announcementsDelivery, 110 ServiceContext serviceContext) throws SystemException { 111 return getPersistence().update(announcementsDelivery, serviceContext); 112 } 113 114 /** 115 * Caches the announcements delivery in the entity cache if it is enabled. 116 * 117 * @param announcementsDelivery the announcements delivery 118 */ 119 public static void cacheResult( 120 com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery) { 121 getPersistence().cacheResult(announcementsDelivery); 122 } 123 124 /** 125 * Caches the announcements deliveries in the entity cache if it is enabled. 126 * 127 * @param announcementsDeliveries the announcements deliveries 128 */ 129 public static void cacheResult( 130 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDeliveries) { 131 getPersistence().cacheResult(announcementsDeliveries); 132 } 133 134 /** 135 * Creates a new announcements delivery with the primary key. Does not add the announcements delivery to the database. 136 * 137 * @param deliveryId the primary key for the new announcements delivery 138 * @return the new announcements delivery 139 */ 140 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery create( 141 long deliveryId) { 142 return getPersistence().create(deliveryId); 143 } 144 145 /** 146 * Removes the announcements delivery with the primary key from the database. Also notifies the appropriate model listeners. 147 * 148 * @param deliveryId the primary key of the announcements delivery 149 * @return the announcements delivery that was removed 150 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a announcements delivery with the primary key could not be found 151 * @throws SystemException if a system exception occurred 152 */ 153 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery remove( 154 long deliveryId) 155 throws com.liferay.portal.kernel.exception.SystemException, 156 com.liferay.portlet.announcements.NoSuchDeliveryException { 157 return getPersistence().remove(deliveryId); 158 } 159 160 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery updateImpl( 161 com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery) 162 throws com.liferay.portal.kernel.exception.SystemException { 163 return getPersistence().updateImpl(announcementsDelivery); 164 } 165 166 /** 167 * Returns the announcements delivery with the primary key or throws a {@link com.liferay.portlet.announcements.NoSuchDeliveryException} if it could not be found. 168 * 169 * @param deliveryId the primary key of the announcements delivery 170 * @return the announcements delivery 171 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a announcements delivery with the primary key could not be found 172 * @throws SystemException if a system exception occurred 173 */ 174 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByPrimaryKey( 175 long deliveryId) 176 throws com.liferay.portal.kernel.exception.SystemException, 177 com.liferay.portlet.announcements.NoSuchDeliveryException { 178 return getPersistence().findByPrimaryKey(deliveryId); 179 } 180 181 /** 182 * Returns the announcements delivery with the primary key or returns <code>null</code> if it could not be found. 183 * 184 * @param deliveryId the primary key of the announcements delivery 185 * @return the announcements delivery, or <code>null</code> if a announcements delivery with the primary key could not be found 186 * @throws SystemException if a system exception occurred 187 */ 188 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByPrimaryKey( 189 long deliveryId) 190 throws com.liferay.portal.kernel.exception.SystemException { 191 return getPersistence().fetchByPrimaryKey(deliveryId); 192 } 193 194 /** 195 * Returns all the announcements deliveries where userId = ?. 196 * 197 * @param userId the user ID 198 * @return the matching announcements deliveries 199 * @throws SystemException if a system exception occurred 200 */ 201 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId( 202 long userId) throws com.liferay.portal.kernel.exception.SystemException { 203 return getPersistence().findByUserId(userId); 204 } 205 206 /** 207 * Returns a range of all the announcements deliveries where userId = ?. 208 * 209 * <p> 210 * 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. 211 * </p> 212 * 213 * @param userId the user ID 214 * @param start the lower bound of the range of announcements deliveries 215 * @param end the upper bound of the range of announcements deliveries (not inclusive) 216 * @return the range of matching announcements deliveries 217 * @throws SystemException if a system exception occurred 218 */ 219 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId( 220 long userId, int start, int end) 221 throws com.liferay.portal.kernel.exception.SystemException { 222 return getPersistence().findByUserId(userId, start, end); 223 } 224 225 /** 226 * Returns an ordered range of all the announcements deliveries where userId = ?. 227 * 228 * <p> 229 * 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. 230 * </p> 231 * 232 * @param userId the user ID 233 * @param start the lower bound of the range of announcements deliveries 234 * @param end the upper bound of the range of announcements deliveries (not inclusive) 235 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 236 * @return the ordered range of matching announcements deliveries 237 * @throws SystemException if a system exception occurred 238 */ 239 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId( 240 long userId, int start, int end, 241 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 242 throws com.liferay.portal.kernel.exception.SystemException { 243 return getPersistence() 244 .findByUserId(userId, start, end, orderByComparator); 245 } 246 247 /** 248 * Returns the first announcements delivery in the ordered set where userId = ?. 249 * 250 * @param userId the user ID 251 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 252 * @return the first matching announcements delivery 253 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a matching announcements delivery could not be found 254 * @throws SystemException if a system exception occurred 255 */ 256 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByUserId_First( 257 long userId, 258 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 259 throws com.liferay.portal.kernel.exception.SystemException, 260 com.liferay.portlet.announcements.NoSuchDeliveryException { 261 return getPersistence().findByUserId_First(userId, orderByComparator); 262 } 263 264 /** 265 * Returns the first announcements delivery in the ordered set where userId = ?. 266 * 267 * @param userId the user ID 268 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 269 * @return the first matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 270 * @throws SystemException if a system exception occurred 271 */ 272 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByUserId_First( 273 long userId, 274 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 275 throws com.liferay.portal.kernel.exception.SystemException { 276 return getPersistence().fetchByUserId_First(userId, orderByComparator); 277 } 278 279 /** 280 * Returns the last announcements delivery in the ordered set where userId = ?. 281 * 282 * @param userId the user ID 283 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 284 * @return the last matching announcements delivery 285 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a matching announcements delivery could not be found 286 * @throws SystemException if a system exception occurred 287 */ 288 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByUserId_Last( 289 long userId, 290 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 291 throws com.liferay.portal.kernel.exception.SystemException, 292 com.liferay.portlet.announcements.NoSuchDeliveryException { 293 return getPersistence().findByUserId_Last(userId, orderByComparator); 294 } 295 296 /** 297 * Returns the last announcements delivery in the ordered set where userId = ?. 298 * 299 * @param userId the user ID 300 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 301 * @return the last matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 302 * @throws SystemException if a system exception occurred 303 */ 304 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByUserId_Last( 305 long userId, 306 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 307 throws com.liferay.portal.kernel.exception.SystemException { 308 return getPersistence().fetchByUserId_Last(userId, orderByComparator); 309 } 310 311 /** 312 * Returns the announcements deliveries before and after the current announcements delivery in the ordered set where userId = ?. 313 * 314 * @param deliveryId the primary key of the current announcements delivery 315 * @param userId the user ID 316 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 317 * @return the previous, current, and next announcements delivery 318 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a announcements delivery with the primary key could not be found 319 * @throws SystemException if a system exception occurred 320 */ 321 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery[] findByUserId_PrevAndNext( 322 long deliveryId, long userId, 323 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 324 throws com.liferay.portal.kernel.exception.SystemException, 325 com.liferay.portlet.announcements.NoSuchDeliveryException { 326 return getPersistence() 327 .findByUserId_PrevAndNext(deliveryId, userId, 328 orderByComparator); 329 } 330 331 /** 332 * Returns the announcements delivery where userId = ? and type = ? or throws a {@link com.liferay.portlet.announcements.NoSuchDeliveryException} if it could not be found. 333 * 334 * @param userId the user ID 335 * @param type the type 336 * @return the matching announcements delivery 337 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a matching announcements delivery could not be found 338 * @throws SystemException if a system exception occurred 339 */ 340 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByU_T( 341 long userId, java.lang.String type) 342 throws com.liferay.portal.kernel.exception.SystemException, 343 com.liferay.portlet.announcements.NoSuchDeliveryException { 344 return getPersistence().findByU_T(userId, type); 345 } 346 347 /** 348 * Returns the announcements delivery where userId = ? and type = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 349 * 350 * @param userId the user ID 351 * @param type the type 352 * @return the matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 353 * @throws SystemException if a system exception occurred 354 */ 355 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByU_T( 356 long userId, java.lang.String type) 357 throws com.liferay.portal.kernel.exception.SystemException { 358 return getPersistence().fetchByU_T(userId, type); 359 } 360 361 /** 362 * Returns the announcements delivery where userId = ? and type = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 363 * 364 * @param userId the user ID 365 * @param type the type 366 * @param retrieveFromCache whether to use the finder cache 367 * @return the matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 368 * @throws SystemException if a system exception occurred 369 */ 370 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByU_T( 371 long userId, java.lang.String type, boolean retrieveFromCache) 372 throws com.liferay.portal.kernel.exception.SystemException { 373 return getPersistence().fetchByU_T(userId, type, retrieveFromCache); 374 } 375 376 /** 377 * Returns all the announcements deliveries. 378 * 379 * @return the announcements deliveries 380 * @throws SystemException if a system exception occurred 381 */ 382 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll() 383 throws com.liferay.portal.kernel.exception.SystemException { 384 return getPersistence().findAll(); 385 } 386 387 /** 388 * Returns a range of all the announcements deliveries. 389 * 390 * <p> 391 * 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. 392 * </p> 393 * 394 * @param start the lower bound of the range of announcements deliveries 395 * @param end the upper bound of the range of announcements deliveries (not inclusive) 396 * @return the range of announcements deliveries 397 * @throws SystemException if a system exception occurred 398 */ 399 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll( 400 int start, int end) 401 throws com.liferay.portal.kernel.exception.SystemException { 402 return getPersistence().findAll(start, end); 403 } 404 405 /** 406 * Returns an ordered range of all the announcements deliveries. 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 410 * </p> 411 * 412 * @param start the lower bound of the range of announcements deliveries 413 * @param end the upper bound of the range of announcements deliveries (not inclusive) 414 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 415 * @return the ordered range of announcements deliveries 416 * @throws SystemException if a system exception occurred 417 */ 418 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll( 419 int start, int end, 420 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 421 throws com.liferay.portal.kernel.exception.SystemException { 422 return getPersistence().findAll(start, end, orderByComparator); 423 } 424 425 /** 426 * Removes all the announcements deliveries where userId = ? from the database. 427 * 428 * @param userId the user ID 429 * @throws SystemException if a system exception occurred 430 */ 431 public static void removeByUserId(long userId) 432 throws com.liferay.portal.kernel.exception.SystemException { 433 getPersistence().removeByUserId(userId); 434 } 435 436 /** 437 * Removes the announcements delivery where userId = ? and type = ? from the database. 438 * 439 * @param userId the user ID 440 * @param type the type 441 * @return the announcements delivery that was removed 442 * @throws SystemException if a system exception occurred 443 */ 444 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery removeByU_T( 445 long userId, java.lang.String type) 446 throws com.liferay.portal.kernel.exception.SystemException, 447 com.liferay.portlet.announcements.NoSuchDeliveryException { 448 return getPersistence().removeByU_T(userId, type); 449 } 450 451 /** 452 * Removes all the announcements deliveries from the database. 453 * 454 * @throws SystemException if a system exception occurred 455 */ 456 public static void removeAll() 457 throws com.liferay.portal.kernel.exception.SystemException { 458 getPersistence().removeAll(); 459 } 460 461 /** 462 * Returns the number of announcements deliveries where userId = ?. 463 * 464 * @param userId the user ID 465 * @return the number of matching announcements deliveries 466 * @throws SystemException if a system exception occurred 467 */ 468 public static int countByUserId(long userId) 469 throws com.liferay.portal.kernel.exception.SystemException { 470 return getPersistence().countByUserId(userId); 471 } 472 473 /** 474 * Returns the number of announcements deliveries where userId = ? and type = ?. 475 * 476 * @param userId the user ID 477 * @param type the type 478 * @return the number of matching announcements deliveries 479 * @throws SystemException if a system exception occurred 480 */ 481 public static int countByU_T(long userId, java.lang.String type) 482 throws com.liferay.portal.kernel.exception.SystemException { 483 return getPersistence().countByU_T(userId, type); 484 } 485 486 /** 487 * Returns the number of announcements deliveries. 488 * 489 * @return the number of announcements deliveries 490 * @throws SystemException if a system exception occurred 491 */ 492 public static int countAll() 493 throws com.liferay.portal.kernel.exception.SystemException { 494 return getPersistence().countAll(); 495 } 496 497 public static AnnouncementsDeliveryPersistence getPersistence() { 498 if (_persistence == null) { 499 _persistence = (AnnouncementsDeliveryPersistence)PortalBeanLocatorUtil.locate(AnnouncementsDeliveryPersistence.class.getName()); 500 501 ReferenceRegistry.registerReference(AnnouncementsDeliveryUtil.class, 502 "_persistence"); 503 } 504 505 return _persistence; 506 } 507 508 /** 509 * @deprecated 510 */ 511 public void setPersistence(AnnouncementsDeliveryPersistence persistence) { 512 } 513 514 private static AnnouncementsDeliveryPersistence _persistence; 515 }