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