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.polls.service.persistence;
21  
22  /**
23   * <a href="PollsQuestionUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class PollsQuestionUtil {
29      public static void cacheResult(
30          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion) {
31          getPersistence().cacheResult(pollsQuestion);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portlet.polls.model.PollsQuestion> pollsQuestions) {
36          getPersistence().cacheResult(pollsQuestions);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portlet.polls.model.PollsQuestion create(
44          long questionId) {
45          return getPersistence().create(questionId);
46      }
47  
48      public static com.liferay.portlet.polls.model.PollsQuestion remove(
49          long questionId)
50          throws com.liferay.portal.SystemException,
51              com.liferay.portlet.polls.NoSuchQuestionException {
52          return getPersistence().remove(questionId);
53      }
54  
55      public static com.liferay.portlet.polls.model.PollsQuestion remove(
56          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(pollsQuestion);
59      }
60  
61      /**
62       * @deprecated Use <code>update(PollsQuestion pollsQuestion, boolean merge)</code>.
63       */
64      public static com.liferay.portlet.polls.model.PollsQuestion update(
65          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(pollsQuestion);
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        pollsQuestion 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 pollsQuestion 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.polls.model.PollsQuestion update(
84          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion,
85          boolean merge) throws com.liferay.portal.SystemException {
86          return getPersistence().update(pollsQuestion, merge);
87      }
88  
89      public static com.liferay.portlet.polls.model.PollsQuestion updateImpl(
90          com.liferay.portlet.polls.model.PollsQuestion pollsQuestion,
91          boolean merge) throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(pollsQuestion, merge);
93      }
94  
95      public static com.liferay.portlet.polls.model.PollsQuestion findByPrimaryKey(
96          long questionId)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portlet.polls.NoSuchQuestionException {
99          return getPersistence().findByPrimaryKey(questionId);
100     }
101 
102     public static com.liferay.portlet.polls.model.PollsQuestion fetchByPrimaryKey(
103         long questionId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(questionId);
105     }
106 
107     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> findByUuid(
108         java.lang.String uuid) throws com.liferay.portal.SystemException {
109         return getPersistence().findByUuid(uuid);
110     }
111 
112     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> findByUuid(
113         java.lang.String uuid, int start, int end)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().findByUuid(uuid, start, end);
116     }
117 
118     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> findByUuid(
119         java.lang.String uuid, int start, int end,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByUuid(uuid, start, end, obc);
123     }
124 
125     public static com.liferay.portlet.polls.model.PollsQuestion findByUuid_First(
126         java.lang.String uuid,
127         com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.SystemException,
129             com.liferay.portlet.polls.NoSuchQuestionException {
130         return getPersistence().findByUuid_First(uuid, obc);
131     }
132 
133     public static com.liferay.portlet.polls.model.PollsQuestion findByUuid_Last(
134         java.lang.String uuid,
135         com.liferay.portal.kernel.util.OrderByComparator obc)
136         throws com.liferay.portal.SystemException,
137             com.liferay.portlet.polls.NoSuchQuestionException {
138         return getPersistence().findByUuid_Last(uuid, obc);
139     }
140 
141     public static com.liferay.portlet.polls.model.PollsQuestion[] findByUuid_PrevAndNext(
142         long questionId, java.lang.String uuid,
143         com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.SystemException,
145             com.liferay.portlet.polls.NoSuchQuestionException {
146         return getPersistence().findByUuid_PrevAndNext(questionId, uuid, obc);
147     }
148 
149     public static com.liferay.portlet.polls.model.PollsQuestion findByUUID_G(
150         java.lang.String uuid, long groupId)
151         throws com.liferay.portal.SystemException,
152             com.liferay.portlet.polls.NoSuchQuestionException {
153         return getPersistence().findByUUID_G(uuid, groupId);
154     }
155 
156     public static com.liferay.portlet.polls.model.PollsQuestion fetchByUUID_G(
157         java.lang.String uuid, long groupId)
158         throws com.liferay.portal.SystemException {
159         return getPersistence().fetchByUUID_G(uuid, groupId);
160     }
161 
162     public static com.liferay.portlet.polls.model.PollsQuestion fetchByUUID_G(
163         java.lang.String uuid, long groupId, boolean retrieveFromCache)
164         throws com.liferay.portal.SystemException {
165         return getPersistence().fetchByUUID_G(uuid, groupId, retrieveFromCache);
166     }
167 
168     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> findByGroupId(
169         long groupId) throws com.liferay.portal.SystemException {
170         return getPersistence().findByGroupId(groupId);
171     }
172 
173     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> findByGroupId(
174         long groupId, int start, int end)
175         throws com.liferay.portal.SystemException {
176         return getPersistence().findByGroupId(groupId, start, end);
177     }
178 
179     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> findByGroupId(
180         long groupId, int start, int end,
181         com.liferay.portal.kernel.util.OrderByComparator obc)
182         throws com.liferay.portal.SystemException {
183         return getPersistence().findByGroupId(groupId, start, end, obc);
184     }
185 
186     public static com.liferay.portlet.polls.model.PollsQuestion findByGroupId_First(
187         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
188         throws com.liferay.portal.SystemException,
189             com.liferay.portlet.polls.NoSuchQuestionException {
190         return getPersistence().findByGroupId_First(groupId, obc);
191     }
192 
193     public static com.liferay.portlet.polls.model.PollsQuestion findByGroupId_Last(
194         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
195         throws com.liferay.portal.SystemException,
196             com.liferay.portlet.polls.NoSuchQuestionException {
197         return getPersistence().findByGroupId_Last(groupId, obc);
198     }
199 
200     public static com.liferay.portlet.polls.model.PollsQuestion[] findByGroupId_PrevAndNext(
201         long questionId, long groupId,
202         com.liferay.portal.kernel.util.OrderByComparator obc)
203         throws com.liferay.portal.SystemException,
204             com.liferay.portlet.polls.NoSuchQuestionException {
205         return getPersistence()
206                    .findByGroupId_PrevAndNext(questionId, groupId, obc);
207     }
208 
209     public static java.util.List<Object> findWithDynamicQuery(
210         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
211         throws com.liferay.portal.SystemException {
212         return getPersistence().findWithDynamicQuery(dynamicQuery);
213     }
214 
215     public static java.util.List<Object> findWithDynamicQuery(
216         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
217         int end) throws com.liferay.portal.SystemException {
218         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
219     }
220 
221     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> findAll()
222         throws com.liferay.portal.SystemException {
223         return getPersistence().findAll();
224     }
225 
226     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> findAll(
227         int start, int end) throws com.liferay.portal.SystemException {
228         return getPersistence().findAll(start, end);
229     }
230 
231     public static java.util.List<com.liferay.portlet.polls.model.PollsQuestion> findAll(
232         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
233         throws com.liferay.portal.SystemException {
234         return getPersistence().findAll(start, end, obc);
235     }
236 
237     public static void removeByUuid(java.lang.String uuid)
238         throws com.liferay.portal.SystemException {
239         getPersistence().removeByUuid(uuid);
240     }
241 
242     public static void removeByUUID_G(java.lang.String uuid, long groupId)
243         throws com.liferay.portal.SystemException,
244             com.liferay.portlet.polls.NoSuchQuestionException {
245         getPersistence().removeByUUID_G(uuid, groupId);
246     }
247 
248     public static void removeByGroupId(long groupId)
249         throws com.liferay.portal.SystemException {
250         getPersistence().removeByGroupId(groupId);
251     }
252 
253     public static void removeAll() throws com.liferay.portal.SystemException {
254         getPersistence().removeAll();
255     }
256 
257     public static int countByUuid(java.lang.String uuid)
258         throws com.liferay.portal.SystemException {
259         return getPersistence().countByUuid(uuid);
260     }
261 
262     public static int countByUUID_G(java.lang.String uuid, long groupId)
263         throws com.liferay.portal.SystemException {
264         return getPersistence().countByUUID_G(uuid, groupId);
265     }
266 
267     public static int countByGroupId(long groupId)
268         throws com.liferay.portal.SystemException {
269         return getPersistence().countByGroupId(groupId);
270     }
271 
272     public static int countAll() throws com.liferay.portal.SystemException {
273         return getPersistence().countAll();
274     }
275 
276     public static PollsQuestionPersistence getPersistence() {
277         return _persistence;
278     }
279 
280     public void setPersistence(PollsQuestionPersistence persistence) {
281         _persistence = persistence;
282     }
283 
284     private static PollsQuestionPersistence _persistence;
285 }