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