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