001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.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.model.UserNotificationEvent; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the user notification event service. This utility wraps {@link UserNotificationEventPersistenceImpl} 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 * Caching information and settings can be found in <code>portal.properties</code> 032 * </p> 033 * 034 * @author Brian Wing Shun Chan 035 * @see UserNotificationEventPersistence 036 * @see UserNotificationEventPersistenceImpl 037 * @generated 038 */ 039 public class UserNotificationEventUtil { 040 /* 041 * NOTE FOR DEVELOPERS: 042 * 043 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 044 */ 045 046 /** 047 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 048 */ 049 public static void clearCache() { 050 getPersistence().clearCache(); 051 } 052 053 /** 054 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 055 */ 056 public static void clearCache(UserNotificationEvent userNotificationEvent) { 057 getPersistence().clearCache(userNotificationEvent); 058 } 059 060 /** 061 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 062 */ 063 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 064 throws SystemException { 065 return getPersistence().countWithDynamicQuery(dynamicQuery); 066 } 067 068 /** 069 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 070 */ 071 public static List<UserNotificationEvent> findWithDynamicQuery( 072 DynamicQuery dynamicQuery) throws SystemException { 073 return getPersistence().findWithDynamicQuery(dynamicQuery); 074 } 075 076 /** 077 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 078 */ 079 public static List<UserNotificationEvent> findWithDynamicQuery( 080 DynamicQuery dynamicQuery, int start, int end) 081 throws SystemException { 082 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 083 } 084 085 /** 086 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 087 */ 088 public static List<UserNotificationEvent> findWithDynamicQuery( 089 DynamicQuery dynamicQuery, int start, int end, 090 OrderByComparator orderByComparator) throws SystemException { 091 return getPersistence() 092 .findWithDynamicQuery(dynamicQuery, start, end, 093 orderByComparator); 094 } 095 096 /** 097 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 098 */ 099 public static UserNotificationEvent remove( 100 UserNotificationEvent userNotificationEvent) throws SystemException { 101 return getPersistence().remove(userNotificationEvent); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 106 */ 107 public static UserNotificationEvent update( 108 UserNotificationEvent userNotificationEvent, boolean merge) 109 throws SystemException { 110 return getPersistence().update(userNotificationEvent, merge); 111 } 112 113 /** 114 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 115 */ 116 public static UserNotificationEvent update( 117 UserNotificationEvent userNotificationEvent, boolean merge, 118 ServiceContext serviceContext) throws SystemException { 119 return getPersistence() 120 .update(userNotificationEvent, merge, serviceContext); 121 } 122 123 /** 124 * Caches the user notification event in the entity cache if it is enabled. 125 * 126 * @param userNotificationEvent the user notification event to cache 127 */ 128 public static void cacheResult( 129 com.liferay.portal.model.UserNotificationEvent userNotificationEvent) { 130 getPersistence().cacheResult(userNotificationEvent); 131 } 132 133 /** 134 * Caches the user notification events in the entity cache if it is enabled. 135 * 136 * @param userNotificationEvents the user notification events to cache 137 */ 138 public static void cacheResult( 139 java.util.List<com.liferay.portal.model.UserNotificationEvent> userNotificationEvents) { 140 getPersistence().cacheResult(userNotificationEvents); 141 } 142 143 /** 144 * Creates a new user notification event with the primary key. Does not add the user notification event to the database. 145 * 146 * @param userNotificationEventId the primary key for the new user notification event 147 * @return the new user notification event 148 */ 149 public static com.liferay.portal.model.UserNotificationEvent create( 150 long userNotificationEventId) { 151 return getPersistence().create(userNotificationEventId); 152 } 153 154 /** 155 * Removes the user notification event with the primary key from the database. Also notifies the appropriate model listeners. 156 * 157 * @param userNotificationEventId the primary key of the user notification event to remove 158 * @return the user notification event that was removed 159 * @throws com.liferay.portal.NoSuchUserNotificationEventException if a user notification event with the primary key could not be found 160 * @throws SystemException if a system exception occurred 161 */ 162 public static com.liferay.portal.model.UserNotificationEvent remove( 163 long userNotificationEventId) 164 throws com.liferay.portal.NoSuchUserNotificationEventException, 165 com.liferay.portal.kernel.exception.SystemException { 166 return getPersistence().remove(userNotificationEventId); 167 } 168 169 public static com.liferay.portal.model.UserNotificationEvent updateImpl( 170 com.liferay.portal.model.UserNotificationEvent userNotificationEvent, 171 boolean merge) 172 throws com.liferay.portal.kernel.exception.SystemException { 173 return getPersistence().updateImpl(userNotificationEvent, merge); 174 } 175 176 /** 177 * Finds the user notification event with the primary key or throws a {@link com.liferay.portal.NoSuchUserNotificationEventException} if it could not be found. 178 * 179 * @param userNotificationEventId the primary key of the user notification event to find 180 * @return the user notification event 181 * @throws com.liferay.portal.NoSuchUserNotificationEventException if a user notification event with the primary key could not be found 182 * @throws SystemException if a system exception occurred 183 */ 184 public static com.liferay.portal.model.UserNotificationEvent findByPrimaryKey( 185 long userNotificationEventId) 186 throws com.liferay.portal.NoSuchUserNotificationEventException, 187 com.liferay.portal.kernel.exception.SystemException { 188 return getPersistence().findByPrimaryKey(userNotificationEventId); 189 } 190 191 /** 192 * Finds the user notification event with the primary key or returns <code>null</code> if it could not be found. 193 * 194 * @param userNotificationEventId the primary key of the user notification event to find 195 * @return the user notification event, or <code>null</code> if a user notification event with the primary key could not be found 196 * @throws SystemException if a system exception occurred 197 */ 198 public static com.liferay.portal.model.UserNotificationEvent fetchByPrimaryKey( 199 long userNotificationEventId) 200 throws com.liferay.portal.kernel.exception.SystemException { 201 return getPersistence().fetchByPrimaryKey(userNotificationEventId); 202 } 203 204 /** 205 * Finds all the user notification events where uuid = ?. 206 * 207 * @param uuid the uuid to search with 208 * @return the matching user notification events 209 * @throws SystemException if a system exception occurred 210 */ 211 public static java.util.List<com.liferay.portal.model.UserNotificationEvent> findByUuid( 212 java.lang.String uuid) 213 throws com.liferay.portal.kernel.exception.SystemException { 214 return getPersistence().findByUuid(uuid); 215 } 216 217 /** 218 * Finds a range of all the user notification events where uuid = ?. 219 * 220 * <p> 221 * 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. 222 * </p> 223 * 224 * @param uuid the uuid to search with 225 * @param start the lower bound of the range of user notification events to return 226 * @param end the upper bound of the range of user notification events to return (not inclusive) 227 * @return the range of matching user notification events 228 * @throws SystemException if a system exception occurred 229 */ 230 public static java.util.List<com.liferay.portal.model.UserNotificationEvent> findByUuid( 231 java.lang.String uuid, int start, int end) 232 throws com.liferay.portal.kernel.exception.SystemException { 233 return getPersistence().findByUuid(uuid, start, end); 234 } 235 236 /** 237 * Finds an ordered range of all the user notification events where uuid = ?. 238 * 239 * <p> 240 * 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. 241 * </p> 242 * 243 * @param uuid the uuid to search with 244 * @param start the lower bound of the range of user notification events to return 245 * @param end the upper bound of the range of user notification events to return (not inclusive) 246 * @param orderByComparator the comparator to order the results by 247 * @return the ordered range of matching user notification events 248 * @throws SystemException if a system exception occurred 249 */ 250 public static java.util.List<com.liferay.portal.model.UserNotificationEvent> findByUuid( 251 java.lang.String uuid, int start, int end, 252 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 253 throws com.liferay.portal.kernel.exception.SystemException { 254 return getPersistence().findByUuid(uuid, start, end, orderByComparator); 255 } 256 257 /** 258 * Finds the first user notification event in the ordered set where uuid = ?. 259 * 260 * <p> 261 * 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. 262 * </p> 263 * 264 * @param uuid the uuid to search with 265 * @param orderByComparator the comparator to order the set by 266 * @return the first matching user notification event 267 * @throws com.liferay.portal.NoSuchUserNotificationEventException if a matching user notification event could not be found 268 * @throws SystemException if a system exception occurred 269 */ 270 public static com.liferay.portal.model.UserNotificationEvent findByUuid_First( 271 java.lang.String uuid, 272 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 273 throws com.liferay.portal.NoSuchUserNotificationEventException, 274 com.liferay.portal.kernel.exception.SystemException { 275 return getPersistence().findByUuid_First(uuid, orderByComparator); 276 } 277 278 /** 279 * Finds the last user notification event in the ordered set where uuid = ?. 280 * 281 * <p> 282 * 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. 283 * </p> 284 * 285 * @param uuid the uuid to search with 286 * @param orderByComparator the comparator to order the set by 287 * @return the last matching user notification event 288 * @throws com.liferay.portal.NoSuchUserNotificationEventException if a matching user notification event could not be found 289 * @throws SystemException if a system exception occurred 290 */ 291 public static com.liferay.portal.model.UserNotificationEvent findByUuid_Last( 292 java.lang.String uuid, 293 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 294 throws com.liferay.portal.NoSuchUserNotificationEventException, 295 com.liferay.portal.kernel.exception.SystemException { 296 return getPersistence().findByUuid_Last(uuid, orderByComparator); 297 } 298 299 /** 300 * Finds the user notification events before and after the current user notification event in the ordered set where uuid = ?. 301 * 302 * <p> 303 * 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. 304 * </p> 305 * 306 * @param userNotificationEventId the primary key of the current user notification event 307 * @param uuid the uuid to search with 308 * @param orderByComparator the comparator to order the set by 309 * @return the previous, current, and next user notification event 310 * @throws com.liferay.portal.NoSuchUserNotificationEventException if a user notification event with the primary key could not be found 311 * @throws SystemException if a system exception occurred 312 */ 313 public static com.liferay.portal.model.UserNotificationEvent[] findByUuid_PrevAndNext( 314 long userNotificationEventId, java.lang.String uuid, 315 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 316 throws com.liferay.portal.NoSuchUserNotificationEventException, 317 com.liferay.portal.kernel.exception.SystemException { 318 return getPersistence() 319 .findByUuid_PrevAndNext(userNotificationEventId, uuid, 320 orderByComparator); 321 } 322 323 /** 324 * Finds all the user notification events where userId = ?. 325 * 326 * @param userId the user ID to search with 327 * @return the matching user notification events 328 * @throws SystemException if a system exception occurred 329 */ 330 public static java.util.List<com.liferay.portal.model.UserNotificationEvent> findByUserId( 331 long userId) throws com.liferay.portal.kernel.exception.SystemException { 332 return getPersistence().findByUserId(userId); 333 } 334 335 /** 336 * Finds a range of all the user notification events where userId = ?. 337 * 338 * <p> 339 * 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. 340 * </p> 341 * 342 * @param userId the user ID to search with 343 * @param start the lower bound of the range of user notification events to return 344 * @param end the upper bound of the range of user notification events to return (not inclusive) 345 * @return the range of matching user notification events 346 * @throws SystemException if a system exception occurred 347 */ 348 public static java.util.List<com.liferay.portal.model.UserNotificationEvent> findByUserId( 349 long userId, int start, int end) 350 throws com.liferay.portal.kernel.exception.SystemException { 351 return getPersistence().findByUserId(userId, start, end); 352 } 353 354 /** 355 * Finds an ordered range of all the user notification events where userId = ?. 356 * 357 * <p> 358 * 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. 359 * </p> 360 * 361 * @param userId the user ID to search with 362 * @param start the lower bound of the range of user notification events to return 363 * @param end the upper bound of the range of user notification events to return (not inclusive) 364 * @param orderByComparator the comparator to order the results by 365 * @return the ordered range of matching user notification events 366 * @throws SystemException if a system exception occurred 367 */ 368 public static java.util.List<com.liferay.portal.model.UserNotificationEvent> findByUserId( 369 long userId, int start, int end, 370 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 371 throws com.liferay.portal.kernel.exception.SystemException { 372 return getPersistence() 373 .findByUserId(userId, start, end, orderByComparator); 374 } 375 376 /** 377 * Finds the first user notification event in the ordered set where userId = ?. 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 userId the user ID to search with 384 * @param orderByComparator the comparator to order the set by 385 * @return the first matching user notification event 386 * @throws com.liferay.portal.NoSuchUserNotificationEventException if a matching user notification event could not be found 387 * @throws SystemException if a system exception occurred 388 */ 389 public static com.liferay.portal.model.UserNotificationEvent findByUserId_First( 390 long userId, 391 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 392 throws com.liferay.portal.NoSuchUserNotificationEventException, 393 com.liferay.portal.kernel.exception.SystemException { 394 return getPersistence().findByUserId_First(userId, orderByComparator); 395 } 396 397 /** 398 * Finds the last user notification event in the ordered set where userId = ?. 399 * 400 * <p> 401 * 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. 402 * </p> 403 * 404 * @param userId the user ID to search with 405 * @param orderByComparator the comparator to order the set by 406 * @return the last matching user notification event 407 * @throws com.liferay.portal.NoSuchUserNotificationEventException if a matching user notification event could not be found 408 * @throws SystemException if a system exception occurred 409 */ 410 public static com.liferay.portal.model.UserNotificationEvent findByUserId_Last( 411 long userId, 412 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 413 throws com.liferay.portal.NoSuchUserNotificationEventException, 414 com.liferay.portal.kernel.exception.SystemException { 415 return getPersistence().findByUserId_Last(userId, orderByComparator); 416 } 417 418 /** 419 * Finds the user notification events before and after the current user notification event in the ordered set where userId = ?. 420 * 421 * <p> 422 * 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. 423 * </p> 424 * 425 * @param userNotificationEventId the primary key of the current user notification event 426 * @param userId the user ID to search with 427 * @param orderByComparator the comparator to order the set by 428 * @return the previous, current, and next user notification event 429 * @throws com.liferay.portal.NoSuchUserNotificationEventException if a user notification event with the primary key could not be found 430 * @throws SystemException if a system exception occurred 431 */ 432 public static com.liferay.portal.model.UserNotificationEvent[] findByUserId_PrevAndNext( 433 long userNotificationEventId, long userId, 434 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 435 throws com.liferay.portal.NoSuchUserNotificationEventException, 436 com.liferay.portal.kernel.exception.SystemException { 437 return getPersistence() 438 .findByUserId_PrevAndNext(userNotificationEventId, userId, 439 orderByComparator); 440 } 441 442 /** 443 * Finds all the user notification events. 444 * 445 * @return the user notification events 446 * @throws SystemException if a system exception occurred 447 */ 448 public static java.util.List<com.liferay.portal.model.UserNotificationEvent> findAll() 449 throws com.liferay.portal.kernel.exception.SystemException { 450 return getPersistence().findAll(); 451 } 452 453 /** 454 * Finds a range of all the user notification events. 455 * 456 * <p> 457 * 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. 458 * </p> 459 * 460 * @param start the lower bound of the range of user notification events to return 461 * @param end the upper bound of the range of user notification events to return (not inclusive) 462 * @return the range of user notification events 463 * @throws SystemException if a system exception occurred 464 */ 465 public static java.util.List<com.liferay.portal.model.UserNotificationEvent> findAll( 466 int start, int end) 467 throws com.liferay.portal.kernel.exception.SystemException { 468 return getPersistence().findAll(start, end); 469 } 470 471 /** 472 * Finds an ordered range of all the user notification events. 473 * 474 * <p> 475 * 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. 476 * </p> 477 * 478 * @param start the lower bound of the range of user notification events to return 479 * @param end the upper bound of the range of user notification events to return (not inclusive) 480 * @param orderByComparator the comparator to order the results by 481 * @return the ordered range of user notification events 482 * @throws SystemException if a system exception occurred 483 */ 484 public static java.util.List<com.liferay.portal.model.UserNotificationEvent> findAll( 485 int start, int end, 486 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 487 throws com.liferay.portal.kernel.exception.SystemException { 488 return getPersistence().findAll(start, end, orderByComparator); 489 } 490 491 /** 492 * Removes all the user notification events where uuid = ? from the database. 493 * 494 * @param uuid the uuid to search with 495 * @throws SystemException if a system exception occurred 496 */ 497 public static void removeByUuid(java.lang.String uuid) 498 throws com.liferay.portal.kernel.exception.SystemException { 499 getPersistence().removeByUuid(uuid); 500 } 501 502 /** 503 * Removes all the user notification events where userId = ? from the database. 504 * 505 * @param userId the user ID to search with 506 * @throws SystemException if a system exception occurred 507 */ 508 public static void removeByUserId(long userId) 509 throws com.liferay.portal.kernel.exception.SystemException { 510 getPersistence().removeByUserId(userId); 511 } 512 513 /** 514 * Removes all the user notification events from the database. 515 * 516 * @throws SystemException if a system exception occurred 517 */ 518 public static void removeAll() 519 throws com.liferay.portal.kernel.exception.SystemException { 520 getPersistence().removeAll(); 521 } 522 523 /** 524 * Counts all the user notification events where uuid = ?. 525 * 526 * @param uuid the uuid to search with 527 * @return the number of matching user notification events 528 * @throws SystemException if a system exception occurred 529 */ 530 public static int countByUuid(java.lang.String uuid) 531 throws com.liferay.portal.kernel.exception.SystemException { 532 return getPersistence().countByUuid(uuid); 533 } 534 535 /** 536 * Counts all the user notification events where userId = ?. 537 * 538 * @param userId the user ID to search with 539 * @return the number of matching user notification events 540 * @throws SystemException if a system exception occurred 541 */ 542 public static int countByUserId(long userId) 543 throws com.liferay.portal.kernel.exception.SystemException { 544 return getPersistence().countByUserId(userId); 545 } 546 547 /** 548 * Counts all the user notification events. 549 * 550 * @return the number of user notification events 551 * @throws SystemException if a system exception occurred 552 */ 553 public static int countAll() 554 throws com.liferay.portal.kernel.exception.SystemException { 555 return getPersistence().countAll(); 556 } 557 558 public static UserNotificationEventPersistence getPersistence() { 559 if (_persistence == null) { 560 _persistence = (UserNotificationEventPersistence)PortalBeanLocatorUtil.locate(UserNotificationEventPersistence.class.getName()); 561 562 ReferenceRegistry.registerReference(UserNotificationEventUtil.class, 563 "_persistence"); 564 } 565 566 return _persistence; 567 } 568 569 public void setPersistence(UserNotificationEventPersistence persistence) { 570 _persistence = persistence; 571 572 ReferenceRegistry.registerReference(UserNotificationEventUtil.class, 573 "_persistence"); 574 } 575 576 private static UserNotificationEventPersistence _persistence; 577 }