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