1   /**
2    * Copyright (c) 2000-2008 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="DLFileVersionUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class DLFileVersionUtil {
32      public static com.liferay.portlet.documentlibrary.model.DLFileVersion create(
33          long fileVersionId) {
34          return getPersistence().create(fileVersionId);
35      }
36  
37      public static com.liferay.portlet.documentlibrary.model.DLFileVersion remove(
38          long fileVersionId)
39          throws com.liferay.portlet.documentlibrary.NoSuchFileVersionException,
40              com.liferay.portal.SystemException {
41          return getPersistence().remove(fileVersionId);
42      }
43  
44      public static com.liferay.portlet.documentlibrary.model.DLFileVersion remove(
45          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(dlFileVersion);
48      }
49  
50      /**
51       * @deprecated Use <code>update(DLFileVersion dlFileVersion, boolean merge)</code>.
52       */
53      public static com.liferay.portlet.documentlibrary.model.DLFileVersion update(
54          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(dlFileVersion);
57      }
58  
59      /**
60       * Add, update, or merge, the entity. This method also calls the model
61       * listeners to trigger the proper events associated with adding, deleting,
62       * or updating an entity.
63       *
64       * @param        dlFileVersion the entity to add, update, or merge
65       * @param        merge boolean value for whether to merge the entity. The
66       *                default value is false. Setting merge to true is more
67       *                expensive and should only be true when dlFileVersion is
68       *                transient. See LEP-5473 for a detailed discussion of this
69       *                method.
70       * @return        true if the portlet can be displayed via Ajax
71       */
72      public static com.liferay.portlet.documentlibrary.model.DLFileVersion update(
73          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion,
74          boolean merge) throws com.liferay.portal.SystemException {
75          return getPersistence().update(dlFileVersion, merge);
76      }
77  
78      public static com.liferay.portlet.documentlibrary.model.DLFileVersion updateImpl(
79          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion,
80          boolean merge) throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(dlFileVersion, merge);
82      }
83  
84      public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByPrimaryKey(
85          long fileVersionId)
86          throws com.liferay.portlet.documentlibrary.NoSuchFileVersionException,
87              com.liferay.portal.SystemException {
88          return getPersistence().findByPrimaryKey(fileVersionId);
89      }
90  
91      public static com.liferay.portlet.documentlibrary.model.DLFileVersion fetchByPrimaryKey(
92          long fileVersionId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(fileVersionId);
94      }
95  
96      public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
97          long folderId, java.lang.String name)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().findByF_N(folderId, name);
100     }
101 
102     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
103         long folderId, java.lang.String name, int begin, int end)
104         throws com.liferay.portal.SystemException {
105         return getPersistence().findByF_N(folderId, name, begin, end);
106     }
107 
108     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
109         long folderId, java.lang.String name, int begin, int end,
110         com.liferay.portal.kernel.util.OrderByComparator obc)
111         throws com.liferay.portal.SystemException {
112         return getPersistence().findByF_N(folderId, name, begin, end, obc);
113     }
114 
115     public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_First(
116         long folderId, java.lang.String name,
117         com.liferay.portal.kernel.util.OrderByComparator obc)
118         throws com.liferay.portlet.documentlibrary.NoSuchFileVersionException,
119             com.liferay.portal.SystemException {
120         return getPersistence().findByF_N_First(folderId, name, obc);
121     }
122 
123     public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_Last(
124         long folderId, java.lang.String name,
125         com.liferay.portal.kernel.util.OrderByComparator obc)
126         throws com.liferay.portlet.documentlibrary.NoSuchFileVersionException,
127             com.liferay.portal.SystemException {
128         return getPersistence().findByF_N_Last(folderId, name, obc);
129     }
130 
131     public static com.liferay.portlet.documentlibrary.model.DLFileVersion[] findByF_N_PrevAndNext(
132         long fileVersionId, long folderId, java.lang.String name,
133         com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portlet.documentlibrary.NoSuchFileVersionException,
135             com.liferay.portal.SystemException {
136         return getPersistence()
137                    .findByF_N_PrevAndNext(fileVersionId, folderId, name, obc);
138     }
139 
140     public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_V(
141         long folderId, java.lang.String name, double version)
142         throws com.liferay.portlet.documentlibrary.NoSuchFileVersionException,
143             com.liferay.portal.SystemException {
144         return getPersistence().findByF_N_V(folderId, name, version);
145     }
146 
147     public static com.liferay.portlet.documentlibrary.model.DLFileVersion fetchByF_N_V(
148         long folderId, java.lang.String name, double version)
149         throws com.liferay.portal.SystemException {
150         return getPersistence().fetchByF_N_V(folderId, name, version);
151     }
152 
153     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findWithDynamicQuery(
154         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
155         throws com.liferay.portal.SystemException {
156         return getPersistence().findWithDynamicQuery(queryInitializer);
157     }
158 
159     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findWithDynamicQuery(
160         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
161         int begin, int end) throws com.liferay.portal.SystemException {
162         return getPersistence()
163                    .findWithDynamicQuery(queryInitializer, begin, end);
164     }
165 
166     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll()
167         throws com.liferay.portal.SystemException {
168         return getPersistence().findAll();
169     }
170 
171     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll(
172         int begin, int end) throws com.liferay.portal.SystemException {
173         return getPersistence().findAll(begin, end);
174     }
175 
176     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll(
177         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
178         throws com.liferay.portal.SystemException {
179         return getPersistence().findAll(begin, end, obc);
180     }
181 
182     public static void removeByF_N(long folderId, java.lang.String name)
183         throws com.liferay.portal.SystemException {
184         getPersistence().removeByF_N(folderId, name);
185     }
186 
187     public static void removeByF_N_V(long folderId, java.lang.String name,
188         double version)
189         throws com.liferay.portlet.documentlibrary.NoSuchFileVersionException,
190             com.liferay.portal.SystemException {
191         getPersistence().removeByF_N_V(folderId, name, version);
192     }
193 
194     public static void removeAll() throws com.liferay.portal.SystemException {
195         getPersistence().removeAll();
196     }
197 
198     public static int countByF_N(long folderId, java.lang.String name)
199         throws com.liferay.portal.SystemException {
200         return getPersistence().countByF_N(folderId, name);
201     }
202 
203     public static int countByF_N_V(long folderId, java.lang.String name,
204         double version) throws com.liferay.portal.SystemException {
205         return getPersistence().countByF_N_V(folderId, name, version);
206     }
207 
208     public static int countAll() throws com.liferay.portal.SystemException {
209         return getPersistence().countAll();
210     }
211 
212     public static DLFileVersionPersistence getPersistence() {
213         return _getUtil()._persistence;
214     }
215 
216     public void setPersistence(DLFileVersionPersistence persistence) {
217         _persistence = persistence;
218     }
219 
220     private static DLFileVersionUtil _getUtil() {
221         if (_util == null) {
222             _util = (DLFileVersionUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
223         }
224 
225         return _util;
226     }
227 
228     private static final String _UTIL = DLFileVersionUtil.class.getName();
229     private static DLFileVersionUtil _util;
230     private DLFileVersionPersistence _persistence;
231 }