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="PollsChoicePersistence.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 PollsChoicePersistence extends BasePersistence {
37      public com.liferay.portlet.polls.model.PollsChoice create(long choiceId);
38  
39      public com.liferay.portlet.polls.model.PollsChoice remove(long choiceId)
40          throws com.liferay.portal.SystemException,
41              com.liferay.portlet.polls.NoSuchChoiceException;
42  
43      public com.liferay.portlet.polls.model.PollsChoice remove(
44          com.liferay.portlet.polls.model.PollsChoice pollsChoice)
45          throws com.liferay.portal.SystemException;
46  
47      /**
48       * @deprecated Use <code>update(PollsChoice pollsChoice, boolean merge)</code>.
49       */
50      public com.liferay.portlet.polls.model.PollsChoice update(
51          com.liferay.portlet.polls.model.PollsChoice pollsChoice)
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        pollsChoice 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 pollsChoice 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.PollsChoice update(
68          com.liferay.portlet.polls.model.PollsChoice pollsChoice, boolean merge)
69          throws com.liferay.portal.SystemException;
70  
71      public com.liferay.portlet.polls.model.PollsChoice updateImpl(
72          com.liferay.portlet.polls.model.PollsChoice pollsChoice, boolean merge)
73          throws com.liferay.portal.SystemException;
74  
75      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
76      public com.liferay.portlet.polls.model.PollsChoice findByPrimaryKey(
77          long choiceId)
78          throws com.liferay.portal.SystemException,
79              com.liferay.portlet.polls.NoSuchChoiceException;
80  
81      public com.liferay.portlet.polls.model.PollsChoice fetchByPrimaryKey(
82          long choiceId) throws com.liferay.portal.SystemException;
83  
84      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
85      public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
86          java.lang.String uuid) throws com.liferay.portal.SystemException;
87  
88      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
89      public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid(
90          java.lang.String uuid, 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.PollsChoice> findByUuid(
95          java.lang.String uuid, 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.PollsChoice findByUuid_First(
101         java.lang.String uuid,
102         com.liferay.portal.kernel.util.OrderByComparator obc)
103         throws com.liferay.portal.SystemException,
104             com.liferay.portlet.polls.NoSuchChoiceException;
105 
106     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
107     public com.liferay.portlet.polls.model.PollsChoice findByUuid_Last(
108         java.lang.String uuid,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException,
111             com.liferay.portlet.polls.NoSuchChoiceException;
112 
113     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
114     public com.liferay.portlet.polls.model.PollsChoice[] findByUuid_PrevAndNext(
115         long choiceId, java.lang.String uuid,
116         com.liferay.portal.kernel.util.OrderByComparator obc)
117         throws com.liferay.portal.SystemException,
118             com.liferay.portlet.polls.NoSuchChoiceException;
119 
120     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
121     public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
122         long questionId) throws com.liferay.portal.SystemException;
123 
124     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
125     public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
126         long questionId, int start, int end)
127         throws com.liferay.portal.SystemException;
128 
129     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
130     public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId(
131         long questionId, int start, int end,
132         com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.SystemException;
134 
135     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
136     public com.liferay.portlet.polls.model.PollsChoice findByQuestionId_First(
137         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.SystemException,
139             com.liferay.portlet.polls.NoSuchChoiceException;
140 
141     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
142     public com.liferay.portlet.polls.model.PollsChoice findByQuestionId_Last(
143         long questionId, com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.SystemException,
145             com.liferay.portlet.polls.NoSuchChoiceException;
146 
147     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148     public com.liferay.portlet.polls.model.PollsChoice[] findByQuestionId_PrevAndNext(
149         long choiceId, long questionId,
150         com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.SystemException,
152             com.liferay.portlet.polls.NoSuchChoiceException;
153 
154     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155     public com.liferay.portlet.polls.model.PollsChoice findByQ_N(
156         long questionId, java.lang.String name)
157         throws com.liferay.portal.SystemException,
158             com.liferay.portlet.polls.NoSuchChoiceException;
159 
160     public com.liferay.portlet.polls.model.PollsChoice fetchByQ_N(
161         long questionId, java.lang.String name)
162         throws com.liferay.portal.SystemException;
163 
164     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165     public java.util.List<Object> findWithDynamicQuery(
166         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
167         throws com.liferay.portal.SystemException;
168 
169     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170     public java.util.List<Object> findWithDynamicQuery(
171         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
172         int end) throws com.liferay.portal.SystemException;
173 
174     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
175     public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll()
176         throws com.liferay.portal.SystemException;
177 
178     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
179     public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll(
180         int start, int end) throws com.liferay.portal.SystemException;
181 
182     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
183     public java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll(
184         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
185         throws com.liferay.portal.SystemException;
186 
187     public void removeByUuid(java.lang.String uuid)
188         throws com.liferay.portal.SystemException;
189 
190     public void removeByQuestionId(long questionId)
191         throws com.liferay.portal.SystemException;
192 
193     public void removeByQ_N(long questionId, java.lang.String name)
194         throws com.liferay.portal.SystemException,
195             com.liferay.portlet.polls.NoSuchChoiceException;
196 
197     public void removeAll() throws com.liferay.portal.SystemException;
198 
199     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200     public int countByUuid(java.lang.String uuid)
201         throws com.liferay.portal.SystemException;
202 
203     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
204     public int countByQuestionId(long questionId)
205         throws com.liferay.portal.SystemException;
206 
207     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
208     public int countByQ_N(long questionId, java.lang.String name)
209         throws com.liferay.portal.SystemException;
210 
211     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
212     public int countAll() throws com.liferay.portal.SystemException;
213 }