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.AnnouncementsDelivery; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the announcements delivery service. This utility wraps {@link AnnouncementsDeliveryPersistenceImpl} 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 AnnouncementsDeliveryPersistence 038 * @see AnnouncementsDeliveryPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class AnnouncementsDeliveryUtil { 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(AnnouncementsDelivery announcementsDelivery) { 060 getPersistence().clearCache(announcementsDelivery); 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<AnnouncementsDelivery> 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<AnnouncementsDelivery> 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<AnnouncementsDelivery> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator<AnnouncementsDelivery> 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 AnnouncementsDelivery update( 101 AnnouncementsDelivery announcementsDelivery) { 102 return getPersistence().update(announcementsDelivery); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 107 */ 108 public static AnnouncementsDelivery update( 109 AnnouncementsDelivery announcementsDelivery, 110 ServiceContext serviceContext) { 111 return getPersistence().update(announcementsDelivery, serviceContext); 112 } 113 114 /** 115 * Returns all the announcements deliveries where userId = ?. 116 * 117 * @param userId the user ID 118 * @return the matching announcements deliveries 119 */ 120 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId( 121 long userId) { 122 return getPersistence().findByUserId(userId); 123 } 124 125 /** 126 * Returns a range of all the announcements deliveries where userId = ?. 127 * 128 * <p> 129 * 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.AnnouncementsDeliveryModelImpl}. 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. 130 * </p> 131 * 132 * @param userId the user ID 133 * @param start the lower bound of the range of announcements deliveries 134 * @param end the upper bound of the range of announcements deliveries (not inclusive) 135 * @return the range of matching announcements deliveries 136 */ 137 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId( 138 long userId, int start, int end) { 139 return getPersistence().findByUserId(userId, start, end); 140 } 141 142 /** 143 * Returns an ordered range of all the announcements deliveries where userId = ?. 144 * 145 * <p> 146 * 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.AnnouncementsDeliveryModelImpl}. 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. 147 * </p> 148 * 149 * @param userId the user ID 150 * @param start the lower bound of the range of announcements deliveries 151 * @param end the upper bound of the range of announcements deliveries (not inclusive) 152 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 153 * @return the ordered range of matching announcements deliveries 154 */ 155 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId( 156 long userId, int start, int end, 157 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.announcements.model.AnnouncementsDelivery> orderByComparator) { 158 return getPersistence() 159 .findByUserId(userId, start, end, orderByComparator); 160 } 161 162 /** 163 * Returns the first announcements delivery in the ordered set where userId = ?. 164 * 165 * @param userId the user ID 166 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 167 * @return the first matching announcements delivery 168 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a matching announcements delivery could not be found 169 */ 170 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByUserId_First( 171 long userId, 172 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.announcements.model.AnnouncementsDelivery> orderByComparator) 173 throws com.liferay.portlet.announcements.NoSuchDeliveryException { 174 return getPersistence().findByUserId_First(userId, orderByComparator); 175 } 176 177 /** 178 * Returns the first announcements delivery in the ordered set where userId = ?. 179 * 180 * @param userId the user ID 181 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 182 * @return the first matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 183 */ 184 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByUserId_First( 185 long userId, 186 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.announcements.model.AnnouncementsDelivery> orderByComparator) { 187 return getPersistence().fetchByUserId_First(userId, orderByComparator); 188 } 189 190 /** 191 * Returns the last announcements delivery in the ordered set where userId = ?. 192 * 193 * @param userId the user ID 194 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 195 * @return the last matching announcements delivery 196 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a matching announcements delivery could not be found 197 */ 198 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByUserId_Last( 199 long userId, 200 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.announcements.model.AnnouncementsDelivery> orderByComparator) 201 throws com.liferay.portlet.announcements.NoSuchDeliveryException { 202 return getPersistence().findByUserId_Last(userId, orderByComparator); 203 } 204 205 /** 206 * Returns the last announcements delivery in the ordered set where userId = ?. 207 * 208 * @param userId the user ID 209 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 210 * @return the last matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 211 */ 212 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByUserId_Last( 213 long userId, 214 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.announcements.model.AnnouncementsDelivery> orderByComparator) { 215 return getPersistence().fetchByUserId_Last(userId, orderByComparator); 216 } 217 218 /** 219 * Returns the announcements deliveries before and after the current announcements delivery in the ordered set where userId = ?. 220 * 221 * @param deliveryId the primary key of the current announcements delivery 222 * @param userId the user ID 223 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 224 * @return the previous, current, and next announcements delivery 225 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a announcements delivery with the primary key could not be found 226 */ 227 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery[] findByUserId_PrevAndNext( 228 long deliveryId, long userId, 229 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.announcements.model.AnnouncementsDelivery> orderByComparator) 230 throws com.liferay.portlet.announcements.NoSuchDeliveryException { 231 return getPersistence() 232 .findByUserId_PrevAndNext(deliveryId, userId, 233 orderByComparator); 234 } 235 236 /** 237 * Removes all the announcements deliveries where userId = ? from the database. 238 * 239 * @param userId the user ID 240 */ 241 public static void removeByUserId(long userId) { 242 getPersistence().removeByUserId(userId); 243 } 244 245 /** 246 * Returns the number of announcements deliveries where userId = ?. 247 * 248 * @param userId the user ID 249 * @return the number of matching announcements deliveries 250 */ 251 public static int countByUserId(long userId) { 252 return getPersistence().countByUserId(userId); 253 } 254 255 /** 256 * Returns the announcements delivery where userId = ? and type = ? or throws a {@link com.liferay.portlet.announcements.NoSuchDeliveryException} if it could not be found. 257 * 258 * @param userId the user ID 259 * @param type the type 260 * @return the matching announcements delivery 261 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a matching announcements delivery could not be found 262 */ 263 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByU_T( 264 long userId, java.lang.String type) 265 throws com.liferay.portlet.announcements.NoSuchDeliveryException { 266 return getPersistence().findByU_T(userId, type); 267 } 268 269 /** 270 * Returns the announcements delivery where userId = ? and type = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 271 * 272 * @param userId the user ID 273 * @param type the type 274 * @return the matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 275 */ 276 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByU_T( 277 long userId, java.lang.String type) { 278 return getPersistence().fetchByU_T(userId, type); 279 } 280 281 /** 282 * Returns the announcements delivery where userId = ? and type = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 283 * 284 * @param userId the user ID 285 * @param type the type 286 * @param retrieveFromCache whether to use the finder cache 287 * @return the matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 288 */ 289 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByU_T( 290 long userId, java.lang.String type, boolean retrieveFromCache) { 291 return getPersistence().fetchByU_T(userId, type, retrieveFromCache); 292 } 293 294 /** 295 * Removes the announcements delivery where userId = ? and type = ? from the database. 296 * 297 * @param userId the user ID 298 * @param type the type 299 * @return the announcements delivery that was removed 300 */ 301 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery removeByU_T( 302 long userId, java.lang.String type) 303 throws com.liferay.portlet.announcements.NoSuchDeliveryException { 304 return getPersistence().removeByU_T(userId, type); 305 } 306 307 /** 308 * Returns the number of announcements deliveries where userId = ? and type = ?. 309 * 310 * @param userId the user ID 311 * @param type the type 312 * @return the number of matching announcements deliveries 313 */ 314 public static int countByU_T(long userId, java.lang.String type) { 315 return getPersistence().countByU_T(userId, type); 316 } 317 318 /** 319 * Caches the announcements delivery in the entity cache if it is enabled. 320 * 321 * @param announcementsDelivery the announcements delivery 322 */ 323 public static void cacheResult( 324 com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery) { 325 getPersistence().cacheResult(announcementsDelivery); 326 } 327 328 /** 329 * Caches the announcements deliveries in the entity cache if it is enabled. 330 * 331 * @param announcementsDeliveries the announcements deliveries 332 */ 333 public static void cacheResult( 334 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDeliveries) { 335 getPersistence().cacheResult(announcementsDeliveries); 336 } 337 338 /** 339 * Creates a new announcements delivery with the primary key. Does not add the announcements delivery to the database. 340 * 341 * @param deliveryId the primary key for the new announcements delivery 342 * @return the new announcements delivery 343 */ 344 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery create( 345 long deliveryId) { 346 return getPersistence().create(deliveryId); 347 } 348 349 /** 350 * Removes the announcements delivery with the primary key from the database. Also notifies the appropriate model listeners. 351 * 352 * @param deliveryId the primary key of the announcements delivery 353 * @return the announcements delivery that was removed 354 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a announcements delivery with the primary key could not be found 355 */ 356 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery remove( 357 long deliveryId) 358 throws com.liferay.portlet.announcements.NoSuchDeliveryException { 359 return getPersistence().remove(deliveryId); 360 } 361 362 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery updateImpl( 363 com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery) { 364 return getPersistence().updateImpl(announcementsDelivery); 365 } 366 367 /** 368 * Returns the announcements delivery with the primary key or throws a {@link com.liferay.portlet.announcements.NoSuchDeliveryException} if it could not be found. 369 * 370 * @param deliveryId the primary key of the announcements delivery 371 * @return the announcements delivery 372 * @throws com.liferay.portlet.announcements.NoSuchDeliveryException if a announcements delivery with the primary key could not be found 373 */ 374 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByPrimaryKey( 375 long deliveryId) 376 throws com.liferay.portlet.announcements.NoSuchDeliveryException { 377 return getPersistence().findByPrimaryKey(deliveryId); 378 } 379 380 /** 381 * Returns the announcements delivery with the primary key or returns <code>null</code> if it could not be found. 382 * 383 * @param deliveryId the primary key of the announcements delivery 384 * @return the announcements delivery, or <code>null</code> if a announcements delivery with the primary key could not be found 385 */ 386 public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByPrimaryKey( 387 long deliveryId) { 388 return getPersistence().fetchByPrimaryKey(deliveryId); 389 } 390 391 public static java.util.Map<java.io.Serializable, com.liferay.portlet.announcements.model.AnnouncementsDelivery> fetchByPrimaryKeys( 392 java.util.Set<java.io.Serializable> primaryKeys) { 393 return getPersistence().fetchByPrimaryKeys(primaryKeys); 394 } 395 396 /** 397 * Returns all the announcements deliveries. 398 * 399 * @return the announcements deliveries 400 */ 401 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll() { 402 return getPersistence().findAll(); 403 } 404 405 /** 406 * Returns a range of all the announcements deliveries. 407 * 408 * <p> 409 * 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.AnnouncementsDeliveryModelImpl}. 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. 410 * </p> 411 * 412 * @param start the lower bound of the range of announcements deliveries 413 * @param end the upper bound of the range of announcements deliveries (not inclusive) 414 * @return the range of announcements deliveries 415 */ 416 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll( 417 int start, int end) { 418 return getPersistence().findAll(start, end); 419 } 420 421 /** 422 * Returns an ordered range of all the announcements deliveries. 423 * 424 * <p> 425 * 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.AnnouncementsDeliveryModelImpl}. 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. 426 * </p> 427 * 428 * @param start the lower bound of the range of announcements deliveries 429 * @param end the upper bound of the range of announcements deliveries (not inclusive) 430 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 431 * @return the ordered range of announcements deliveries 432 */ 433 public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll( 434 int start, int end, 435 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.announcements.model.AnnouncementsDelivery> orderByComparator) { 436 return getPersistence().findAll(start, end, orderByComparator); 437 } 438 439 /** 440 * Removes all the announcements deliveries from the database. 441 */ 442 public static void removeAll() { 443 getPersistence().removeAll(); 444 } 445 446 /** 447 * Returns the number of announcements deliveries. 448 * 449 * @return the number of announcements deliveries 450 */ 451 public static int countAll() { 452 return getPersistence().countAll(); 453 } 454 455 public static AnnouncementsDeliveryPersistence getPersistence() { 456 if (_persistence == null) { 457 _persistence = (AnnouncementsDeliveryPersistence)PortalBeanLocatorUtil.locate(AnnouncementsDeliveryPersistence.class.getName()); 458 459 ReferenceRegistry.registerReference(AnnouncementsDeliveryUtil.class, 460 "_persistence"); 461 } 462 463 return _persistence; 464 } 465 466 /** 467 * @deprecated As of 6.2.0 468 */ 469 @Deprecated 470 public void setPersistence(AnnouncementsDeliveryPersistence persistence) { 471 } 472 473 private static AnnouncementsDeliveryPersistence _persistence; 474 }