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