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 void cacheResult(
30          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion) {
31          getPersistence().cacheResult(dlFileVersion);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> dlFileVersions) {
36          getPersistence().cacheResult(dlFileVersions);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portlet.documentlibrary.model.DLFileVersion create(
44          long fileVersionId) {
45          return getPersistence().create(fileVersionId);
46      }
47  
48      public static com.liferay.portlet.documentlibrary.model.DLFileVersion remove(
49          long fileVersionId)
50          throws com.liferay.portal.SystemException,
51              com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
52          return getPersistence().remove(fileVersionId);
53      }
54  
55      public static com.liferay.portlet.documentlibrary.model.DLFileVersion remove(
56          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(dlFileVersion);
59      }
60  
61      /**
62       * @deprecated Use <code>update(DLFileVersion dlFileVersion, boolean merge)</code>.
63       */
64      public static com.liferay.portlet.documentlibrary.model.DLFileVersion update(
65          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(dlFileVersion);
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        dlFileVersion 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 dlFileVersion 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.documentlibrary.model.DLFileVersion update(
84          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion,
85          boolean merge) throws com.liferay.portal.SystemException {
86          return getPersistence().update(dlFileVersion, merge);
87      }
88  
89      public static com.liferay.portlet.documentlibrary.model.DLFileVersion updateImpl(
90          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion,
91          boolean merge) throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(dlFileVersion, merge);
93      }
94  
95      public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByPrimaryKey(
96          long fileVersionId)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
99          return getPersistence().findByPrimaryKey(fileVersionId);
100     }
101 
102     public static com.liferay.portlet.documentlibrary.model.DLFileVersion fetchByPrimaryKey(
103         long fileVersionId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(fileVersionId);
105     }
106 
107     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
108         long folderId, java.lang.String name)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().findByF_N(folderId, name);
111     }
112 
113     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
114         long folderId, java.lang.String name, int start, int end)
115         throws com.liferay.portal.SystemException {
116         return getPersistence().findByF_N(folderId, name, start, end);
117     }
118 
119     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
120         long folderId, java.lang.String name, int start, int end,
121         com.liferay.portal.kernel.util.OrderByComparator obc)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().findByF_N(folderId, name, start, end, obc);
124     }
125 
126     public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_First(
127         long folderId, java.lang.String name,
128         com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.SystemException,
130             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
131         return getPersistence().findByF_N_First(folderId, name, obc);
132     }
133 
134     public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_Last(
135         long folderId, java.lang.String name,
136         com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
139         return getPersistence().findByF_N_Last(folderId, name, obc);
140     }
141 
142     public static com.liferay.portlet.documentlibrary.model.DLFileVersion[] findByF_N_PrevAndNext(
143         long fileVersionId, long folderId, java.lang.String name,
144         com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.SystemException,
146             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
147         return getPersistence()
148                    .findByF_N_PrevAndNext(fileVersionId, folderId, name, obc);
149     }
150 
151     public static com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_V(
152         long folderId, java.lang.String name, double version)
153         throws com.liferay.portal.SystemException,
154             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
155         return getPersistence().findByF_N_V(folderId, name, version);
156     }
157 
158     public static com.liferay.portlet.documentlibrary.model.DLFileVersion fetchByF_N_V(
159         long folderId, java.lang.String name, double version)
160         throws com.liferay.portal.SystemException {
161         return getPersistence().fetchByF_N_V(folderId, name, version);
162     }
163 
164     public static com.liferay.portlet.documentlibrary.model.DLFileVersion fetchByF_N_V(
165         long folderId, java.lang.String name, double version,
166         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
167         return getPersistence()
168                    .fetchByF_N_V(folderId, name, version, retrieveFromCache);
169     }
170 
171     public static java.util.List<Object> findWithDynamicQuery(
172         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
173         throws com.liferay.portal.SystemException {
174         return getPersistence().findWithDynamicQuery(dynamicQuery);
175     }
176 
177     public static java.util.List<Object> findWithDynamicQuery(
178         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
179         int end) throws com.liferay.portal.SystemException {
180         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
181     }
182 
183     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll()
184         throws com.liferay.portal.SystemException {
185         return getPersistence().findAll();
186     }
187 
188     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll(
189         int start, int end) throws com.liferay.portal.SystemException {
190         return getPersistence().findAll(start, end);
191     }
192 
193     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll(
194         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().findAll(start, end, obc);
197     }
198 
199     public static void removeByF_N(long folderId, java.lang.String name)
200         throws com.liferay.portal.SystemException {
201         getPersistence().removeByF_N(folderId, name);
202     }
203 
204     public static void removeByF_N_V(long folderId, java.lang.String name,
205         double version)
206         throws com.liferay.portal.SystemException,
207             com.liferay.portlet.documentlibrary.NoSuchFileVersionException {
208         getPersistence().removeByF_N_V(folderId, name, version);
209     }
210 
211     public static void removeAll() throws com.liferay.portal.SystemException {
212         getPersistence().removeAll();
213     }
214 
215     public static int countByF_N(long folderId, java.lang.String name)
216         throws com.liferay.portal.SystemException {
217         return getPersistence().countByF_N(folderId, name);
218     }
219 
220     public static int countByF_N_V(long folderId, java.lang.String name,
221         double version) throws com.liferay.portal.SystemException {
222         return getPersistence().countByF_N_V(folderId, name, version);
223     }
224 
225     public static int countAll() throws com.liferay.portal.SystemException {
226         return getPersistence().countAll();
227     }
228 
229     public static DLFileVersionPersistence getPersistence() {
230         return _persistence;
231     }
232 
233     public void setPersistence(DLFileVersionPersistence persistence) {
234         _persistence = persistence;
235     }
236 
237     private static DLFileVersionPersistence _persistence;
238 }