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