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