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.polls.service.persistence;
21  
22  import com.liferay.portal.PortalException;
23  import com.liferay.portal.SystemException;
24  import com.liferay.portal.kernel.annotation.Propagation;
25  import com.liferay.portal.kernel.annotation.Transactional;
26  import com.liferay.portal.service.persistence.BasePersistence;
27  
28  /**
29   * <a href="PollsVotePersistence.java.html"><b><i>View Source</i></b></a>
30   *
31   * @author Brian Wing Shun Chan
32   *
33   */
34  @Transactional(rollbackFor =  {
35      PortalException.class, SystemException.class})
36  public interface PollsVotePersistence extends BasePersistence {
37      public com.liferay.portlet.polls.model.PollsVote create(long voteId);
38  
39      public com.liferay.portlet.polls.model.PollsVote remove(long voteId)
40          throws com.liferay.portal.SystemException,
41              com.liferay.portlet.polls.NoSuchVoteException;
42  
43      public com.liferay.portlet.polls.model.PollsVote remove(
44          com.liferay.portlet.polls.model.PollsVote pollsVote)
45          throws com.liferay.portal.SystemException;
46  
47      /**
48       * @deprecated Use <code>update(PollsVote pollsVote, boolean merge)</code>.
49       */
50      public com.liferay.portlet.polls.model.PollsVote update(
51          com.liferay.portlet.polls.model.PollsVote pollsVote)
52          throws com.liferay.portal.SystemException;
53  
54      /**
55       * Add, update, or merge, the entity. This method also calls the model
56       * listeners to trigger the proper events associated with adding, deleting,
57       * or updating an entity.
58       *
59       * @param        pollsVote the entity to add, update, or merge
60       * @param        merge boolean value for whether to merge the entity. The
61       *                default value is false. Setting merge to true is more
62       *                expensive and should only be true when pollsVote is
63       *                transient. See LEP-5473 for a detailed discussion of this
64       *                method.
65       * @return        true if the portlet can be displayed via Ajax
66       */
67      public com.liferay.portlet.polls.model.PollsVote update(
68          com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
69          throws com.liferay.portal.SystemException;
70  
71      public com.liferay.portlet.polls.model.PollsVote updateImpl(
72          com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
73          throws com.liferay.portal.SystemException;
74  
75      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
76      public com.liferay.portlet.polls.model.PollsVote findByPrimaryKey(
77          long voteId)
78          throws com.liferay.portal.SystemException,
79              com.liferay.portlet.polls.NoSuchVoteException;
80  
81      public com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey(
82          long voteId) throws com.liferay.portal.SystemException;
83  
84      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
85      public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
86          long questionId) throws com.liferay.portal.SystemException;
87  
88      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
89      public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
90          long questionId, int start, int end)
91          throws com.liferay.portal.SystemException;
92  
93      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
94      public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
95          long questionId, int start, int end,
96          com.liferay.portal.kernel.util.OrderByComparator obc)
97          throws com.liferay.portal.SystemException;
98  
99      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
100     public com.liferay.portlet.polls.model.PollsVote findByQuestionId_First(
101         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
102         throws com.liferay.portal.SystemException,
103             com.liferay.portlet.polls.NoSuchVoteException;
104 
105     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
106     public com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last(
107         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException,
109             com.liferay.portlet.polls.NoSuchVoteException;
110 
111     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
112     public com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext(
113         long voteId, long questionId,
114         com.liferay.portal.kernel.util.OrderByComparator obc)
115         throws com.liferay.portal.SystemException,
116             com.liferay.portlet.polls.NoSuchVoteException;
117 
118     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
119     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
120         long choiceId) throws com.liferay.portal.SystemException;
121 
122     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
123     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
124         long choiceId, int start, int end)
125         throws com.liferay.portal.SystemException;
126 
127     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
128     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
129         long choiceId, int start, int end,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException;
132 
133     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134     public com.liferay.portlet.polls.model.PollsVote findByChoiceId_First(
135         long choiceId, com.liferay.portal.kernel.util.OrderByComparator obc)
136         throws com.liferay.portal.SystemException,
137             com.liferay.portlet.polls.NoSuchVoteException;
138 
139     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
140     public com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last(
141         long choiceId, com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException,
143             com.liferay.portlet.polls.NoSuchVoteException;
144 
145     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
146     public com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext(
147         long voteId, long choiceId,
148         com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.SystemException,
150             com.liferay.portlet.polls.NoSuchVoteException;
151 
152     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
153     public com.liferay.portlet.polls.model.PollsVote findByQ_U(
154         long questionId, long userId)
155         throws com.liferay.portal.SystemException,
156             com.liferay.portlet.polls.NoSuchVoteException;
157 
158     public com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
159         long questionId, long userId) throws com.liferay.portal.SystemException;
160 
161     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162     public java.util.List<Object> findWithDynamicQuery(
163         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
164         throws com.liferay.portal.SystemException;
165 
166     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
167     public java.util.List<Object> findWithDynamicQuery(
168         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
169         int end) throws com.liferay.portal.SystemException;
170 
171     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
172     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll()
173         throws com.liferay.portal.SystemException;
174 
175     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
176     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
177         int start, int end) throws com.liferay.portal.SystemException;
178 
179     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
180     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
181         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
182         throws com.liferay.portal.SystemException;
183 
184     public void removeByQuestionId(long questionId)
185         throws com.liferay.portal.SystemException;
186 
187     public void removeByChoiceId(long choiceId)
188         throws com.liferay.portal.SystemException;
189 
190     public void removeByQ_U(long questionId, long userId)
191         throws com.liferay.portal.SystemException,
192             com.liferay.portlet.polls.NoSuchVoteException;
193 
194     public void removeAll() throws com.liferay.portal.SystemException;
195 
196     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
197     public int countByQuestionId(long questionId)
198         throws com.liferay.portal.SystemException;
199 
200     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201     public int countByChoiceId(long choiceId)
202         throws com.liferay.portal.SystemException;
203 
204     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205     public int countByQ_U(long questionId, long userId)
206         throws com.liferay.portal.SystemException;
207 
208     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
209     public int countAll() throws com.liferay.portal.SystemException;
210 }