1   /**
2    * Copyright (c) 2000-2009 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.polls.service.persistence;
24  
25  import com.liferay.portal.service.persistence.BasePersistence;
26  
27  /**
28   * <a href="PollsVotePersistence.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Brian Wing Shun Chan
31   *
32   */
33  public interface PollsVotePersistence extends BasePersistence {
34      public void cacheResult(com.liferay.portlet.polls.model.PollsVote pollsVote);
35  
36      public void cacheResult(
37          java.util.List<com.liferay.portlet.polls.model.PollsVote> pollsVotes);
38  
39      public void clearCache();
40  
41      public com.liferay.portlet.polls.model.PollsVote create(long voteId);
42  
43      public com.liferay.portlet.polls.model.PollsVote remove(long voteId)
44          throws com.liferay.portal.SystemException,
45              com.liferay.portlet.polls.NoSuchVoteException;
46  
47      public com.liferay.portlet.polls.model.PollsVote remove(
48          com.liferay.portlet.polls.model.PollsVote pollsVote)
49          throws com.liferay.portal.SystemException;
50  
51      /**
52       * @deprecated Use <code>update(PollsVote pollsVote, boolean merge)</code>.
53       */
54      public com.liferay.portlet.polls.model.PollsVote update(
55          com.liferay.portlet.polls.model.PollsVote pollsVote)
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        pollsVote 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 pollsVote 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.polls.model.PollsVote update(
72          com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
73          throws com.liferay.portal.SystemException;
74  
75      public com.liferay.portlet.polls.model.PollsVote updateImpl(
76          com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge)
77          throws com.liferay.portal.SystemException;
78  
79      public com.liferay.portlet.polls.model.PollsVote findByPrimaryKey(
80          long voteId)
81          throws com.liferay.portal.SystemException,
82              com.liferay.portlet.polls.NoSuchVoteException;
83  
84      public com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey(
85          long voteId) throws com.liferay.portal.SystemException;
86  
87      public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
88          long questionId) throws com.liferay.portal.SystemException;
89  
90      public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId(
91          long questionId, int start, int end)
92          throws com.liferay.portal.SystemException;
93  
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      public com.liferay.portlet.polls.model.PollsVote findByQuestionId_First(
100         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
101         throws com.liferay.portal.SystemException,
102             com.liferay.portlet.polls.NoSuchVoteException;
103 
104     public com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last(
105         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
106         throws com.liferay.portal.SystemException,
107             com.liferay.portlet.polls.NoSuchVoteException;
108 
109     public com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext(
110         long voteId, long questionId,
111         com.liferay.portal.kernel.util.OrderByComparator obc)
112         throws com.liferay.portal.SystemException,
113             com.liferay.portlet.polls.NoSuchVoteException;
114 
115     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
116         long choiceId) throws com.liferay.portal.SystemException;
117 
118     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
119         long choiceId, int start, int end)
120         throws com.liferay.portal.SystemException;
121 
122     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId(
123         long choiceId, int start, int end,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException;
126 
127     public com.liferay.portlet.polls.model.PollsVote findByChoiceId_First(
128         long choiceId, com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.SystemException,
130             com.liferay.portlet.polls.NoSuchVoteException;
131 
132     public com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last(
133         long choiceId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.SystemException,
135             com.liferay.portlet.polls.NoSuchVoteException;
136 
137     public com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext(
138         long voteId, long choiceId,
139         com.liferay.portal.kernel.util.OrderByComparator obc)
140         throws com.liferay.portal.SystemException,
141             com.liferay.portlet.polls.NoSuchVoteException;
142 
143     public com.liferay.portlet.polls.model.PollsVote findByQ_U(
144         long questionId, long userId)
145         throws com.liferay.portal.SystemException,
146             com.liferay.portlet.polls.NoSuchVoteException;
147 
148     public com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
149         long questionId, long userId) throws com.liferay.portal.SystemException;
150 
151     public com.liferay.portlet.polls.model.PollsVote fetchByQ_U(
152         long questionId, long userId, boolean retrieveFromCache)
153         throws com.liferay.portal.SystemException;
154 
155     public java.util.List<Object> findWithDynamicQuery(
156         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157         throws com.liferay.portal.SystemException;
158 
159     public java.util.List<Object> findWithDynamicQuery(
160         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
161         int end) throws com.liferay.portal.SystemException;
162 
163     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll()
164         throws com.liferay.portal.SystemException;
165 
166     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
167         int start, int end) throws com.liferay.portal.SystemException;
168 
169     public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll(
170         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
171         throws com.liferay.portal.SystemException;
172 
173     public void removeByQuestionId(long questionId)
174         throws com.liferay.portal.SystemException;
175 
176     public void removeByChoiceId(long choiceId)
177         throws com.liferay.portal.SystemException;
178 
179     public void removeByQ_U(long questionId, long userId)
180         throws com.liferay.portal.SystemException,
181             com.liferay.portlet.polls.NoSuchVoteException;
182 
183     public void removeAll() throws com.liferay.portal.SystemException;
184 
185     public int countByQuestionId(long questionId)
186         throws com.liferay.portal.SystemException;
187 
188     public int countByChoiceId(long choiceId)
189         throws com.liferay.portal.SystemException;
190 
191     public int countByQ_U(long questionId, long userId)
192         throws com.liferay.portal.SystemException;
193 
194     public int countAll() throws com.liferay.portal.SystemException;
195 }