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.messageboards.service.persistence;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.Propagation;
28  import com.liferay.portal.kernel.annotation.Transactional;
29  
30  /**
31   * <a href="MBDiscussionPersistence.java.html"><b><i>View Source</i></b></a>
32   *
33   * @author Brian Wing Shun Chan
34   *
35   */
36  @Transactional(rollbackFor =  {
37      PortalException.class, SystemException.class})
38  public interface MBDiscussionPersistence {
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      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
80      public com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey(
81          long discussionId)
82          throws com.liferay.portal.SystemException,
83              com.liferay.portlet.messageboards.NoSuchDiscussionException;
84  
85      public com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey(
86          long discussionId) throws com.liferay.portal.SystemException;
87  
88      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
89      public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
90          long classNameId) throws com.liferay.portal.SystemException;
91  
92      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
93      public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
94          long classNameId, int start, int end)
95          throws com.liferay.portal.SystemException;
96  
97      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
98      public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId(
99          long classNameId, int start, int end,
100         com.liferay.portal.kernel.util.OrderByComparator obc)
101         throws com.liferay.portal.SystemException;
102 
103     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
104     public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First(
105         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
106         throws com.liferay.portal.SystemException,
107             com.liferay.portlet.messageboards.NoSuchDiscussionException;
108 
109     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
110     public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last(
111         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
112         throws com.liferay.portal.SystemException,
113             com.liferay.portlet.messageboards.NoSuchDiscussionException;
114 
115     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
116     public com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext(
117         long discussionId, long classNameId,
118         com.liferay.portal.kernel.util.OrderByComparator obc)
119         throws com.liferay.portal.SystemException,
120             com.liferay.portlet.messageboards.NoSuchDiscussionException;
121 
122     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
123     public com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId(
124         long threadId)
125         throws com.liferay.portal.SystemException,
126             com.liferay.portlet.messageboards.NoSuchDiscussionException;
127 
128     public com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId(
129         long threadId) throws com.liferay.portal.SystemException;
130 
131     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
132     public com.liferay.portlet.messageboards.model.MBDiscussion findByC_C(
133         long classNameId, long classPK)
134         throws com.liferay.portal.SystemException,
135             com.liferay.portlet.messageboards.NoSuchDiscussionException;
136 
137     public com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C(
138         long classNameId, long classPK)
139         throws com.liferay.portal.SystemException;
140 
141     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
142     public java.util.List<Object> findWithDynamicQuery(
143         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
144         throws com.liferay.portal.SystemException;
145 
146     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
147     public java.util.List<Object> findWithDynamicQuery(
148         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
149         int end) throws com.liferay.portal.SystemException;
150 
151     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
152     public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll()
153         throws com.liferay.portal.SystemException;
154 
155     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
156     public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
157         int start, int end) throws com.liferay.portal.SystemException;
158 
159     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
160     public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll(
161         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
162         throws com.liferay.portal.SystemException;
163 
164     public void removeByClassNameId(long classNameId)
165         throws com.liferay.portal.SystemException;
166 
167     public void removeByThreadId(long threadId)
168         throws com.liferay.portal.SystemException,
169             com.liferay.portlet.messageboards.NoSuchDiscussionException;
170 
171     public void removeByC_C(long classNameId, long classPK)
172         throws com.liferay.portal.SystemException,
173             com.liferay.portlet.messageboards.NoSuchDiscussionException;
174 
175     public void removeAll() throws com.liferay.portal.SystemException;
176 
177     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178     public int countByClassNameId(long classNameId)
179         throws com.liferay.portal.SystemException;
180 
181     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182     public int countByThreadId(long threadId)
183         throws com.liferay.portal.SystemException;
184 
185     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186     public int countByC_C(long classNameId, long classPK)
187         throws com.liferay.portal.SystemException;
188 
189     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190     public int countAll() throws com.liferay.portal.SystemException;
191 
192     public void registerListener(
193         com.liferay.portal.model.ModelListener listener);
194 
195     public void unregisterListener(
196         com.liferay.portal.model.ModelListener listener);
197 }