1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.announcements.service.persistence;
24  
25  /**
26   * <a href="AnnouncementsDeliveryUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class AnnouncementsDeliveryUtil {
32      public static void cacheResult(
33          com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery) {
34          getPersistence().cacheResult(announcementsDelivery);
35      }
36  
37      public static void cacheResult(
38          java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDeliveries) {
39          getPersistence().cacheResult(announcementsDeliveries);
40      }
41  
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      public static com.liferay.portlet.announcements.model.AnnouncementsDelivery create(
47          long deliveryId) {
48          return getPersistence().create(deliveryId);
49      }
50  
51      public static com.liferay.portlet.announcements.model.AnnouncementsDelivery remove(
52          long deliveryId)
53          throws com.liferay.portal.SystemException,
54              com.liferay.portlet.announcements.NoSuchDeliveryException {
55          return getPersistence().remove(deliveryId);
56      }
57  
58      public static com.liferay.portlet.announcements.model.AnnouncementsDelivery remove(
59          com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery)
60          throws com.liferay.portal.SystemException {
61          return getPersistence().remove(announcementsDelivery);
62      }
63  
64      /**
65       * @deprecated Use <code>update(AnnouncementsDelivery announcementsDelivery, boolean merge)</code>.
66       */
67      public static com.liferay.portlet.announcements.model.AnnouncementsDelivery update(
68          com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(announcementsDelivery);
71      }
72  
73      /**
74       * Add, update, or merge, the entity. This method also calls the model
75       * listeners to trigger the proper events associated with adding, deleting,
76       * or updating an entity.
77       *
78       * @param        announcementsDelivery the entity to add, update, or merge
79       * @param        merge boolean value for whether to merge the entity. The
80       *                default value is false. Setting merge to true is more
81       *                expensive and should only be true when announcementsDelivery is
82       *                transient. See LEP-5473 for a detailed discussion of this
83       *                method.
84       * @return        true if the portlet can be displayed via Ajax
85       */
86      public static com.liferay.portlet.announcements.model.AnnouncementsDelivery update(
87          com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery,
88          boolean merge) throws com.liferay.portal.SystemException {
89          return getPersistence().update(announcementsDelivery, merge);
90      }
91  
92      public static com.liferay.portlet.announcements.model.AnnouncementsDelivery updateImpl(
93          com.liferay.portlet.announcements.model.AnnouncementsDelivery announcementsDelivery,
94          boolean merge) throws com.liferay.portal.SystemException {
95          return getPersistence().updateImpl(announcementsDelivery, merge);
96      }
97  
98      public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByPrimaryKey(
99          long deliveryId)
100         throws com.liferay.portal.SystemException,
101             com.liferay.portlet.announcements.NoSuchDeliveryException {
102         return getPersistence().findByPrimaryKey(deliveryId);
103     }
104 
105     public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByPrimaryKey(
106         long deliveryId) throws com.liferay.portal.SystemException {
107         return getPersistence().fetchByPrimaryKey(deliveryId);
108     }
109 
110     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId(
111         long userId) throws com.liferay.portal.SystemException {
112         return getPersistence().findByUserId(userId);
113     }
114 
115     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId(
116         long userId, int start, int end)
117         throws com.liferay.portal.SystemException {
118         return getPersistence().findByUserId(userId, start, end);
119     }
120 
121     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findByUserId(
122         long userId, int start, int end,
123         com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.SystemException {
125         return getPersistence().findByUserId(userId, start, end, obc);
126     }
127 
128     public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByUserId_First(
129         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.SystemException,
131             com.liferay.portlet.announcements.NoSuchDeliveryException {
132         return getPersistence().findByUserId_First(userId, obc);
133     }
134 
135     public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByUserId_Last(
136         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portlet.announcements.NoSuchDeliveryException {
139         return getPersistence().findByUserId_Last(userId, obc);
140     }
141 
142     public static com.liferay.portlet.announcements.model.AnnouncementsDelivery[] findByUserId_PrevAndNext(
143         long deliveryId, long userId,
144         com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.SystemException,
146             com.liferay.portlet.announcements.NoSuchDeliveryException {
147         return getPersistence().findByUserId_PrevAndNext(deliveryId, userId, obc);
148     }
149 
150     public static com.liferay.portlet.announcements.model.AnnouncementsDelivery findByU_T(
151         long userId, java.lang.String type)
152         throws com.liferay.portal.SystemException,
153             com.liferay.portlet.announcements.NoSuchDeliveryException {
154         return getPersistence().findByU_T(userId, type);
155     }
156 
157     public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByU_T(
158         long userId, java.lang.String type)
159         throws com.liferay.portal.SystemException {
160         return getPersistence().fetchByU_T(userId, type);
161     }
162 
163     public static com.liferay.portlet.announcements.model.AnnouncementsDelivery fetchByU_T(
164         long userId, java.lang.String type, boolean retrieveFromCache)
165         throws com.liferay.portal.SystemException {
166         return getPersistence().fetchByU_T(userId, type, retrieveFromCache);
167     }
168 
169     public static java.util.List<Object> findWithDynamicQuery(
170         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
171         throws com.liferay.portal.SystemException {
172         return getPersistence().findWithDynamicQuery(dynamicQuery);
173     }
174 
175     public static java.util.List<Object> findWithDynamicQuery(
176         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
177         int end) throws com.liferay.portal.SystemException {
178         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
179     }
180 
181     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll()
182         throws com.liferay.portal.SystemException {
183         return getPersistence().findAll();
184     }
185 
186     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll(
187         int start, int end) throws com.liferay.portal.SystemException {
188         return getPersistence().findAll(start, end);
189     }
190 
191     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> findAll(
192         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
193         throws com.liferay.portal.SystemException {
194         return getPersistence().findAll(start, end, obc);
195     }
196 
197     public static void removeByUserId(long userId)
198         throws com.liferay.portal.SystemException {
199         getPersistence().removeByUserId(userId);
200     }
201 
202     public static void removeByU_T(long userId, java.lang.String type)
203         throws com.liferay.portal.SystemException,
204             com.liferay.portlet.announcements.NoSuchDeliveryException {
205         getPersistence().removeByU_T(userId, type);
206     }
207 
208     public static void removeAll() throws com.liferay.portal.SystemException {
209         getPersistence().removeAll();
210     }
211 
212     public static int countByUserId(long userId)
213         throws com.liferay.portal.SystemException {
214         return getPersistence().countByUserId(userId);
215     }
216 
217     public static int countByU_T(long userId, java.lang.String type)
218         throws com.liferay.portal.SystemException {
219         return getPersistence().countByU_T(userId, type);
220     }
221 
222     public static int countAll() throws com.liferay.portal.SystemException {
223         return getPersistence().countAll();
224     }
225 
226     public static AnnouncementsDeliveryPersistence getPersistence() {
227         return _persistence;
228     }
229 
230     public void setPersistence(AnnouncementsDeliveryPersistence persistence) {
231         _persistence = persistence;
232     }
233 
234     private static AnnouncementsDeliveryPersistence _persistence;
235 }