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