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.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.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.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) throws com.liferay.portlet.announcements.NoSuchFlagException { 280 return getPersistence().findByU_E_V(userId, entryId, value); 281 } 282 283 /** 284 * 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. 285 * 286 * @param userId the user ID 287 * @param entryId the entry ID 288 * @param value the value 289 * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found 290 */ 291 public static AnnouncementsFlag fetchByU_E_V(long userId, long entryId, 292 int value) { 293 return getPersistence().fetchByU_E_V(userId, entryId, value); 294 } 295 296 /** 297 * 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. 298 * 299 * @param userId the user ID 300 * @param entryId the entry ID 301 * @param value the value 302 * @param retrieveFromCache whether to retrieve from the finder cache 303 * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found 304 */ 305 public static AnnouncementsFlag fetchByU_E_V(long userId, long entryId, 306 int value, boolean retrieveFromCache) { 307 return getPersistence() 308 .fetchByU_E_V(userId, entryId, value, retrieveFromCache); 309 } 310 311 /** 312 * Removes the announcements flag where userId = ? and entryId = ? and value = ? from the database. 313 * 314 * @param userId the user ID 315 * @param entryId the entry ID 316 * @param value the value 317 * @return the announcements flag that was removed 318 */ 319 public static AnnouncementsFlag removeByU_E_V(long userId, long entryId, 320 int value) throws com.liferay.portlet.announcements.NoSuchFlagException { 321 return getPersistence().removeByU_E_V(userId, entryId, value); 322 } 323 324 /** 325 * Returns the number of announcements flags where userId = ? and entryId = ? and value = ?. 326 * 327 * @param userId the user ID 328 * @param entryId the entry ID 329 * @param value the value 330 * @return the number of matching announcements flags 331 */ 332 public static int countByU_E_V(long userId, long entryId, int value) { 333 return getPersistence().countByU_E_V(userId, entryId, value); 334 } 335 336 /** 337 * Caches the announcements flag in the entity cache if it is enabled. 338 * 339 * @param announcementsFlag the announcements flag 340 */ 341 public static void cacheResult(AnnouncementsFlag announcementsFlag) { 342 getPersistence().cacheResult(announcementsFlag); 343 } 344 345 /** 346 * Caches the announcements flags in the entity cache if it is enabled. 347 * 348 * @param announcementsFlags the announcements flags 349 */ 350 public static void cacheResult(List<AnnouncementsFlag> announcementsFlags) { 351 getPersistence().cacheResult(announcementsFlags); 352 } 353 354 /** 355 * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database. 356 * 357 * @param flagId the primary key for the new announcements flag 358 * @return the new announcements flag 359 */ 360 public static AnnouncementsFlag create(long flagId) { 361 return getPersistence().create(flagId); 362 } 363 364 /** 365 * Removes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners. 366 * 367 * @param flagId the primary key of the announcements flag 368 * @return the announcements flag that was removed 369 * @throws NoSuchFlagException if a announcements flag with the primary key could not be found 370 */ 371 public static AnnouncementsFlag remove(long flagId) 372 throws com.liferay.portlet.announcements.NoSuchFlagException { 373 return getPersistence().remove(flagId); 374 } 375 376 public static AnnouncementsFlag updateImpl( 377 AnnouncementsFlag announcementsFlag) { 378 return getPersistence().updateImpl(announcementsFlag); 379 } 380 381 /** 382 * Returns the announcements flag with the primary key or throws a {@link NoSuchFlagException} if it could not be found. 383 * 384 * @param flagId the primary key of the announcements flag 385 * @return the announcements flag 386 * @throws NoSuchFlagException if a announcements flag with the primary key could not be found 387 */ 388 public static AnnouncementsFlag findByPrimaryKey(long flagId) 389 throws com.liferay.portlet.announcements.NoSuchFlagException { 390 return getPersistence().findByPrimaryKey(flagId); 391 } 392 393 /** 394 * Returns the announcements flag with the primary key or returns <code>null</code> if it could not be found. 395 * 396 * @param flagId the primary key of the announcements flag 397 * @return the announcements flag, or <code>null</code> if a announcements flag with the primary key could not be found 398 */ 399 public static AnnouncementsFlag fetchByPrimaryKey(long flagId) { 400 return getPersistence().fetchByPrimaryKey(flagId); 401 } 402 403 public static java.util.Map<java.io.Serializable, AnnouncementsFlag> fetchByPrimaryKeys( 404 java.util.Set<java.io.Serializable> primaryKeys) { 405 return getPersistence().fetchByPrimaryKeys(primaryKeys); 406 } 407 408 /** 409 * Returns all the announcements flags. 410 * 411 * @return the announcements flags 412 */ 413 public static List<AnnouncementsFlag> findAll() { 414 return getPersistence().findAll(); 415 } 416 417 /** 418 * Returns a range of all the announcements flags. 419 * 420 * <p> 421 * 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. 422 * </p> 423 * 424 * @param start the lower bound of the range of announcements flags 425 * @param end the upper bound of the range of announcements flags (not inclusive) 426 * @return the range of announcements flags 427 */ 428 public static List<AnnouncementsFlag> findAll(int start, int end) { 429 return getPersistence().findAll(start, end); 430 } 431 432 /** 433 * Returns an ordered range of all the announcements flags. 434 * 435 * <p> 436 * 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. 437 * </p> 438 * 439 * @param start the lower bound of the range of announcements flags 440 * @param end the upper bound of the range of announcements flags (not inclusive) 441 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 442 * @return the ordered range of announcements flags 443 */ 444 public static List<AnnouncementsFlag> findAll(int start, int end, 445 OrderByComparator<AnnouncementsFlag> orderByComparator) { 446 return getPersistence().findAll(start, end, orderByComparator); 447 } 448 449 /** 450 * Returns an ordered range of all the announcements flags. 451 * 452 * <p> 453 * 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. 454 * </p> 455 * 456 * @param start the lower bound of the range of announcements flags 457 * @param end the upper bound of the range of announcements flags (not inclusive) 458 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 459 * @param retrieveFromCache whether to retrieve from the finder cache 460 * @return the ordered range of announcements flags 461 */ 462 public static List<AnnouncementsFlag> findAll(int start, int end, 463 OrderByComparator<AnnouncementsFlag> orderByComparator, 464 boolean retrieveFromCache) { 465 return getPersistence() 466 .findAll(start, end, orderByComparator, retrieveFromCache); 467 } 468 469 /** 470 * Removes all the announcements flags from the database. 471 */ 472 public static void removeAll() { 473 getPersistence().removeAll(); 474 } 475 476 /** 477 * Returns the number of announcements flags. 478 * 479 * @return the number of announcements flags 480 */ 481 public static int countAll() { 482 return getPersistence().countAll(); 483 } 484 485 public static AnnouncementsFlagPersistence getPersistence() { 486 if (_persistence == null) { 487 _persistence = (AnnouncementsFlagPersistence)PortalBeanLocatorUtil.locate(AnnouncementsFlagPersistence.class.getName()); 488 489 ReferenceRegistry.registerReference(AnnouncementsFlagUtil.class, 490 "_persistence"); 491 } 492 493 return _persistence; 494 } 495 496 private static AnnouncementsFlagPersistence _persistence; 497 }