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