001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portlet.polls.service.persistence; 016 017 import com.liferay.portal.kernel.exception.SystemException; 018 import com.liferay.portal.service.persistence.BasePersistence; 019 020 import com.liferay.portlet.polls.model.PollsVote; 021 022 /** 023 * The persistence interface for the polls vote service. 024 * 025 * <p> 026 * Caching information and settings can be found in <code>portal.properties</code> 027 * </p> 028 * 029 * @author Brian Wing Shun Chan 030 * @see PollsVotePersistenceImpl 031 * @see PollsVoteUtil 032 * @generated 033 */ 034 public interface PollsVotePersistence extends BasePersistence<PollsVote> { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify or reference this interface directly. Always use {@link PollsVoteUtil} to access the polls vote persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 039 */ 040 041 /** 042 * Caches the polls vote in the entity cache if it is enabled. 043 * 044 * @param pollsVote the polls vote 045 */ 046 public void cacheResult(com.liferay.portlet.polls.model.PollsVote pollsVote); 047 048 /** 049 * Caches the polls votes in the entity cache if it is enabled. 050 * 051 * @param pollsVotes the polls votes 052 */ 053 public void cacheResult( 054 java.util.List<com.liferay.portlet.polls.model.PollsVote> pollsVotes); 055 056 /** 057 * Creates a new polls vote with the primary key. Does not add the polls vote to the database. 058 * 059 * @param voteId the primary key for the new polls vote 060 * @return the new polls vote 061 */ 062 public com.liferay.portlet.polls.model.PollsVote create(long voteId); 063 064 /** 065 * Removes the polls vote with the primary key from the database. Also notifies the appropriate model listeners. 066 * 067 * @param voteId the primary key of the polls vote 068 * @return the polls vote that was removed 069 * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found 070 * @throws SystemException if a system exception occurred 071 */ 072 public com.liferay.portlet.polls.model.PollsVote remove(long voteId) 073 throws com.liferay.portal.kernel.exception.SystemException, 074 com.liferay.portlet.polls.NoSuchVoteException; 075 076 public com.liferay.portlet.polls.model.PollsVote updateImpl( 077 com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge) 078 throws com.liferay.portal.kernel.exception.SystemException; 079 080 /** 081 * Returns the polls vote with the primary key or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found. 082 * 083 * @param voteId the primary key of the polls vote 084 * @return the polls vote 085 * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found 086 * @throws SystemException if a system exception occurred 087 */ 088 public com.liferay.portlet.polls.model.PollsVote findByPrimaryKey( 089 long voteId) 090 throws com.liferay.portal.kernel.exception.SystemException, 091 com.liferay.portlet.polls.NoSuchVoteException; 092 093 /** 094 * Returns the polls vote with the primary key or returns <code>null</code> if it could not be found. 095 * 096 * @param voteId the primary key of the polls vote 097 * @return the polls vote, or <code>null</code> if a polls vote with the primary key could not be found 098 * @throws SystemException if a system exception occurred 099 */ 100 public com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey( 101 long voteId) throws com.liferay.portal.kernel.exception.SystemException; 102 103 /** 104 * Returns all the polls votes where questionId = ?. 105 * 106 * @param questionId the question ID 107 * @return the matching polls votes 108 * @throws SystemException if a system exception occurred 109 */ 110 public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId( 111 long questionId) 112 throws com.liferay.portal.kernel.exception.SystemException; 113 114 /** 115 * Returns a range of all the polls votes where questionId = ?. 116 * 117 * <p> 118 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 119 * </p> 120 * 121 * @param questionId the question ID 122 * @param start the lower bound of the range of polls votes 123 * @param end the upper bound of the range of polls votes (not inclusive) 124 * @return the range of matching polls votes 125 * @throws SystemException if a system exception occurred 126 */ 127 public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId( 128 long questionId, int start, int end) 129 throws com.liferay.portal.kernel.exception.SystemException; 130 131 /** 132 * Returns an ordered range of all the polls votes where questionId = ?. 133 * 134 * <p> 135 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 136 * </p> 137 * 138 * @param questionId the question ID 139 * @param start the lower bound of the range of polls votes 140 * @param end the upper bound of the range of polls votes (not inclusive) 141 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 142 * @return the ordered range of matching polls votes 143 * @throws SystemException if a system exception occurred 144 */ 145 public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId( 146 long questionId, int start, int end, 147 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 148 throws com.liferay.portal.kernel.exception.SystemException; 149 150 /** 151 * Returns the first polls vote in the ordered set where questionId = ?. 152 * 153 * <p> 154 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 155 * </p> 156 * 157 * @param questionId the question ID 158 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 159 * @return the first matching polls vote 160 * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found 161 * @throws SystemException if a system exception occurred 162 */ 163 public com.liferay.portlet.polls.model.PollsVote findByQuestionId_First( 164 long questionId, 165 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 166 throws com.liferay.portal.kernel.exception.SystemException, 167 com.liferay.portlet.polls.NoSuchVoteException; 168 169 /** 170 * Returns the last polls vote in the ordered set where questionId = ?. 171 * 172 * <p> 173 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 174 * </p> 175 * 176 * @param questionId the question ID 177 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 178 * @return the last matching polls vote 179 * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found 180 * @throws SystemException if a system exception occurred 181 */ 182 public com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last( 183 long questionId, 184 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 185 throws com.liferay.portal.kernel.exception.SystemException, 186 com.liferay.portlet.polls.NoSuchVoteException; 187 188 /** 189 * Returns the polls votes before and after the current polls vote in the ordered set where questionId = ?. 190 * 191 * <p> 192 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 193 * </p> 194 * 195 * @param voteId the primary key of the current polls vote 196 * @param questionId the question ID 197 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 198 * @return the previous, current, and next polls vote 199 * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found 200 * @throws SystemException if a system exception occurred 201 */ 202 public com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext( 203 long voteId, long questionId, 204 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 205 throws com.liferay.portal.kernel.exception.SystemException, 206 com.liferay.portlet.polls.NoSuchVoteException; 207 208 /** 209 * Returns all the polls votes where choiceId = ?. 210 * 211 * @param choiceId the choice ID 212 * @return the matching polls votes 213 * @throws SystemException if a system exception occurred 214 */ 215 public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId( 216 long choiceId) 217 throws com.liferay.portal.kernel.exception.SystemException; 218 219 /** 220 * Returns a range of all the polls votes where choiceId = ?. 221 * 222 * <p> 223 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 224 * </p> 225 * 226 * @param choiceId the choice ID 227 * @param start the lower bound of the range of polls votes 228 * @param end the upper bound of the range of polls votes (not inclusive) 229 * @return the range of matching polls votes 230 * @throws SystemException if a system exception occurred 231 */ 232 public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId( 233 long choiceId, int start, int end) 234 throws com.liferay.portal.kernel.exception.SystemException; 235 236 /** 237 * Returns an ordered range of all the polls votes where choiceId = ?. 238 * 239 * <p> 240 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 241 * </p> 242 * 243 * @param choiceId the choice ID 244 * @param start the lower bound of the range of polls votes 245 * @param end the upper bound of the range of polls votes (not inclusive) 246 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 247 * @return the ordered range of matching polls votes 248 * @throws SystemException if a system exception occurred 249 */ 250 public java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId( 251 long choiceId, int start, int end, 252 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 253 throws com.liferay.portal.kernel.exception.SystemException; 254 255 /** 256 * Returns the first polls vote in the ordered set where choiceId = ?. 257 * 258 * <p> 259 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 260 * </p> 261 * 262 * @param choiceId the choice ID 263 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 264 * @return the first matching polls vote 265 * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found 266 * @throws SystemException if a system exception occurred 267 */ 268 public com.liferay.portlet.polls.model.PollsVote findByChoiceId_First( 269 long choiceId, 270 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 271 throws com.liferay.portal.kernel.exception.SystemException, 272 com.liferay.portlet.polls.NoSuchVoteException; 273 274 /** 275 * Returns the last polls vote in the ordered set where choiceId = ?. 276 * 277 * <p> 278 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 279 * </p> 280 * 281 * @param choiceId the choice ID 282 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 283 * @return the last matching polls vote 284 * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found 285 * @throws SystemException if a system exception occurred 286 */ 287 public com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last( 288 long choiceId, 289 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 290 throws com.liferay.portal.kernel.exception.SystemException, 291 com.liferay.portlet.polls.NoSuchVoteException; 292 293 /** 294 * Returns the polls votes before and after the current polls vote in the ordered set where choiceId = ?. 295 * 296 * <p> 297 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 298 * </p> 299 * 300 * @param voteId the primary key of the current polls vote 301 * @param choiceId the choice ID 302 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 303 * @return the previous, current, and next polls vote 304 * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found 305 * @throws SystemException if a system exception occurred 306 */ 307 public com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext( 308 long voteId, long choiceId, 309 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 310 throws com.liferay.portal.kernel.exception.SystemException, 311 com.liferay.portlet.polls.NoSuchVoteException; 312 313 /** 314 * Returns the polls vote where questionId = ? and userId = ? or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found. 315 * 316 * @param questionId the question ID 317 * @param userId the user ID 318 * @return the matching polls vote 319 * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found 320 * @throws SystemException if a system exception occurred 321 */ 322 public com.liferay.portlet.polls.model.PollsVote findByQ_U( 323 long questionId, long userId) 324 throws com.liferay.portal.kernel.exception.SystemException, 325 com.liferay.portlet.polls.NoSuchVoteException; 326 327 /** 328 * Returns the polls vote where questionId = ? and userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 329 * 330 * @param questionId the question ID 331 * @param userId the user ID 332 * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found 333 * @throws SystemException if a system exception occurred 334 */ 335 public com.liferay.portlet.polls.model.PollsVote fetchByQ_U( 336 long questionId, long userId) 337 throws com.liferay.portal.kernel.exception.SystemException; 338 339 /** 340 * Returns the polls vote where questionId = ? and userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 341 * 342 * @param questionId the question ID 343 * @param userId the user ID 344 * @param retrieveFromCache whether to use the finder cache 345 * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found 346 * @throws SystemException if a system exception occurred 347 */ 348 public com.liferay.portlet.polls.model.PollsVote fetchByQ_U( 349 long questionId, long userId, boolean retrieveFromCache) 350 throws com.liferay.portal.kernel.exception.SystemException; 351 352 /** 353 * Returns all the polls votes. 354 * 355 * @return the polls votes 356 * @throws SystemException if a system exception occurred 357 */ 358 public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll() 359 throws com.liferay.portal.kernel.exception.SystemException; 360 361 /** 362 * Returns a range of all the polls votes. 363 * 364 * <p> 365 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 366 * </p> 367 * 368 * @param start the lower bound of the range of polls votes 369 * @param end the upper bound of the range of polls votes (not inclusive) 370 * @return the range of polls votes 371 * @throws SystemException if a system exception occurred 372 */ 373 public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll( 374 int start, int end) 375 throws com.liferay.portal.kernel.exception.SystemException; 376 377 /** 378 * Returns an ordered range of all the polls votes. 379 * 380 * <p> 381 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 382 * </p> 383 * 384 * @param start the lower bound of the range of polls votes 385 * @param end the upper bound of the range of polls votes (not inclusive) 386 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 387 * @return the ordered range of polls votes 388 * @throws SystemException if a system exception occurred 389 */ 390 public java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll( 391 int start, int end, 392 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 393 throws com.liferay.portal.kernel.exception.SystemException; 394 395 /** 396 * Removes all the polls votes where questionId = ? from the database. 397 * 398 * @param questionId the question ID 399 * @throws SystemException if a system exception occurred 400 */ 401 public void removeByQuestionId(long questionId) 402 throws com.liferay.portal.kernel.exception.SystemException; 403 404 /** 405 * Removes all the polls votes where choiceId = ? from the database. 406 * 407 * @param choiceId the choice ID 408 * @throws SystemException if a system exception occurred 409 */ 410 public void removeByChoiceId(long choiceId) 411 throws com.liferay.portal.kernel.exception.SystemException; 412 413 /** 414 * Removes the polls vote where questionId = ? and userId = ? from the database. 415 * 416 * @param questionId the question ID 417 * @param userId the user ID 418 * @throws SystemException if a system exception occurred 419 */ 420 public void removeByQ_U(long questionId, long userId) 421 throws com.liferay.portal.kernel.exception.SystemException, 422 com.liferay.portlet.polls.NoSuchVoteException; 423 424 /** 425 * Removes all the polls votes from the database. 426 * 427 * @throws SystemException if a system exception occurred 428 */ 429 public void removeAll() 430 throws com.liferay.portal.kernel.exception.SystemException; 431 432 /** 433 * Returns the number of polls votes where questionId = ?. 434 * 435 * @param questionId the question ID 436 * @return the number of matching polls votes 437 * @throws SystemException if a system exception occurred 438 */ 439 public int countByQuestionId(long questionId) 440 throws com.liferay.portal.kernel.exception.SystemException; 441 442 /** 443 * Returns the number of polls votes where choiceId = ?. 444 * 445 * @param choiceId the choice ID 446 * @return the number of matching polls votes 447 * @throws SystemException if a system exception occurred 448 */ 449 public int countByChoiceId(long choiceId) 450 throws com.liferay.portal.kernel.exception.SystemException; 451 452 /** 453 * Returns the number of polls votes where questionId = ? and userId = ?. 454 * 455 * @param questionId the question ID 456 * @param userId the user ID 457 * @return the number of matching polls votes 458 * @throws SystemException if a system exception occurred 459 */ 460 public int countByQ_U(long questionId, long userId) 461 throws com.liferay.portal.kernel.exception.SystemException; 462 463 /** 464 * Returns the number of polls votes. 465 * 466 * @return the number of polls votes 467 * @throws SystemException if a system exception occurred 468 */ 469 public int countAll() 470 throws com.liferay.portal.kernel.exception.SystemException; 471 472 public PollsVote remove(PollsVote pollsVote) throws SystemException; 473 }