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="DLFileVersionPersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface DLFileVersionPersistence {
32      public com.liferay.portlet.documentlibrary.model.DLFileVersion create(
33          long fileVersionId);
34  
35      public com.liferay.portlet.documentlibrary.model.DLFileVersion remove(
36          long fileVersionId)
37          throws com.liferay.portal.SystemException,
38              com.liferay.portlet.documentlibrary.NoSuchFileVersionException;
39  
40      public com.liferay.portlet.documentlibrary.model.DLFileVersion remove(
41          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion)
42          throws com.liferay.portal.SystemException;
43  
44      /**
45       * @deprecated Use <code>update(DLFileVersion dlFileVersion, boolean merge)</code>.
46       */
47      public com.liferay.portlet.documentlibrary.model.DLFileVersion update(
48          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion)
49          throws com.liferay.portal.SystemException;
50  
51      /**
52       * Add, update, or merge, the entity. This method also calls the model
53       * listeners to trigger the proper events associated with adding, deleting,
54       * or updating an entity.
55       *
56       * @param        dlFileVersion the entity to add, update, or merge
57       * @param        merge boolean value for whether to merge the entity. The
58       *                default value is false. Setting merge to true is more
59       *                expensive and should only be true when dlFileVersion is
60       *                transient. See LEP-5473 for a detailed discussion of this
61       *                method.
62       * @return        true if the portlet can be displayed via Ajax
63       */
64      public com.liferay.portlet.documentlibrary.model.DLFileVersion update(
65          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion,
66          boolean merge) throws com.liferay.portal.SystemException;
67  
68      public com.liferay.portlet.documentlibrary.model.DLFileVersion updateImpl(
69          com.liferay.portlet.documentlibrary.model.DLFileVersion dlFileVersion,
70          boolean merge) throws com.liferay.portal.SystemException;
71  
72      public com.liferay.portlet.documentlibrary.model.DLFileVersion findByPrimaryKey(
73          long fileVersionId)
74          throws com.liferay.portal.SystemException,
75              com.liferay.portlet.documentlibrary.NoSuchFileVersionException;
76  
77      public com.liferay.portlet.documentlibrary.model.DLFileVersion fetchByPrimaryKey(
78          long fileVersionId) throws com.liferay.portal.SystemException;
79  
80      public java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
81          long folderId, java.lang.String name)
82          throws com.liferay.portal.SystemException;
83  
84      public java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
85          long folderId, java.lang.String name, int start, int end)
86          throws com.liferay.portal.SystemException;
87  
88      public java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findByF_N(
89          long folderId, java.lang.String name, int start, int end,
90          com.liferay.portal.kernel.util.OrderByComparator obc)
91          throws com.liferay.portal.SystemException;
92  
93      public com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_First(
94          long folderId, java.lang.String name,
95          com.liferay.portal.kernel.util.OrderByComparator obc)
96          throws com.liferay.portal.SystemException,
97              com.liferay.portlet.documentlibrary.NoSuchFileVersionException;
98  
99      public com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_Last(
100         long folderId, java.lang.String name,
101         com.liferay.portal.kernel.util.OrderByComparator obc)
102         throws com.liferay.portal.SystemException,
103             com.liferay.portlet.documentlibrary.NoSuchFileVersionException;
104 
105     public com.liferay.portlet.documentlibrary.model.DLFileVersion[] findByF_N_PrevAndNext(
106         long fileVersionId, long folderId, java.lang.String name,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException,
109             com.liferay.portlet.documentlibrary.NoSuchFileVersionException;
110 
111     public com.liferay.portlet.documentlibrary.model.DLFileVersion findByF_N_V(
112         long folderId, java.lang.String name, double version)
113         throws com.liferay.portal.SystemException,
114             com.liferay.portlet.documentlibrary.NoSuchFileVersionException;
115 
116     public com.liferay.portlet.documentlibrary.model.DLFileVersion fetchByF_N_V(
117         long folderId, java.lang.String name, double version)
118         throws com.liferay.portal.SystemException;
119 
120     public java.util.List<Object> findWithDynamicQuery(
121         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
122         throws com.liferay.portal.SystemException;
123 
124     public java.util.List<Object> findWithDynamicQuery(
125         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
126         int end) throws com.liferay.portal.SystemException;
127 
128     public java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll()
129         throws com.liferay.portal.SystemException;
130 
131     public java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll(
132         int start, int end) throws com.liferay.portal.SystemException;
133 
134     public java.util.List<com.liferay.portlet.documentlibrary.model.DLFileVersion> findAll(
135         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
136         throws com.liferay.portal.SystemException;
137 
138     public void removeByF_N(long folderId, java.lang.String name)
139         throws com.liferay.portal.SystemException;
140 
141     public void removeByF_N_V(long folderId, java.lang.String name,
142         double version)
143         throws com.liferay.portal.SystemException,
144             com.liferay.portlet.documentlibrary.NoSuchFileVersionException;
145 
146     public void removeAll() throws com.liferay.portal.SystemException;
147 
148     public int countByF_N(long folderId, java.lang.String name)
149         throws com.liferay.portal.SystemException;
150 
151     public int countByF_N_V(long folderId, java.lang.String name, double version)
152         throws com.liferay.portal.SystemException;
153 
154     public int countAll() throws com.liferay.portal.SystemException;
155 
156     public void registerListener(
157         com.liferay.portal.model.ModelListener listener);
158 
159     public void unregisterListener(
160         com.liferay.portal.model.ModelListener listener);
161 }