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