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