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="MBStatsUserPersistence.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 MBStatsUserPersistence {
39      public com.liferay.portlet.messageboards.model.MBStatsUser create(
40          long statsUserId);
41  
42      public com.liferay.portlet.messageboards.model.MBStatsUser remove(
43          long statsUserId)
44          throws com.liferay.portal.SystemException,
45              com.liferay.portlet.messageboards.NoSuchStatsUserException;
46  
47      public com.liferay.portlet.messageboards.model.MBStatsUser remove(
48          com.liferay.portlet.messageboards.model.MBStatsUser mbStatsUser)
49          throws com.liferay.portal.SystemException;
50  
51      /**
52       * @deprecated Use <code>update(MBStatsUser mbStatsUser, boolean merge)</code>.
53       */
54      public com.liferay.portlet.messageboards.model.MBStatsUser update(
55          com.liferay.portlet.messageboards.model.MBStatsUser mbStatsUser)
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        mbStatsUser 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 mbStatsUser 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.MBStatsUser update(
72          com.liferay.portlet.messageboards.model.MBStatsUser mbStatsUser,
73          boolean merge) throws com.liferay.portal.SystemException;
74  
75      public com.liferay.portlet.messageboards.model.MBStatsUser updateImpl(
76          com.liferay.portlet.messageboards.model.MBStatsUser mbStatsUser,
77          boolean merge) throws com.liferay.portal.SystemException;
78  
79      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
80      public com.liferay.portlet.messageboards.model.MBStatsUser findByPrimaryKey(
81          long statsUserId)
82          throws com.liferay.portal.SystemException,
83              com.liferay.portlet.messageboards.NoSuchStatsUserException;
84  
85      public com.liferay.portlet.messageboards.model.MBStatsUser fetchByPrimaryKey(
86          long statsUserId) throws com.liferay.portal.SystemException;
87  
88      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
89      public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findByGroupId(
90          long groupId) throws com.liferay.portal.SystemException;
91  
92      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
93      public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findByGroupId(
94          long groupId, 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.MBStatsUser> findByGroupId(
99          long groupId, 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.MBStatsUser findByGroupId_First(
105         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
106         throws com.liferay.portal.SystemException,
107             com.liferay.portlet.messageboards.NoSuchStatsUserException;
108 
109     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
110     public com.liferay.portlet.messageboards.model.MBStatsUser findByGroupId_Last(
111         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
112         throws com.liferay.portal.SystemException,
113             com.liferay.portlet.messageboards.NoSuchStatsUserException;
114 
115     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
116     public com.liferay.portlet.messageboards.model.MBStatsUser[] findByGroupId_PrevAndNext(
117         long statsUserId, long groupId,
118         com.liferay.portal.kernel.util.OrderByComparator obc)
119         throws com.liferay.portal.SystemException,
120             com.liferay.portlet.messageboards.NoSuchStatsUserException;
121 
122     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
123     public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findByUserId(
124         long userId) throws com.liferay.portal.SystemException;
125 
126     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
127     public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findByUserId(
128         long userId, int start, int end)
129         throws com.liferay.portal.SystemException;
130 
131     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
132     public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findByUserId(
133         long userId, int start, int end,
134         com.liferay.portal.kernel.util.OrderByComparator obc)
135         throws com.liferay.portal.SystemException;
136 
137     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
138     public com.liferay.portlet.messageboards.model.MBStatsUser findByUserId_First(
139         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
140         throws com.liferay.portal.SystemException,
141             com.liferay.portlet.messageboards.NoSuchStatsUserException;
142 
143     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144     public com.liferay.portlet.messageboards.model.MBStatsUser findByUserId_Last(
145         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
146         throws com.liferay.portal.SystemException,
147             com.liferay.portlet.messageboards.NoSuchStatsUserException;
148 
149     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
150     public com.liferay.portlet.messageboards.model.MBStatsUser[] findByUserId_PrevAndNext(
151         long statsUserId, long userId,
152         com.liferay.portal.kernel.util.OrderByComparator obc)
153         throws com.liferay.portal.SystemException,
154             com.liferay.portlet.messageboards.NoSuchStatsUserException;
155 
156     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
157     public com.liferay.portlet.messageboards.model.MBStatsUser findByG_U(
158         long groupId, long userId)
159         throws com.liferay.portal.SystemException,
160             com.liferay.portlet.messageboards.NoSuchStatsUserException;
161 
162     public com.liferay.portlet.messageboards.model.MBStatsUser fetchByG_U(
163         long groupId, long userId) throws com.liferay.portal.SystemException;
164 
165     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
166     public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findByG_M(
167         long groupId, int messageCount)
168         throws com.liferay.portal.SystemException;
169 
170     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171     public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findByG_M(
172         long groupId, int messageCount, int start, int end)
173         throws com.liferay.portal.SystemException;
174 
175     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
176     public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findByG_M(
177         long groupId, int messageCount, int start, int end,
178         com.liferay.portal.kernel.util.OrderByComparator obc)
179         throws com.liferay.portal.SystemException;
180 
181     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182     public com.liferay.portlet.messageboards.model.MBStatsUser findByG_M_First(
183         long groupId, int messageCount,
184         com.liferay.portal.kernel.util.OrderByComparator obc)
185         throws com.liferay.portal.SystemException,
186             com.liferay.portlet.messageboards.NoSuchStatsUserException;
187 
188     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
189     public com.liferay.portlet.messageboards.model.MBStatsUser findByG_M_Last(
190         long groupId, int messageCount,
191         com.liferay.portal.kernel.util.OrderByComparator obc)
192         throws com.liferay.portal.SystemException,
193             com.liferay.portlet.messageboards.NoSuchStatsUserException;
194 
195     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196     public com.liferay.portlet.messageboards.model.MBStatsUser[] findByG_M_PrevAndNext(
197         long statsUserId, long groupId, int messageCount,
198         com.liferay.portal.kernel.util.OrderByComparator obc)
199         throws com.liferay.portal.SystemException,
200             com.liferay.portlet.messageboards.NoSuchStatsUserException;
201 
202     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
203     public java.util.List<Object> findWithDynamicQuery(
204         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
205         throws com.liferay.portal.SystemException;
206 
207     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
208     public java.util.List<Object> findWithDynamicQuery(
209         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
210         int end) throws com.liferay.portal.SystemException;
211 
212     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
213     public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findAll()
214         throws com.liferay.portal.SystemException;
215 
216     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
217     public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findAll(
218         int start, int end) throws com.liferay.portal.SystemException;
219 
220     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
221     public java.util.List<com.liferay.portlet.messageboards.model.MBStatsUser> findAll(
222         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
223         throws com.liferay.portal.SystemException;
224 
225     public void removeByGroupId(long groupId)
226         throws com.liferay.portal.SystemException;
227 
228     public void removeByUserId(long userId)
229         throws com.liferay.portal.SystemException;
230 
231     public void removeByG_U(long groupId, long userId)
232         throws com.liferay.portal.SystemException,
233             com.liferay.portlet.messageboards.NoSuchStatsUserException;
234 
235     public void removeByG_M(long groupId, int messageCount)
236         throws com.liferay.portal.SystemException;
237 
238     public void removeAll() throws com.liferay.portal.SystemException;
239 
240     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
241     public int countByGroupId(long groupId)
242         throws com.liferay.portal.SystemException;
243 
244     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
245     public int countByUserId(long userId)
246         throws com.liferay.portal.SystemException;
247 
248     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249     public int countByG_U(long groupId, long userId)
250         throws com.liferay.portal.SystemException;
251 
252     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253     public int countByG_M(long groupId, int messageCount)
254         throws com.liferay.portal.SystemException;
255 
256     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
257     public int countAll() throws com.liferay.portal.SystemException;
258 
259     public void registerListener(
260         com.liferay.portal.model.ModelListener listener);
261 
262     public void unregisterListener(
263         com.liferay.portal.model.ModelListener listener);
264 }