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