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