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