001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portlet.polls.service.persistence; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.kernel.util.ReferenceRegistry; 022 import com.liferay.portal.service.ServiceContext; 023 024 import com.liferay.portlet.polls.model.PollsVote; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the polls vote service. This utility wraps {@link PollsVotePersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see PollsVotePersistence 037 * @see PollsVotePersistenceImpl 038 * @generated 039 */ 040 public class PollsVoteUtil { 041 /* 042 * NOTE FOR DEVELOPERS: 043 * 044 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 045 */ 046 047 /** 048 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 049 */ 050 public static void clearCache() { 051 getPersistence().clearCache(); 052 } 053 054 /** 055 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 056 */ 057 public static void clearCache(PollsVote pollsVote) { 058 getPersistence().clearCache(pollsVote); 059 } 060 061 /** 062 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 063 */ 064 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 065 throws SystemException { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<PollsVote> findWithDynamicQuery( 073 DynamicQuery dynamicQuery) throws SystemException { 074 return getPersistence().findWithDynamicQuery(dynamicQuery); 075 } 076 077 /** 078 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 079 */ 080 public static List<PollsVote> findWithDynamicQuery( 081 DynamicQuery dynamicQuery, int start, int end) 082 throws SystemException { 083 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 084 } 085 086 /** 087 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 088 */ 089 public static List<PollsVote> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator orderByComparator) throws SystemException { 092 return getPersistence() 093 .findWithDynamicQuery(dynamicQuery, start, end, 094 orderByComparator); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 099 */ 100 public static PollsVote remove(PollsVote pollsVote) 101 throws SystemException { 102 return getPersistence().remove(pollsVote); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 107 */ 108 public static PollsVote update(PollsVote pollsVote, boolean merge) 109 throws SystemException { 110 return getPersistence().update(pollsVote, merge); 111 } 112 113 /** 114 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 115 */ 116 public static PollsVote update(PollsVote pollsVote, boolean merge, 117 ServiceContext serviceContext) throws SystemException { 118 return getPersistence().update(pollsVote, merge, serviceContext); 119 } 120 121 /** 122 * Caches the polls vote in the entity cache if it is enabled. 123 * 124 * @param pollsVote the polls vote to cache 125 */ 126 public static void cacheResult( 127 com.liferay.portlet.polls.model.PollsVote pollsVote) { 128 getPersistence().cacheResult(pollsVote); 129 } 130 131 /** 132 * Caches the polls votes in the entity cache if it is enabled. 133 * 134 * @param pollsVotes the polls votes to cache 135 */ 136 public static void cacheResult( 137 java.util.List<com.liferay.portlet.polls.model.PollsVote> pollsVotes) { 138 getPersistence().cacheResult(pollsVotes); 139 } 140 141 /** 142 * Creates a new polls vote with the primary key. Does not add the polls vote to the database. 143 * 144 * @param voteId the primary key for the new polls vote 145 * @return the new polls vote 146 */ 147 public static com.liferay.portlet.polls.model.PollsVote create(long voteId) { 148 return getPersistence().create(voteId); 149 } 150 151 /** 152 * Removes the polls vote with the primary key from the database. Also notifies the appropriate model listeners. 153 * 154 * @param voteId the primary key of the polls vote to remove 155 * @return the polls vote that was removed 156 * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found 157 * @throws SystemException if a system exception occurred 158 */ 159 public static com.liferay.portlet.polls.model.PollsVote remove(long voteId) 160 throws com.liferay.portal.kernel.exception.SystemException, 161 com.liferay.portlet.polls.NoSuchVoteException { 162 return getPersistence().remove(voteId); 163 } 164 165 public static com.liferay.portlet.polls.model.PollsVote updateImpl( 166 com.liferay.portlet.polls.model.PollsVote pollsVote, boolean merge) 167 throws com.liferay.portal.kernel.exception.SystemException { 168 return getPersistence().updateImpl(pollsVote, merge); 169 } 170 171 /** 172 * Finds the polls vote with the primary key or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found. 173 * 174 * @param voteId the primary key of the polls vote to find 175 * @return the polls vote 176 * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found 177 * @throws SystemException if a system exception occurred 178 */ 179 public static com.liferay.portlet.polls.model.PollsVote findByPrimaryKey( 180 long voteId) 181 throws com.liferay.portal.kernel.exception.SystemException, 182 com.liferay.portlet.polls.NoSuchVoteException { 183 return getPersistence().findByPrimaryKey(voteId); 184 } 185 186 /** 187 * Finds the polls vote with the primary key or returns <code>null</code> if it could not be found. 188 * 189 * @param voteId the primary key of the polls vote to find 190 * @return the polls vote, or <code>null</code> if a polls vote with the primary key could not be found 191 * @throws SystemException if a system exception occurred 192 */ 193 public static com.liferay.portlet.polls.model.PollsVote fetchByPrimaryKey( 194 long voteId) throws com.liferay.portal.kernel.exception.SystemException { 195 return getPersistence().fetchByPrimaryKey(voteId); 196 } 197 198 /** 199 * Finds all the polls votes where questionId = ?. 200 * 201 * @param questionId the question ID to search with 202 * @return the matching polls votes 203 * @throws SystemException if a system exception occurred 204 */ 205 public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId( 206 long questionId) 207 throws com.liferay.portal.kernel.exception.SystemException { 208 return getPersistence().findByQuestionId(questionId); 209 } 210 211 /** 212 * Finds a range of all the polls votes where questionId = ?. 213 * 214 * <p> 215 * 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. 216 * </p> 217 * 218 * @param questionId the question ID to search with 219 * @param start the lower bound of the range of polls votes to return 220 * @param end the upper bound of the range of polls votes to return (not inclusive) 221 * @return the range of matching polls votes 222 * @throws SystemException if a system exception occurred 223 */ 224 public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId( 225 long questionId, int start, int end) 226 throws com.liferay.portal.kernel.exception.SystemException { 227 return getPersistence().findByQuestionId(questionId, start, end); 228 } 229 230 /** 231 * Finds an ordered range of all the polls votes where questionId = ?. 232 * 233 * <p> 234 * 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. 235 * </p> 236 * 237 * @param questionId the question ID to search with 238 * @param start the lower bound of the range of polls votes to return 239 * @param end the upper bound of the range of polls votes to return (not inclusive) 240 * @param orderByComparator the comparator to order the results by 241 * @return the ordered range of matching polls votes 242 * @throws SystemException if a system exception occurred 243 */ 244 public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByQuestionId( 245 long questionId, int start, int end, 246 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 247 throws com.liferay.portal.kernel.exception.SystemException { 248 return getPersistence() 249 .findByQuestionId(questionId, start, end, orderByComparator); 250 } 251 252 /** 253 * Finds the first polls vote in the ordered set where questionId = ?. 254 * 255 * <p> 256 * 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. 257 * </p> 258 * 259 * @param questionId the question ID to search with 260 * @param orderByComparator the comparator to order the set by 261 * @return the first matching polls vote 262 * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found 263 * @throws SystemException if a system exception occurred 264 */ 265 public static com.liferay.portlet.polls.model.PollsVote findByQuestionId_First( 266 long questionId, 267 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 268 throws com.liferay.portal.kernel.exception.SystemException, 269 com.liferay.portlet.polls.NoSuchVoteException { 270 return getPersistence() 271 .findByQuestionId_First(questionId, orderByComparator); 272 } 273 274 /** 275 * Finds the last polls vote in the ordered set where questionId = ?. 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 questionId the question ID to search with 282 * @param orderByComparator the comparator to order the set by 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 static com.liferay.portlet.polls.model.PollsVote findByQuestionId_Last( 288 long questionId, 289 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 290 throws com.liferay.portal.kernel.exception.SystemException, 291 com.liferay.portlet.polls.NoSuchVoteException { 292 return getPersistence() 293 .findByQuestionId_Last(questionId, orderByComparator); 294 } 295 296 /** 297 * Finds the polls votes before and after the current polls vote in the ordered set where questionId = ?. 298 * 299 * <p> 300 * 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. 301 * </p> 302 * 303 * @param voteId the primary key of the current polls vote 304 * @param questionId the question ID to search with 305 * @param orderByComparator the comparator to order the set by 306 * @return the previous, current, and next polls vote 307 * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found 308 * @throws SystemException if a system exception occurred 309 */ 310 public static com.liferay.portlet.polls.model.PollsVote[] findByQuestionId_PrevAndNext( 311 long voteId, long questionId, 312 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 313 throws com.liferay.portal.kernel.exception.SystemException, 314 com.liferay.portlet.polls.NoSuchVoteException { 315 return getPersistence() 316 .findByQuestionId_PrevAndNext(voteId, questionId, 317 orderByComparator); 318 } 319 320 /** 321 * Finds all the polls votes where choiceId = ?. 322 * 323 * @param choiceId the choice ID to search with 324 * @return the matching polls votes 325 * @throws SystemException if a system exception occurred 326 */ 327 public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId( 328 long choiceId) 329 throws com.liferay.portal.kernel.exception.SystemException { 330 return getPersistence().findByChoiceId(choiceId); 331 } 332 333 /** 334 * Finds a range of all the polls votes where choiceId = ?. 335 * 336 * <p> 337 * 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. 338 * </p> 339 * 340 * @param choiceId the choice ID to search with 341 * @param start the lower bound of the range of polls votes to return 342 * @param end the upper bound of the range of polls votes to return (not inclusive) 343 * @return the range of matching polls votes 344 * @throws SystemException if a system exception occurred 345 */ 346 public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId( 347 long choiceId, int start, int end) 348 throws com.liferay.portal.kernel.exception.SystemException { 349 return getPersistence().findByChoiceId(choiceId, start, end); 350 } 351 352 /** 353 * Finds an ordered range of all the polls votes where choiceId = ?. 354 * 355 * <p> 356 * 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. 357 * </p> 358 * 359 * @param choiceId the choice ID to search with 360 * @param start the lower bound of the range of polls votes to return 361 * @param end the upper bound of the range of polls votes to return (not inclusive) 362 * @param orderByComparator the comparator to order the results by 363 * @return the ordered range of matching polls votes 364 * @throws SystemException if a system exception occurred 365 */ 366 public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findByChoiceId( 367 long choiceId, int start, int end, 368 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 369 throws com.liferay.portal.kernel.exception.SystemException { 370 return getPersistence() 371 .findByChoiceId(choiceId, start, end, orderByComparator); 372 } 373 374 /** 375 * Finds the first polls vote in the ordered set where choiceId = ?. 376 * 377 * <p> 378 * 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. 379 * </p> 380 * 381 * @param choiceId the choice ID to search with 382 * @param orderByComparator the comparator to order the set by 383 * @return the first matching polls vote 384 * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found 385 * @throws SystemException if a system exception occurred 386 */ 387 public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_First( 388 long choiceId, 389 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 390 throws com.liferay.portal.kernel.exception.SystemException, 391 com.liferay.portlet.polls.NoSuchVoteException { 392 return getPersistence().findByChoiceId_First(choiceId, orderByComparator); 393 } 394 395 /** 396 * Finds the last polls vote in the ordered set where choiceId = ?. 397 * 398 * <p> 399 * 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. 400 * </p> 401 * 402 * @param choiceId the choice ID to search with 403 * @param orderByComparator the comparator to order the set by 404 * @return the last matching polls vote 405 * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found 406 * @throws SystemException if a system exception occurred 407 */ 408 public static com.liferay.portlet.polls.model.PollsVote findByChoiceId_Last( 409 long choiceId, 410 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 411 throws com.liferay.portal.kernel.exception.SystemException, 412 com.liferay.portlet.polls.NoSuchVoteException { 413 return getPersistence().findByChoiceId_Last(choiceId, orderByComparator); 414 } 415 416 /** 417 * Finds the polls votes before and after the current polls vote in the ordered set where choiceId = ?. 418 * 419 * <p> 420 * 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. 421 * </p> 422 * 423 * @param voteId the primary key of the current polls vote 424 * @param choiceId the choice ID to search with 425 * @param orderByComparator the comparator to order the set by 426 * @return the previous, current, and next polls vote 427 * @throws com.liferay.portlet.polls.NoSuchVoteException if a polls vote with the primary key could not be found 428 * @throws SystemException if a system exception occurred 429 */ 430 public static com.liferay.portlet.polls.model.PollsVote[] findByChoiceId_PrevAndNext( 431 long voteId, long choiceId, 432 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 433 throws com.liferay.portal.kernel.exception.SystemException, 434 com.liferay.portlet.polls.NoSuchVoteException { 435 return getPersistence() 436 .findByChoiceId_PrevAndNext(voteId, choiceId, 437 orderByComparator); 438 } 439 440 /** 441 * Finds the polls vote where questionId = ? and userId = ? or throws a {@link com.liferay.portlet.polls.NoSuchVoteException} if it could not be found. 442 * 443 * @param questionId the question ID to search with 444 * @param userId the user ID to search with 445 * @return the matching polls vote 446 * @throws com.liferay.portlet.polls.NoSuchVoteException if a matching polls vote could not be found 447 * @throws SystemException if a system exception occurred 448 */ 449 public static com.liferay.portlet.polls.model.PollsVote findByQ_U( 450 long questionId, long userId) 451 throws com.liferay.portal.kernel.exception.SystemException, 452 com.liferay.portlet.polls.NoSuchVoteException { 453 return getPersistence().findByQ_U(questionId, userId); 454 } 455 456 /** 457 * Finds the polls vote where questionId = ? and userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 458 * 459 * @param questionId the question ID to search with 460 * @param userId the user ID to search with 461 * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found 462 * @throws SystemException if a system exception occurred 463 */ 464 public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U( 465 long questionId, long userId) 466 throws com.liferay.portal.kernel.exception.SystemException { 467 return getPersistence().fetchByQ_U(questionId, userId); 468 } 469 470 /** 471 * Finds the polls vote where questionId = ? and userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 472 * 473 * @param questionId the question ID to search with 474 * @param userId the user ID to search with 475 * @return the matching polls vote, or <code>null</code> if a matching polls vote could not be found 476 * @throws SystemException if a system exception occurred 477 */ 478 public static com.liferay.portlet.polls.model.PollsVote fetchByQ_U( 479 long questionId, long userId, boolean retrieveFromCache) 480 throws com.liferay.portal.kernel.exception.SystemException { 481 return getPersistence().fetchByQ_U(questionId, userId, retrieveFromCache); 482 } 483 484 /** 485 * Finds all the polls votes. 486 * 487 * @return the polls votes 488 * @throws SystemException if a system exception occurred 489 */ 490 public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll() 491 throws com.liferay.portal.kernel.exception.SystemException { 492 return getPersistence().findAll(); 493 } 494 495 /** 496 * Finds a range of all the polls votes. 497 * 498 * <p> 499 * 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. 500 * </p> 501 * 502 * @param start the lower bound of the range of polls votes to return 503 * @param end the upper bound of the range of polls votes to return (not inclusive) 504 * @return the range of polls votes 505 * @throws SystemException if a system exception occurred 506 */ 507 public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll( 508 int start, int end) 509 throws com.liferay.portal.kernel.exception.SystemException { 510 return getPersistence().findAll(start, end); 511 } 512 513 /** 514 * Finds an ordered range of all the polls votes. 515 * 516 * <p> 517 * 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. 518 * </p> 519 * 520 * @param start the lower bound of the range of polls votes to return 521 * @param end the upper bound of the range of polls votes to return (not inclusive) 522 * @param orderByComparator the comparator to order the results by 523 * @return the ordered range of polls votes 524 * @throws SystemException if a system exception occurred 525 */ 526 public static java.util.List<com.liferay.portlet.polls.model.PollsVote> findAll( 527 int start, int end, 528 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 529 throws com.liferay.portal.kernel.exception.SystemException { 530 return getPersistence().findAll(start, end, orderByComparator); 531 } 532 533 /** 534 * Removes all the polls votes where questionId = ? from the database. 535 * 536 * @param questionId the question ID to search with 537 * @throws SystemException if a system exception occurred 538 */ 539 public static void removeByQuestionId(long questionId) 540 throws com.liferay.portal.kernel.exception.SystemException { 541 getPersistence().removeByQuestionId(questionId); 542 } 543 544 /** 545 * Removes all the polls votes where choiceId = ? from the database. 546 * 547 * @param choiceId the choice ID to search with 548 * @throws SystemException if a system exception occurred 549 */ 550 public static void removeByChoiceId(long choiceId) 551 throws com.liferay.portal.kernel.exception.SystemException { 552 getPersistence().removeByChoiceId(choiceId); 553 } 554 555 /** 556 * Removes the polls vote where questionId = ? and userId = ? from the database. 557 * 558 * @param questionId the question ID to search with 559 * @param userId the user ID to search with 560 * @throws SystemException if a system exception occurred 561 */ 562 public static void removeByQ_U(long questionId, long userId) 563 throws com.liferay.portal.kernel.exception.SystemException, 564 com.liferay.portlet.polls.NoSuchVoteException { 565 getPersistence().removeByQ_U(questionId, userId); 566 } 567 568 /** 569 * Removes all the polls votes from the database. 570 * 571 * @throws SystemException if a system exception occurred 572 */ 573 public static void removeAll() 574 throws com.liferay.portal.kernel.exception.SystemException { 575 getPersistence().removeAll(); 576 } 577 578 /** 579 * Counts all the polls votes where questionId = ?. 580 * 581 * @param questionId the question ID to search with 582 * @return the number of matching polls votes 583 * @throws SystemException if a system exception occurred 584 */ 585 public static int countByQuestionId(long questionId) 586 throws com.liferay.portal.kernel.exception.SystemException { 587 return getPersistence().countByQuestionId(questionId); 588 } 589 590 /** 591 * Counts all the polls votes where choiceId = ?. 592 * 593 * @param choiceId the choice ID to search with 594 * @return the number of matching polls votes 595 * @throws SystemException if a system exception occurred 596 */ 597 public static int countByChoiceId(long choiceId) 598 throws com.liferay.portal.kernel.exception.SystemException { 599 return getPersistence().countByChoiceId(choiceId); 600 } 601 602 /** 603 * Counts all the polls votes where questionId = ? and userId = ?. 604 * 605 * @param questionId the question ID to search with 606 * @param userId the user ID to search with 607 * @return the number of matching polls votes 608 * @throws SystemException if a system exception occurred 609 */ 610 public static int countByQ_U(long questionId, long userId) 611 throws com.liferay.portal.kernel.exception.SystemException { 612 return getPersistence().countByQ_U(questionId, userId); 613 } 614 615 /** 616 * Counts all the polls votes. 617 * 618 * @return the number of polls votes 619 * @throws SystemException if a system exception occurred 620 */ 621 public static int countAll() 622 throws com.liferay.portal.kernel.exception.SystemException { 623 return getPersistence().countAll(); 624 } 625 626 public static PollsVotePersistence getPersistence() { 627 if (_persistence == null) { 628 _persistence = (PollsVotePersistence)PortalBeanLocatorUtil.locate(PollsVotePersistence.class.getName()); 629 630 ReferenceRegistry.registerReference(PollsVoteUtil.class, 631 "_persistence"); 632 } 633 634 return _persistence; 635 } 636 637 public void setPersistence(PollsVotePersistence persistence) { 638 _persistence = persistence; 639 640 ReferenceRegistry.registerReference(PollsVoteUtil.class, "_persistence"); 641 } 642 643 private static PollsVotePersistence _persistence; 644 }