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.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 to cache 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 to cache 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 to remove 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 * Finds 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 to find 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 * Finds 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 to find 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 * Finds all the announcements flags where entryId = ?. 205 * 206 * @param entryId the entry ID to search with 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 * Finds 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 to search with 224 * @param start the lower bound of the range of announcements flags to return 225 * @param end the upper bound of the range of announcements flags to return (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 * Finds 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 to search with 243 * @param start the lower bound of the range of announcements flags to return 244 * @param end the upper bound of the range of announcements flags to return (not inclusive) 245 * @param orderByComparator the comparator to order the results by 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 * Finds 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 to search with 265 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 286 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 308 * @param orderByComparator the comparator to order the set by 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 * 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. 324 * 325 * @param userId the user ID to search with 326 * @param entryId the entry ID to search with 327 * @param value the value to search with 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 * 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. 341 * 342 * @param userId the user ID to search with 343 * @param entryId the entry ID to search with 344 * @param value the value to search with 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 * 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. 356 * 357 * @param userId the user ID to search with 358 * @param entryId the entry ID to search with 359 * @param value the value to search with 360 * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found 361 * @throws SystemException if a system exception occurred 362 */ 363 public static com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V( 364 long userId, long entryId, int value, boolean retrieveFromCache) 365 throws com.liferay.portal.kernel.exception.SystemException { 366 return getPersistence() 367 .fetchByU_E_V(userId, entryId, value, retrieveFromCache); 368 } 369 370 /** 371 * Finds all the announcements flags. 372 * 373 * @return the announcements flags 374 * @throws SystemException if a system exception occurred 375 */ 376 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll() 377 throws com.liferay.portal.kernel.exception.SystemException { 378 return getPersistence().findAll(); 379 } 380 381 /** 382 * Finds a range of all the announcements flags. 383 * 384 * <p> 385 * 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. 386 * </p> 387 * 388 * @param start the lower bound of the range of announcements flags to return 389 * @param end the upper bound of the range of announcements flags to return (not inclusive) 390 * @return the range of announcements flags 391 * @throws SystemException if a system exception occurred 392 */ 393 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll( 394 int start, int end) 395 throws com.liferay.portal.kernel.exception.SystemException { 396 return getPersistence().findAll(start, end); 397 } 398 399 /** 400 * Finds an ordered range of all the announcements flags. 401 * 402 * <p> 403 * 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. 404 * </p> 405 * 406 * @param start the lower bound of the range of announcements flags to return 407 * @param end the upper bound of the range of announcements flags to return (not inclusive) 408 * @param orderByComparator the comparator to order the results by 409 * @return the ordered range of announcements flags 410 * @throws SystemException if a system exception occurred 411 */ 412 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll( 413 int start, int end, 414 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 415 throws com.liferay.portal.kernel.exception.SystemException { 416 return getPersistence().findAll(start, end, orderByComparator); 417 } 418 419 /** 420 * Removes all the announcements flags where entryId = ? from the database. 421 * 422 * @param entryId the entry ID to search with 423 * @throws SystemException if a system exception occurred 424 */ 425 public static void removeByEntryId(long entryId) 426 throws com.liferay.portal.kernel.exception.SystemException { 427 getPersistence().removeByEntryId(entryId); 428 } 429 430 /** 431 * Removes the announcements flag where userId = ? and entryId = ? and value = ? from the database. 432 * 433 * @param userId the user ID to search with 434 * @param entryId the entry ID to search with 435 * @param value the value to search with 436 * @throws SystemException if a system exception occurred 437 */ 438 public static void removeByU_E_V(long userId, long entryId, int value) 439 throws com.liferay.portal.kernel.exception.SystemException, 440 com.liferay.portlet.announcements.NoSuchFlagException { 441 getPersistence().removeByU_E_V(userId, entryId, value); 442 } 443 444 /** 445 * Removes all the announcements flags from the database. 446 * 447 * @throws SystemException if a system exception occurred 448 */ 449 public static void removeAll() 450 throws com.liferay.portal.kernel.exception.SystemException { 451 getPersistence().removeAll(); 452 } 453 454 /** 455 * Counts all the announcements flags where entryId = ?. 456 * 457 * @param entryId the entry ID to search with 458 * @return the number of matching announcements flags 459 * @throws SystemException if a system exception occurred 460 */ 461 public static int countByEntryId(long entryId) 462 throws com.liferay.portal.kernel.exception.SystemException { 463 return getPersistence().countByEntryId(entryId); 464 } 465 466 /** 467 * Counts all the announcements flags where userId = ? and entryId = ? and value = ?. 468 * 469 * @param userId the user ID to search with 470 * @param entryId the entry ID to search with 471 * @param value the value to search with 472 * @return the number of matching announcements flags 473 * @throws SystemException if a system exception occurred 474 */ 475 public static int countByU_E_V(long userId, long entryId, int value) 476 throws com.liferay.portal.kernel.exception.SystemException { 477 return getPersistence().countByU_E_V(userId, entryId, value); 478 } 479 480 /** 481 * Counts all the announcements flags. 482 * 483 * @return the number of announcements flags 484 * @throws SystemException if a system exception occurred 485 */ 486 public static int countAll() 487 throws com.liferay.portal.kernel.exception.SystemException { 488 return getPersistence().countAll(); 489 } 490 491 public static AnnouncementsFlagPersistence getPersistence() { 492 if (_persistence == null) { 493 _persistence = (AnnouncementsFlagPersistence)PortalBeanLocatorUtil.locate(AnnouncementsFlagPersistence.class.getName()); 494 495 ReferenceRegistry.registerReference(AnnouncementsFlagUtil.class, 496 "_persistence"); 497 } 498 499 return _persistence; 500 } 501 502 public void setPersistence(AnnouncementsFlagPersistence persistence) { 503 _persistence = persistence; 504 505 ReferenceRegistry.registerReference(AnnouncementsFlagUtil.class, 506 "_persistence"); 507 } 508 509 private static AnnouncementsFlagPersistence _persistence; 510 }