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.documentlibrary.service.persistence;
24  
25  /**
26   * <a href="DLFileRankUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class DLFileRankUtil {
32      public static void cacheResult(
33          com.liferay.portlet.documentlibrary.model.DLFileRank dlFileRank) {
34          getPersistence().cacheResult(dlFileRank);
35      }
36  
37      public static void cacheResult(
38          java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> dlFileRanks) {
39          getPersistence().cacheResult(dlFileRanks);
40      }
41  
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      public static com.liferay.portlet.documentlibrary.model.DLFileRank create(
47          long fileRankId) {
48          return getPersistence().create(fileRankId);
49      }
50  
51      public static com.liferay.portlet.documentlibrary.model.DLFileRank remove(
52          long fileRankId)
53          throws com.liferay.portal.SystemException,
54              com.liferay.portlet.documentlibrary.NoSuchFileRankException {
55          return getPersistence().remove(fileRankId);
56      }
57  
58      public static com.liferay.portlet.documentlibrary.model.DLFileRank remove(
59          com.liferay.portlet.documentlibrary.model.DLFileRank dlFileRank)
60          throws com.liferay.portal.SystemException {
61          return getPersistence().remove(dlFileRank);
62      }
63  
64      /**
65       * @deprecated Use <code>update(DLFileRank dlFileRank, boolean merge)</code>.
66       */
67      public static com.liferay.portlet.documentlibrary.model.DLFileRank update(
68          com.liferay.portlet.documentlibrary.model.DLFileRank dlFileRank)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(dlFileRank);
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        dlFileRank 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 dlFileRank 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.documentlibrary.model.DLFileRank update(
87          com.liferay.portlet.documentlibrary.model.DLFileRank dlFileRank,
88          boolean merge) throws com.liferay.portal.SystemException {
89          return getPersistence().update(dlFileRank, merge);
90      }
91  
92      public static com.liferay.portlet.documentlibrary.model.DLFileRank updateImpl(
93          com.liferay.portlet.documentlibrary.model.DLFileRank dlFileRank,
94          boolean merge) throws com.liferay.portal.SystemException {
95          return getPersistence().updateImpl(dlFileRank, merge);
96      }
97  
98      public static com.liferay.portlet.documentlibrary.model.DLFileRank findByPrimaryKey(
99          long fileRankId)
100         throws com.liferay.portal.SystemException,
101             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
102         return getPersistence().findByPrimaryKey(fileRankId);
103     }
104 
105     public static com.liferay.portlet.documentlibrary.model.DLFileRank fetchByPrimaryKey(
106         long fileRankId) throws com.liferay.portal.SystemException {
107         return getPersistence().fetchByPrimaryKey(fileRankId);
108     }
109 
110     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> 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.documentlibrary.model.DLFileRank> 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.documentlibrary.model.DLFileRank> 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.documentlibrary.model.DLFileRank findByUserId_First(
129         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.SystemException,
131             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
132         return getPersistence().findByUserId_First(userId, obc);
133     }
134 
135     public static com.liferay.portlet.documentlibrary.model.DLFileRank findByUserId_Last(
136         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
139         return getPersistence().findByUserId_Last(userId, obc);
140     }
141 
142     public static com.liferay.portlet.documentlibrary.model.DLFileRank[] findByUserId_PrevAndNext(
143         long fileRankId, long userId,
144         com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.SystemException,
146             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
147         return getPersistence().findByUserId_PrevAndNext(fileRankId, userId, obc);
148     }
149 
150     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> findByG_U(
151         long groupId, long userId) throws com.liferay.portal.SystemException {
152         return getPersistence().findByG_U(groupId, userId);
153     }
154 
155     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> findByG_U(
156         long groupId, long userId, int start, int end)
157         throws com.liferay.portal.SystemException {
158         return getPersistence().findByG_U(groupId, userId, start, end);
159     }
160 
161     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> findByG_U(
162         long groupId, long userId, int start, int end,
163         com.liferay.portal.kernel.util.OrderByComparator obc)
164         throws com.liferay.portal.SystemException {
165         return getPersistence().findByG_U(groupId, userId, start, end, obc);
166     }
167 
168     public static com.liferay.portlet.documentlibrary.model.DLFileRank findByG_U_First(
169         long groupId, long userId,
170         com.liferay.portal.kernel.util.OrderByComparator obc)
171         throws com.liferay.portal.SystemException,
172             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
173         return getPersistence().findByG_U_First(groupId, userId, obc);
174     }
175 
176     public static com.liferay.portlet.documentlibrary.model.DLFileRank findByG_U_Last(
177         long groupId, long userId,
178         com.liferay.portal.kernel.util.OrderByComparator obc)
179         throws com.liferay.portal.SystemException,
180             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
181         return getPersistence().findByG_U_Last(groupId, userId, obc);
182     }
183 
184     public static com.liferay.portlet.documentlibrary.model.DLFileRank[] findByG_U_PrevAndNext(
185         long fileRankId, long groupId, long userId,
186         com.liferay.portal.kernel.util.OrderByComparator obc)
187         throws com.liferay.portal.SystemException,
188             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
189         return getPersistence()
190                    .findByG_U_PrevAndNext(fileRankId, groupId, userId, obc);
191     }
192 
193     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> findByF_N(
194         long folderId, java.lang.String name)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().findByF_N(folderId, name);
197     }
198 
199     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> findByF_N(
200         long folderId, java.lang.String name, int start, int end)
201         throws com.liferay.portal.SystemException {
202         return getPersistence().findByF_N(folderId, name, start, end);
203     }
204 
205     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> findByF_N(
206         long folderId, java.lang.String name, int start, int end,
207         com.liferay.portal.kernel.util.OrderByComparator obc)
208         throws com.liferay.portal.SystemException {
209         return getPersistence().findByF_N(folderId, name, start, end, obc);
210     }
211 
212     public static com.liferay.portlet.documentlibrary.model.DLFileRank findByF_N_First(
213         long folderId, java.lang.String name,
214         com.liferay.portal.kernel.util.OrderByComparator obc)
215         throws com.liferay.portal.SystemException,
216             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
217         return getPersistence().findByF_N_First(folderId, name, obc);
218     }
219 
220     public static com.liferay.portlet.documentlibrary.model.DLFileRank findByF_N_Last(
221         long folderId, java.lang.String name,
222         com.liferay.portal.kernel.util.OrderByComparator obc)
223         throws com.liferay.portal.SystemException,
224             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
225         return getPersistence().findByF_N_Last(folderId, name, obc);
226     }
227 
228     public static com.liferay.portlet.documentlibrary.model.DLFileRank[] findByF_N_PrevAndNext(
229         long fileRankId, long folderId, java.lang.String name,
230         com.liferay.portal.kernel.util.OrderByComparator obc)
231         throws com.liferay.portal.SystemException,
232             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
233         return getPersistence()
234                    .findByF_N_PrevAndNext(fileRankId, folderId, name, obc);
235     }
236 
237     public static com.liferay.portlet.documentlibrary.model.DLFileRank findByC_U_F_N(
238         long companyId, long userId, long folderId, java.lang.String name)
239         throws com.liferay.portal.SystemException,
240             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
241         return getPersistence().findByC_U_F_N(companyId, userId, folderId, name);
242     }
243 
244     public static com.liferay.portlet.documentlibrary.model.DLFileRank fetchByC_U_F_N(
245         long companyId, long userId, long folderId, java.lang.String name)
246         throws com.liferay.portal.SystemException {
247         return getPersistence().fetchByC_U_F_N(companyId, userId, folderId, name);
248     }
249 
250     public static com.liferay.portlet.documentlibrary.model.DLFileRank fetchByC_U_F_N(
251         long companyId, long userId, long folderId, java.lang.String name,
252         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
253         return getPersistence()
254                    .fetchByC_U_F_N(companyId, userId, folderId, name,
255             retrieveFromCache);
256     }
257 
258     public static java.util.List<Object> findWithDynamicQuery(
259         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
260         throws com.liferay.portal.SystemException {
261         return getPersistence().findWithDynamicQuery(dynamicQuery);
262     }
263 
264     public static java.util.List<Object> findWithDynamicQuery(
265         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
266         int end) throws com.liferay.portal.SystemException {
267         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
268     }
269 
270     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> findAll()
271         throws com.liferay.portal.SystemException {
272         return getPersistence().findAll();
273     }
274 
275     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> findAll(
276         int start, int end) throws com.liferay.portal.SystemException {
277         return getPersistence().findAll(start, end);
278     }
279 
280     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> findAll(
281         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
282         throws com.liferay.portal.SystemException {
283         return getPersistence().findAll(start, end, obc);
284     }
285 
286     public static void removeByUserId(long userId)
287         throws com.liferay.portal.SystemException {
288         getPersistence().removeByUserId(userId);
289     }
290 
291     public static void removeByG_U(long groupId, long userId)
292         throws com.liferay.portal.SystemException {
293         getPersistence().removeByG_U(groupId, userId);
294     }
295 
296     public static void removeByF_N(long folderId, java.lang.String name)
297         throws com.liferay.portal.SystemException {
298         getPersistence().removeByF_N(folderId, name);
299     }
300 
301     public static void removeByC_U_F_N(long companyId, long userId,
302         long folderId, java.lang.String name)
303         throws com.liferay.portal.SystemException,
304             com.liferay.portlet.documentlibrary.NoSuchFileRankException {
305         getPersistence().removeByC_U_F_N(companyId, userId, folderId, name);
306     }
307 
308     public static void removeAll() throws com.liferay.portal.SystemException {
309         getPersistence().removeAll();
310     }
311 
312     public static int countByUserId(long userId)
313         throws com.liferay.portal.SystemException {
314         return getPersistence().countByUserId(userId);
315     }
316 
317     public static int countByG_U(long groupId, long userId)
318         throws com.liferay.portal.SystemException {
319         return getPersistence().countByG_U(groupId, userId);
320     }
321 
322     public static int countByF_N(long folderId, java.lang.String name)
323         throws com.liferay.portal.SystemException {
324         return getPersistence().countByF_N(folderId, name);
325     }
326 
327     public static int countByC_U_F_N(long companyId, long userId,
328         long folderId, java.lang.String name)
329         throws com.liferay.portal.SystemException {
330         return getPersistence().countByC_U_F_N(companyId, userId, folderId, name);
331     }
332 
333     public static int countAll() throws com.liferay.portal.SystemException {
334         return getPersistence().countAll();
335     }
336 
337     public static DLFileRankPersistence getPersistence() {
338         return _persistence;
339     }
340 
341     public void setPersistence(DLFileRankPersistence persistence) {
342         _persistence = persistence;
343     }
344 
345     private static DLFileRankPersistence _persistence;
346 }