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.documentlibrary.service.persistence;
21  
22  /**
23   * <a href="DLFileVersionUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class DLFileVersionUtil {
29      public static com.liferay.portlet.documentlibrary.model.DLFileVersion create(
30          long fileVersionId) {
31          return getPersistence().create(fileVersionId);
32      }
33  
34      public static com.liferay.portlet.documentlibrary.model.DLFileVersion remove(
35          long fileVersionId)
36          throws com.liferay.portal.SystemException,
37              com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
38          return getPersistence().remove(fileVersionId);
39      }
40  
41      public static com.liferay.portlet.documentlibrary.model.DLFileVersion remove(
42          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion)
43          throws com.liferay.portal.SystemException {
44          return getPersistence().remove(dlFileVersion);
45      }
46  
47      /**
48       * @deprecated Use <code>update(DLFileVersion dlFileVersion, boolean merge)</code>.
49       */
50      public static com.liferay.portlet.documentlibrary.model.DLFileVersion update(
51          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion)
52          throws com.liferay.portal.SystemException {
53          return getPersistence().update(dlFileVersion);
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        dlFileVersion 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 dlFileVersion 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.documentlibrary.model.DLFileVersion update(
70          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion,
71          boolean merge) throws com.liferay.portal.SystemException {
72          return getPersistence().update(dlFileVersion, merge);
73      }
74  
75      public static com.liferay.portlet.documentlibrary.model.DLFileVersion updateImpl(
76          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion,
77          boolean merge) throws com.liferay.portal.SystemException {
78          return getPersistence().updateImpl(dlFileVersion, merge);
79      }
80  
81      public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByPrimaryKey(
82          long fileVersionId)
83          throws com.liferay.portal.SystemException,
84              com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
85          return getPersistence().findByPrimaryKey(fileVersionId);
86      }
87  
88      public static com.liferay.portlet.documentlibrary.model.DLFileVersion fetchByPrimaryKey(
89          long fileVersionId) throws com.liferay.portal.SystemException {
90          return getPersistence().fetchByPrimaryKey(fileVersionId);
91      }
92  
93      public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
94          long folderId, java.lang.String name)
95          throws com.liferay.portal.SystemException {
96          return getPersistence().findByF_N(folderId, name);
97      }
98  
99      public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
100         long folderId, java.lang.String name, int start, int end)
101         throws com.liferay.portal.SystemException {
102         return getPersistence().findByF_N(folderId, name, start, end);
103     }
104 
105     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
106         long folderId, java.lang.String name, int start, int end,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().findByF_N(folderId, name, start, end, obc);
110     }
111 
112     public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_First(
113         long folderId, java.lang.String name,
114         com.liferay.portal.kernel.util.OrderByComparator obc)
115         throws com.liferay.portal.SystemException,
116             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
117         return getPersistence().findByF_N_First(folderId, name, obc);
118     }
119 
120     public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_Last(
121         long folderId, java.lang.String name,
122         com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.SystemException,
124             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
125         return getPersistence().findByF_N_Last(folderId, name, obc);
126     }
127 
128     public static com.liferay.portlet.documentlibrary.model.DLFileVersion[] findByF_N_PrevAndNext(
129         long fileVersionId, long folderId, java.lang.String name,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
133         return getPersistence()
134                    .findByF_N_PrevAndNext(fileVersionId, folderId, name, obc);
135     }
136 
137     public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_V(
138         long folderId, java.lang.String name, double version)
139         throws com.liferay.portal.SystemException,
140             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
141         return getPersistence().findByF_N_V(folderId, name, version);
142     }
143 
144     public static com.liferay.portlet.documentlibrary.model.DLFileVersion fetchByF_N_V(
145         long folderId, java.lang.String name, double version)
146         throws com.liferay.portal.SystemException {
147         return getPersistence().fetchByF_N_V(folderId, name, version);
148     }
149 
150     public static java.util.List<Object> findWithDynamicQuery(
151         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findWithDynamicQuery(dynamicQuery);
154     }
155 
156     public static java.util.List<Object> findWithDynamicQuery(
157         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
158         int end) throws com.liferay.portal.SystemException {
159         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
160     }
161 
162     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll()
163         throws com.liferay.portal.SystemException {
164         return getPersistence().findAll();
165     }
166 
167     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll(
168         int start, int end) throws com.liferay.portal.SystemException {
169         return getPersistence().findAll(start, end);
170     }
171 
172     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll(
173         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().findAll(start, end, obc);
176     }
177 
178     public static void removeByF_N(long folderId, java.lang.String name)
179         throws com.liferay.portal.SystemException {
180         getPersistence().removeByF_N(folderId, name);
181     }
182 
183     public static void removeByF_N_V(long folderId, java.lang.String name,
184         double version)
185         throws com.liferay.portal.SystemException,
186             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
187         getPersistence().removeByF_N_V(folderId, name, version);
188     }
189 
190     public static void removeAll() throws com.liferay.portal.SystemException {
191         getPersistence().removeAll();
192     }
193 
194     public static int countByF_N(long folderId, java.lang.String name)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().countByF_N(folderId, name);
197     }
198 
199     public static int countByF_N_V(long folderId, java.lang.String name,
200         double version) throws com.liferay.portal.SystemException {
201         return getPersistence().countByF_N_V(folderId, name, version);
202     }
203 
204     public static int countAll() throws com.liferay.portal.SystemException {
205         return getPersistence().countAll();
206     }
207 
208     public static DLFileVersionPersistence getPersistence() {
209         return _persistence;
210     }
211 
212     public void setPersistence(DLFileVersionPersistence persistence) {
213         _persistence = persistence;
214     }
215 
216     private static DLFileVersionPersistence _persistence;
217 }