001 /** 002 * Copyright (c) 2000-2010 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.service.ServiceContext; 022 023 import com.liferay.portlet.announcements.model.AnnouncementsFlag; 024 025 import java.util.List; 026 027 /** 028 * 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. 029 * 030 * <p> 031 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 032 * </p> 033 * 034 * <p> 035 * Caching information and settings can be found in <code>portal.properties</code> 036 * </p> 037 * 038 * @author Brian Wing Shun Chan 039 * @see AnnouncementsFlagPersistence 040 * @see AnnouncementsFlagPersistenceImpl 041 * @generated 042 */ 043 public class AnnouncementsFlagUtil { 044 /** 045 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 046 */ 047 public static void clearCache() { 048 getPersistence().clearCache(); 049 } 050 051 /** 052 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 053 */ 054 public static void clearCache(AnnouncementsFlag announcementsFlag) { 055 getPersistence().clearCache(announcementsFlag); 056 } 057 058 /** 059 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 060 */ 061 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 062 throws SystemException { 063 return getPersistence().countWithDynamicQuery(dynamicQuery); 064 } 065 066 /** 067 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 068 */ 069 public static List<AnnouncementsFlag> findWithDynamicQuery( 070 DynamicQuery dynamicQuery) throws SystemException { 071 return getPersistence().findWithDynamicQuery(dynamicQuery); 072 } 073 074 /** 075 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 076 */ 077 public static List<AnnouncementsFlag> findWithDynamicQuery( 078 DynamicQuery dynamicQuery, int start, int end) 079 throws SystemException { 080 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 081 } 082 083 /** 084 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 085 */ 086 public static List<AnnouncementsFlag> findWithDynamicQuery( 087 DynamicQuery dynamicQuery, int start, int end, 088 OrderByComparator orderByComparator) throws SystemException { 089 return getPersistence() 090 .findWithDynamicQuery(dynamicQuery, start, end, 091 orderByComparator); 092 } 093 094 /** 095 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 096 */ 097 public static AnnouncementsFlag remove(AnnouncementsFlag announcementsFlag) 098 throws SystemException { 099 return getPersistence().remove(announcementsFlag); 100 } 101 102 /** 103 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 104 */ 105 public static AnnouncementsFlag update( 106 AnnouncementsFlag announcementsFlag, boolean merge) 107 throws SystemException { 108 return getPersistence().update(announcementsFlag, merge); 109 } 110 111 /** 112 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 113 */ 114 public static AnnouncementsFlag update( 115 AnnouncementsFlag announcementsFlag, boolean merge, 116 ServiceContext serviceContext) throws SystemException { 117 return getPersistence().update(announcementsFlag, merge, serviceContext); 118 } 119 120 /** 121 * Caches the announcements flag in the entity cache if it is enabled. 122 * 123 * @param announcementsFlag the announcements flag to cache 124 */ 125 public static void cacheResult( 126 com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag) { 127 getPersistence().cacheResult(announcementsFlag); 128 } 129 130 /** 131 * Caches the announcements flags in the entity cache if it is enabled. 132 * 133 * @param announcementsFlags the announcements flags to cache 134 */ 135 public static void cacheResult( 136 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> announcementsFlags) { 137 getPersistence().cacheResult(announcementsFlags); 138 } 139 140 /** 141 * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database. 142 * 143 * @param flagId the primary key for the new announcements flag 144 * @return the new announcements flag 145 */ 146 public static com.liferay.portlet.announcements.model.AnnouncementsFlag create( 147 long flagId) { 148 return getPersistence().create(flagId); 149 } 150 151 /** 152 * Removes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners. 153 * 154 * @param flagId the primary key of the announcements flag to remove 155 * @return the announcements flag that was removed 156 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found 157 * @throws SystemException if a system exception occurred 158 */ 159 public static com.liferay.portlet.announcements.model.AnnouncementsFlag remove( 160 long flagId) 161 throws com.liferay.portal.kernel.exception.SystemException, 162 com.liferay.portlet.announcements.NoSuchFlagException { 163 return getPersistence().remove(flagId); 164 } 165 166 public static com.liferay.portlet.announcements.model.AnnouncementsFlag updateImpl( 167 com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag, 168 boolean merge) 169 throws com.liferay.portal.kernel.exception.SystemException { 170 return getPersistence().updateImpl(announcementsFlag, merge); 171 } 172 173 /** 174 * Finds the announcements flag with the primary key or throws a {@link com.liferay.portlet.announcements.NoSuchFlagException} if it could not be found. 175 * 176 * @param flagId the primary key of the announcements flag to find 177 * @return the announcements flag 178 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found 179 * @throws SystemException if a system exception occurred 180 */ 181 public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByPrimaryKey( 182 long flagId) 183 throws com.liferay.portal.kernel.exception.SystemException, 184 com.liferay.portlet.announcements.NoSuchFlagException { 185 return getPersistence().findByPrimaryKey(flagId); 186 } 187 188 /** 189 * Finds the announcements flag with the primary key or returns <code>null</code> if it could not be found. 190 * 191 * @param flagId the primary key of the announcements flag to find 192 * @return the announcements flag, or <code>null</code> if a announcements flag with the primary key could not be found 193 * @throws SystemException if a system exception occurred 194 */ 195 public static com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByPrimaryKey( 196 long flagId) throws com.liferay.portal.kernel.exception.SystemException { 197 return getPersistence().fetchByPrimaryKey(flagId); 198 } 199 200 /** 201 * Finds all the announcements flags where entryId = ?. 202 * 203 * @param entryId the entry id to search with 204 * @return the matching announcements flags 205 * @throws SystemException if a system exception occurred 206 */ 207 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId( 208 long entryId) 209 throws com.liferay.portal.kernel.exception.SystemException { 210 return getPersistence().findByEntryId(entryId); 211 } 212 213 /** 214 * Finds a range of all the announcements flags where entryId = ?. 215 * 216 * <p> 217 * 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. 218 * </p> 219 * 220 * @param entryId the entry id to search with 221 * @param start the lower bound of the range of announcements flags to return 222 * @param end the upper bound of the range of announcements flags to return (not inclusive) 223 * @return the range of matching announcements flags 224 * @throws SystemException if a system exception occurred 225 */ 226 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId( 227 long entryId, int start, int end) 228 throws com.liferay.portal.kernel.exception.SystemException { 229 return getPersistence().findByEntryId(entryId, start, end); 230 } 231 232 /** 233 * Finds an ordered range of all the announcements flags where entryId = ?. 234 * 235 * <p> 236 * 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. 237 * </p> 238 * 239 * @param entryId the entry id to search with 240 * @param start the lower bound of the range of announcements flags to return 241 * @param end the upper bound of the range of announcements flags to return (not inclusive) 242 * @param orderByComparator the comparator to order the results by 243 * @return the ordered range of matching announcements flags 244 * @throws SystemException if a system exception occurred 245 */ 246 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId( 247 long entryId, int start, int end, 248 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 249 throws com.liferay.portal.kernel.exception.SystemException { 250 return getPersistence() 251 .findByEntryId(entryId, start, end, orderByComparator); 252 } 253 254 /** 255 * Finds the first announcements flag in the ordered set where entryId = ?. 256 * 257 * <p> 258 * 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. 259 * </p> 260 * 261 * @param entryId the entry id to search with 262 * @param orderByComparator the comparator to order the set by 263 * @return the first matching announcements flag 264 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found 265 * @throws SystemException if a system exception occurred 266 */ 267 public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByEntryId_First( 268 long entryId, 269 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 270 throws com.liferay.portal.kernel.exception.SystemException, 271 com.liferay.portlet.announcements.NoSuchFlagException { 272 return getPersistence().findByEntryId_First(entryId, orderByComparator); 273 } 274 275 /** 276 * Finds the last announcements flag in the ordered set where entryId = ?. 277 * 278 * <p> 279 * 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. 280 * </p> 281 * 282 * @param entryId the entry id to search with 283 * @param orderByComparator the comparator to order the set by 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 * Finds the announcements flags before and after the current announcements flag in the ordered set where entryId = ?. 298 * 299 * <p> 300 * 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. 301 * </p> 302 * 303 * @param flagId the primary key of the current announcements flag 304 * @param entryId the entry id to search with 305 * @param orderByComparator the comparator to order the set by 306 * @return the previous, current, and next announcements flag 307 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found 308 * @throws SystemException if a system exception occurred 309 */ 310 public static com.liferay.portlet.announcements.model.AnnouncementsFlag[] findByEntryId_PrevAndNext( 311 long flagId, long entryId, 312 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 313 throws com.liferay.portal.kernel.exception.SystemException, 314 com.liferay.portlet.announcements.NoSuchFlagException { 315 return getPersistence() 316 .findByEntryId_PrevAndNext(flagId, entryId, orderByComparator); 317 } 318 319 /** 320 * Finds the announcements flag where userId = ? and entryId = ? and value = ? or throws a {@link com.liferay.portlet.announcements.NoSuchFlagException} if it could not be found. 321 * 322 * @param userId the user id to search with 323 * @param entryId the entry id to search with 324 * @param value the value to search with 325 * @return the matching announcements flag 326 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found 327 * @throws SystemException if a system exception occurred 328 */ 329 public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByU_E_V( 330 long userId, long entryId, int value) 331 throws com.liferay.portal.kernel.exception.SystemException, 332 com.liferay.portlet.announcements.NoSuchFlagException { 333 return getPersistence().findByU_E_V(userId, entryId, value); 334 } 335 336 /** 337 * Finds the announcements flag where userId = ? and entryId = ? and value = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 338 * 339 * @param userId the user id to search with 340 * @param entryId the entry id to search with 341 * @param value the value to search with 342 * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found 343 * @throws SystemException if a system exception occurred 344 */ 345 public static com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V( 346 long userId, long entryId, int value) 347 throws com.liferay.portal.kernel.exception.SystemException { 348 return getPersistence().fetchByU_E_V(userId, entryId, value); 349 } 350 351 /** 352 * Finds 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. 353 * 354 * @param userId the user id to search with 355 * @param entryId the entry id to search with 356 * @param value the value to search with 357 * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found 358 * @throws SystemException if a system exception occurred 359 */ 360 public static com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V( 361 long userId, long entryId, int value, boolean retrieveFromCache) 362 throws com.liferay.portal.kernel.exception.SystemException { 363 return getPersistence() 364 .fetchByU_E_V(userId, entryId, value, retrieveFromCache); 365 } 366 367 /** 368 * Finds all the announcements flags. 369 * 370 * @return the announcements flags 371 * @throws SystemException if a system exception occurred 372 */ 373 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll() 374 throws com.liferay.portal.kernel.exception.SystemException { 375 return getPersistence().findAll(); 376 } 377 378 /** 379 * Finds a range of all the announcements flags. 380 * 381 * <p> 382 * 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. 383 * </p> 384 * 385 * @param start the lower bound of the range of announcements flags to return 386 * @param end the upper bound of the range of announcements flags to return (not inclusive) 387 * @return the range of announcements flags 388 * @throws SystemException if a system exception occurred 389 */ 390 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll( 391 int start, int end) 392 throws com.liferay.portal.kernel.exception.SystemException { 393 return getPersistence().findAll(start, end); 394 } 395 396 /** 397 * Finds an ordered range of all the announcements flags. 398 * 399 * <p> 400 * 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. 401 * </p> 402 * 403 * @param start the lower bound of the range of announcements flags to return 404 * @param end the upper bound of the range of announcements flags to return (not inclusive) 405 * @param orderByComparator the comparator to order the results by 406 * @return the ordered range of announcements flags 407 * @throws SystemException if a system exception occurred 408 */ 409 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll( 410 int start, int end, 411 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 412 throws com.liferay.portal.kernel.exception.SystemException { 413 return getPersistence().findAll(start, end, orderByComparator); 414 } 415 416 /** 417 * Removes all the announcements flags where entryId = ? from the database. 418 * 419 * @param entryId the entry id to search with 420 * @throws SystemException if a system exception occurred 421 */ 422 public static void removeByEntryId(long entryId) 423 throws com.liferay.portal.kernel.exception.SystemException { 424 getPersistence().removeByEntryId(entryId); 425 } 426 427 /** 428 * Removes the announcements flag where userId = ? and entryId = ? and value = ? from the database. 429 * 430 * @param userId the user id to search with 431 * @param entryId the entry id to search with 432 * @param value the value to search with 433 * @throws SystemException if a system exception occurred 434 */ 435 public static void removeByU_E_V(long userId, long entryId, int value) 436 throws com.liferay.portal.kernel.exception.SystemException, 437 com.liferay.portlet.announcements.NoSuchFlagException { 438 getPersistence().removeByU_E_V(userId, entryId, value); 439 } 440 441 /** 442 * Removes all the announcements flags from the database. 443 * 444 * @throws SystemException if a system exception occurred 445 */ 446 public static void removeAll() 447 throws com.liferay.portal.kernel.exception.SystemException { 448 getPersistence().removeAll(); 449 } 450 451 /** 452 * Counts all the announcements flags where entryId = ?. 453 * 454 * @param entryId the entry id to search with 455 * @return the number of matching announcements flags 456 * @throws SystemException if a system exception occurred 457 */ 458 public static int countByEntryId(long entryId) 459 throws com.liferay.portal.kernel.exception.SystemException { 460 return getPersistence().countByEntryId(entryId); 461 } 462 463 /** 464 * Counts all the announcements flags where userId = ? and entryId = ? and value = ?. 465 * 466 * @param userId the user id to search with 467 * @param entryId the entry id to search with 468 * @param value the value to search with 469 * @return the number of matching announcements flags 470 * @throws SystemException if a system exception occurred 471 */ 472 public static int countByU_E_V(long userId, long entryId, int value) 473 throws com.liferay.portal.kernel.exception.SystemException { 474 return getPersistence().countByU_E_V(userId, entryId, value); 475 } 476 477 /** 478 * Counts all the announcements flags. 479 * 480 * @return the number of announcements flags 481 * @throws SystemException if a system exception occurred 482 */ 483 public static int countAll() 484 throws com.liferay.portal.kernel.exception.SystemException { 485 return getPersistence().countAll(); 486 } 487 488 public static AnnouncementsFlagPersistence getPersistence() { 489 if (_persistence == null) { 490 _persistence = (AnnouncementsFlagPersistence)PortalBeanLocatorUtil.locate(AnnouncementsFlagPersistence.class.getName()); 491 } 492 493 return _persistence; 494 } 495 496 public void setPersistence(AnnouncementsFlagPersistence persistence) { 497 _persistence = persistence; 498 } 499 500 private static AnnouncementsFlagPersistence _persistence; 501 }