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 com.liferay.portlet.announcements.model.AnnouncementsFlag create(
30          long flagId) {
31          return getPersistence().create(flagId);
32      }
33  
34      public static com.liferay.portlet.announcements.model.AnnouncementsFlag remove(
35          long flagId)
36          throws com.liferay.portal.SystemException,
37              com.liferay.portlet.announcements.NoSuchFlagException {
38          return getPersistence().remove(flagId);
39      }
40  
41      public static com.liferay.portlet.announcements.model.AnnouncementsFlag remove(
42          com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag)
43          throws com.liferay.portal.SystemException {
44          return getPersistence().remove(announcementsFlag);
45      }
46  
47      /**
48       * @deprecated Use <code>update(AnnouncementsFlag announcementsFlag, boolean merge)</code>.
49       */
50      public static com.liferay.portlet.announcements.model.AnnouncementsFlag update(
51          com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag)
52          throws com.liferay.portal.SystemException {
53          return getPersistence().update(announcementsFlag);
54      }
55  
56      /**
57       * Add, update, or merge, the entity. This method also calls the model
58       * listeners to trigger the proper events associated with adding, deleting,
59       * or updating an entity.
60       *
61       * @param        announcementsFlag the entity to add, update, or merge
62       * @param        merge boolean value for whether to merge the entity. The
63       *                default value is false. Setting merge to true is more
64       *                expensive and should only be true when announcementsFlag is
65       *                transient. See LEP-5473 for a detailed discussion of this
66       *                method.
67       * @return        true if the portlet can be displayed via Ajax
68       */
69      public static com.liferay.portlet.announcements.model.AnnouncementsFlag update(
70          com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag,
71          boolean merge) throws com.liferay.portal.SystemException {
72          return getPersistence().update(announcementsFlag, merge);
73      }
74  
75      public static com.liferay.portlet.announcements.model.AnnouncementsFlag updateImpl(
76          com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag,
77          boolean merge) throws com.liferay.portal.SystemException {
78          return getPersistence().updateImpl(announcementsFlag, merge);
79      }
80  
81      public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByPrimaryKey(
82          long flagId)
83          throws com.liferay.portal.SystemException,
84              com.liferay.portlet.announcements.NoSuchFlagException {
85          return getPersistence().findByPrimaryKey(flagId);
86      }
87  
88      public static com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByPrimaryKey(
89          long flagId) throws com.liferay.portal.SystemException {
90          return getPersistence().fetchByPrimaryKey(flagId);
91      }
92  
93      public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId(
94          long entryId) throws com.liferay.portal.SystemException {
95          return getPersistence().findByEntryId(entryId);
96      }
97  
98      public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId(
99          long entryId, int start, int end)
100         throws com.liferay.portal.SystemException {
101         return getPersistence().findByEntryId(entryId, start, end);
102     }
103 
104     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId(
105         long entryId, int start, int end,
106         com.liferay.portal.kernel.util.OrderByComparator obc)
107         throws com.liferay.portal.SystemException {
108         return getPersistence().findByEntryId(entryId, start, end, obc);
109     }
110 
111     public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByEntryId_First(
112         long entryId, com.liferay.portal.kernel.util.OrderByComparator obc)
113         throws com.liferay.portal.SystemException,
114             com.liferay.portlet.announcements.NoSuchFlagException {
115         return getPersistence().findByEntryId_First(entryId, obc);
116     }
117 
118     public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByEntryId_Last(
119         long entryId, com.liferay.portal.kernel.util.OrderByComparator obc)
120         throws com.liferay.portal.SystemException,
121             com.liferay.portlet.announcements.NoSuchFlagException {
122         return getPersistence().findByEntryId_Last(entryId, obc);
123     }
124 
125     public static com.liferay.portlet.announcements.model.AnnouncementsFlag[] findByEntryId_PrevAndNext(
126         long flagId, long entryId,
127         com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.SystemException,
129             com.liferay.portlet.announcements.NoSuchFlagException {
130         return getPersistence().findByEntryId_PrevAndNext(flagId, entryId, obc);
131     }
132 
133     public static com.liferay.portlet.announcements.model.AnnouncementsFlag findByU_E_V(
134         long userId, long entryId, int value)
135         throws com.liferay.portal.SystemException,
136             com.liferay.portlet.announcements.NoSuchFlagException {
137         return getPersistence().findByU_E_V(userId, entryId, value);
138     }
139 
140     public static com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V(
141         long userId, long entryId, int value)
142         throws com.liferay.portal.SystemException {
143         return getPersistence().fetchByU_E_V(userId, entryId, value);
144     }
145 
146     public static java.util.List<Object> findWithDynamicQuery(
147         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
148         throws com.liferay.portal.SystemException {
149         return getPersistence().findWithDynamicQuery(dynamicQuery);
150     }
151 
152     public static java.util.List<Object> findWithDynamicQuery(
153         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
154         int end) throws com.liferay.portal.SystemException {
155         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
156     }
157 
158     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll()
159         throws com.liferay.portal.SystemException {
160         return getPersistence().findAll();
161     }
162 
163     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll(
164         int start, int end) throws com.liferay.portal.SystemException {
165         return getPersistence().findAll(start, end);
166     }
167 
168     public static java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll(
169         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.SystemException {
171         return getPersistence().findAll(start, end, obc);
172     }
173 
174     public static void removeByEntryId(long entryId)
175         throws com.liferay.portal.SystemException {
176         getPersistence().removeByEntryId(entryId);
177     }
178 
179     public static void removeByU_E_V(long userId, long entryId, int value)
180         throws com.liferay.portal.SystemException,
181             com.liferay.portlet.announcements.NoSuchFlagException {
182         getPersistence().removeByU_E_V(userId, entryId, value);
183     }
184 
185     public static void removeAll() throws com.liferay.portal.SystemException {
186         getPersistence().removeAll();
187     }
188 
189     public static int countByEntryId(long entryId)
190         throws com.liferay.portal.SystemException {
191         return getPersistence().countByEntryId(entryId);
192     }
193 
194     public static int countByU_E_V(long userId, long entryId, int value)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().countByU_E_V(userId, entryId, value);
197     }
198 
199     public static int countAll() throws com.liferay.portal.SystemException {
200         return getPersistence().countAll();
201     }
202 
203     public static AnnouncementsFlagPersistence getPersistence() {
204         return _persistence;
205     }
206 
207     public void setPersistence(AnnouncementsFlagPersistence persistence) {
208         _persistence = persistence;
209     }
210 
211     private static AnnouncementsFlagPersistence _persistence;
212 }