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.messageboards.service.persistence;
21  
22  import com.liferay.portal.service.persistence.BasePersistence;
23  
24  /**
25   * <a href="MBDiscussionPersistence.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Brian Wing Shun Chan
28   *
29   */
30  public interface MBDiscussionPersistence extends BasePersistence {
31      public void cacheResult(
32          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion);
33  
34      public void cacheResult(
35          java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> mbDiscussions);
36  
37      public void clearCache();
38  
39      public com.liferay.portlet.messageboards.model.MBDiscussion create(
40          long discussionId);
41  
42      public com.liferay.portlet.messageboards.model.MBDiscussion remove(
43          long discussionId)
44          throws com.liferay.portal.SystemException,
45              com.liferay.portlet.messageboards.NoSuchDiscussionException;
46  
47      public com.liferay.portlet.messageboards.model.MBDiscussion remove(
48          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
49          throws com.liferay.portal.SystemException;
50  
51      /**
52       * @deprecated Use <code>update(MBDiscussion mbDiscussion, boolean merge)</code>.
53       */
54      public com.liferay.portlet.messageboards.model.MBDiscussion update(
55          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion)
56          throws com.liferay.portal.SystemException;
57  
58      /**
59       * Add, update, or merge, the entity. This method also calls the model
60       * listeners to trigger the proper events associated with adding, deleting,
61       * or updating an entity.
62       *
63       * @param        mbDiscussion the entity to add, update, or merge
64       * @param        merge boolean value for whether to merge the entity. The
65       *                default value is false. Setting merge to true is more
66       *                expensive and should only be true when mbDiscussion is
67       *                transient. See LEP-5473 for a detailed discussion of this
68       *                method.
69       * @return        true if the portlet can be displayed via Ajax
70       */
71      public com.liferay.portlet.messageboards.model.MBDiscussion update(
72          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
73          boolean merge) throws com.liferay.portal.SystemException;
74  
75      public com.liferay.portlet.messageboards.model.MBDiscussion updateImpl(
76          com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion,
77          boolean merge) throws com.liferay.portal.SystemException;
78  
79      public com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
80          long discussionId)
81          throws com.liferay.portal.SystemException,
82              com.liferay.portlet.messageboards.NoSuchDiscussionException;
83  
84      public com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
85          long discussionId) throws com.liferay.portal.SystemException;
86  
87      public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
88          long classNameId) throws com.liferay.portal.SystemException;
89  
90      public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
91          long classNameId, int start, int end)
92          throws com.liferay.portal.SystemException;
93  
94      public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
95          long classNameId, int start, int end,
96          com.liferay.portal.kernel.util.OrderByComparator obc)
97          throws com.liferay.portal.SystemException;
98  
99      public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
100         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
101         throws com.liferay.portal.SystemException,
102             com.liferay.portlet.messageboards.NoSuchDiscussionException;
103 
104     public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
105         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
106         throws com.liferay.portal.SystemException,
107             com.liferay.portlet.messageboards.NoSuchDiscussionException;
108 
109     public com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
110         long discussionId, long classNameId,
111         com.liferay.portal.kernel.util.OrderByComparator obc)
112         throws com.liferay.portal.SystemException,
113             com.liferay.portlet.messageboards.NoSuchDiscussionException;
114 
115     public com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
116         long threadId)
117         throws com.liferay.portal.SystemException,
118             com.liferay.portlet.messageboards.NoSuchDiscussionException;
119 
120     public com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
121         long threadId) throws com.liferay.portal.SystemException;
122 
123     public com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
124         long threadId, boolean retrieveFromCache)
125         throws com.liferay.portal.SystemException;
126 
127     public com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
128         long classNameId, long classPK)
129         throws com.liferay.portal.SystemException,
130             com.liferay.portlet.messageboards.NoSuchDiscussionException;
131 
132     public com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
133         long classNameId, long classPK)
134         throws com.liferay.portal.SystemException;
135 
136     public com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
137         long classNameId, long classPK, boolean retrieveFromCache)
138         throws com.liferay.portal.SystemException;
139 
140     public java.util.List<Object> findWithDynamicQuery(
141         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
142         throws com.liferay.portal.SystemException;
143 
144     public java.util.List<Object> findWithDynamicQuery(
145         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
146         int end) throws com.liferay.portal.SystemException;
147 
148     public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
149         throws com.liferay.portal.SystemException;
150 
151     public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
152         int start, int end) throws com.liferay.portal.SystemException;
153 
154     public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
155         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
156         throws com.liferay.portal.SystemException;
157 
158     public void removeByClassNameId(long classNameId)
159         throws com.liferay.portal.SystemException;
160 
161     public void removeByThreadId(long threadId)
162         throws com.liferay.portal.SystemException,
163             com.liferay.portlet.messageboards.NoSuchDiscussionException;
164 
165     public void removeByC_C(long classNameId, long classPK)
166         throws com.liferay.portal.SystemException,
167             com.liferay.portlet.messageboards.NoSuchDiscussionException;
168 
169     public void removeAll() throws com.liferay.portal.SystemException;
170 
171     public int countByClassNameId(long classNameId)
172         throws com.liferay.portal.SystemException;
173 
174     public int countByThreadId(long threadId)
175         throws com.liferay.portal.SystemException;
176 
177     public int countByC_C(long classNameId, long classPK)
178         throws com.liferay.portal.SystemException;
179 
180     public int countAll() throws com.liferay.portal.SystemException;
181 }