001 /** 002 * Copyright (c) 2000-2012 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.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.PollsChoice; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the polls choice service. This utility wraps {@link PollsChoicePersistenceImpl} 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 PollsChoicePersistence 037 * @see PollsChoicePersistenceImpl 038 * @generated 039 */ 040 public class PollsChoiceUtil { 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(PollsChoice pollsChoice) { 058 getPersistence().clearCache(pollsChoice); 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<PollsChoice> 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<PollsChoice> 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<PollsChoice> 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#update(com.liferay.portal.model.BaseModel) 099 */ 100 public static PollsChoice update(PollsChoice pollsChoice) 101 throws SystemException { 102 return getPersistence().update(pollsChoice); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 107 */ 108 public static PollsChoice update(PollsChoice pollsChoice, 109 ServiceContext serviceContext) throws SystemException { 110 return getPersistence().update(pollsChoice, serviceContext); 111 } 112 113 /** 114 * Returns all the polls choices where uuid = ?. 115 * 116 * @param uuid the uuid 117 * @return the matching polls choices 118 * @throws SystemException if a system exception occurred 119 */ 120 public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid( 121 java.lang.String uuid) 122 throws com.liferay.portal.kernel.exception.SystemException { 123 return getPersistence().findByUuid(uuid); 124 } 125 126 /** 127 * Returns a range of all the polls choices where uuid = ?. 128 * 129 * <p> 130 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsChoiceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 131 * </p> 132 * 133 * @param uuid the uuid 134 * @param start the lower bound of the range of polls choices 135 * @param end the upper bound of the range of polls choices (not inclusive) 136 * @return the range of matching polls choices 137 * @throws SystemException if a system exception occurred 138 */ 139 public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid( 140 java.lang.String uuid, int start, int end) 141 throws com.liferay.portal.kernel.exception.SystemException { 142 return getPersistence().findByUuid(uuid, start, end); 143 } 144 145 /** 146 * Returns an ordered range of all the polls choices where uuid = ?. 147 * 148 * <p> 149 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsChoiceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 150 * </p> 151 * 152 * @param uuid the uuid 153 * @param start the lower bound of the range of polls choices 154 * @param end the upper bound of the range of polls choices (not inclusive) 155 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 156 * @return the ordered range of matching polls choices 157 * @throws SystemException if a system exception occurred 158 */ 159 public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByUuid( 160 java.lang.String uuid, int start, int end, 161 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 162 throws com.liferay.portal.kernel.exception.SystemException { 163 return getPersistence().findByUuid(uuid, start, end, orderByComparator); 164 } 165 166 /** 167 * Returns the first polls choice in the ordered set where uuid = ?. 168 * 169 * @param uuid the uuid 170 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 171 * @return the first matching polls choice 172 * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found 173 * @throws SystemException if a system exception occurred 174 */ 175 public static com.liferay.portlet.polls.model.PollsChoice findByUuid_First( 176 java.lang.String uuid, 177 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 178 throws com.liferay.portal.kernel.exception.SystemException, 179 com.liferay.portlet.polls.NoSuchChoiceException { 180 return getPersistence().findByUuid_First(uuid, orderByComparator); 181 } 182 183 /** 184 * Returns the first polls choice in the ordered set where uuid = ?. 185 * 186 * @param uuid the uuid 187 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 188 * @return the first matching polls choice, or <code>null</code> if a matching polls choice could not be found 189 * @throws SystemException if a system exception occurred 190 */ 191 public static com.liferay.portlet.polls.model.PollsChoice fetchByUuid_First( 192 java.lang.String uuid, 193 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 194 throws com.liferay.portal.kernel.exception.SystemException { 195 return getPersistence().fetchByUuid_First(uuid, orderByComparator); 196 } 197 198 /** 199 * Returns the last polls choice in the ordered set where uuid = ?. 200 * 201 * @param uuid the uuid 202 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 203 * @return the last matching polls choice 204 * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found 205 * @throws SystemException if a system exception occurred 206 */ 207 public static com.liferay.portlet.polls.model.PollsChoice findByUuid_Last( 208 java.lang.String uuid, 209 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 210 throws com.liferay.portal.kernel.exception.SystemException, 211 com.liferay.portlet.polls.NoSuchChoiceException { 212 return getPersistence().findByUuid_Last(uuid, orderByComparator); 213 } 214 215 /** 216 * Returns the last polls choice in the ordered set where uuid = ?. 217 * 218 * @param uuid the uuid 219 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 220 * @return the last matching polls choice, or <code>null</code> if a matching polls choice could not be found 221 * @throws SystemException if a system exception occurred 222 */ 223 public static com.liferay.portlet.polls.model.PollsChoice fetchByUuid_Last( 224 java.lang.String uuid, 225 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 226 throws com.liferay.portal.kernel.exception.SystemException { 227 return getPersistence().fetchByUuid_Last(uuid, orderByComparator); 228 } 229 230 /** 231 * Returns the polls choices before and after the current polls choice in the ordered set where uuid = ?. 232 * 233 * @param choiceId the primary key of the current polls choice 234 * @param uuid the uuid 235 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 236 * @return the previous, current, and next polls choice 237 * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found 238 * @throws SystemException if a system exception occurred 239 */ 240 public static com.liferay.portlet.polls.model.PollsChoice[] findByUuid_PrevAndNext( 241 long choiceId, java.lang.String uuid, 242 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 243 throws com.liferay.portal.kernel.exception.SystemException, 244 com.liferay.portlet.polls.NoSuchChoiceException { 245 return getPersistence() 246 .findByUuid_PrevAndNext(choiceId, uuid, orderByComparator); 247 } 248 249 /** 250 * Removes all the polls choices where uuid = ? from the database. 251 * 252 * @param uuid the uuid 253 * @throws SystemException if a system exception occurred 254 */ 255 public static void removeByUuid(java.lang.String uuid) 256 throws com.liferay.portal.kernel.exception.SystemException { 257 getPersistence().removeByUuid(uuid); 258 } 259 260 /** 261 * Returns the number of polls choices where uuid = ?. 262 * 263 * @param uuid the uuid 264 * @return the number of matching polls choices 265 * @throws SystemException if a system exception occurred 266 */ 267 public static int countByUuid(java.lang.String uuid) 268 throws com.liferay.portal.kernel.exception.SystemException { 269 return getPersistence().countByUuid(uuid); 270 } 271 272 /** 273 * Returns all the polls choices where questionId = ?. 274 * 275 * @param questionId the question ID 276 * @return the matching polls choices 277 * @throws SystemException if a system exception occurred 278 */ 279 public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId( 280 long questionId) 281 throws com.liferay.portal.kernel.exception.SystemException { 282 return getPersistence().findByQuestionId(questionId); 283 } 284 285 /** 286 * Returns a range of all the polls choices where questionId = ?. 287 * 288 * <p> 289 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsChoiceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 290 * </p> 291 * 292 * @param questionId the question ID 293 * @param start the lower bound of the range of polls choices 294 * @param end the upper bound of the range of polls choices (not inclusive) 295 * @return the range of matching polls choices 296 * @throws SystemException if a system exception occurred 297 */ 298 public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId( 299 long questionId, int start, int end) 300 throws com.liferay.portal.kernel.exception.SystemException { 301 return getPersistence().findByQuestionId(questionId, start, end); 302 } 303 304 /** 305 * Returns an ordered range of all the polls choices where questionId = ?. 306 * 307 * <p> 308 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsChoiceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 309 * </p> 310 * 311 * @param questionId the question ID 312 * @param start the lower bound of the range of polls choices 313 * @param end the upper bound of the range of polls choices (not inclusive) 314 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 315 * @return the ordered range of matching polls choices 316 * @throws SystemException if a system exception occurred 317 */ 318 public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findByQuestionId( 319 long questionId, int start, int end, 320 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 321 throws com.liferay.portal.kernel.exception.SystemException { 322 return getPersistence() 323 .findByQuestionId(questionId, start, end, orderByComparator); 324 } 325 326 /** 327 * Returns the first polls choice in the ordered set where questionId = ?. 328 * 329 * @param questionId the question ID 330 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 331 * @return the first matching polls choice 332 * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found 333 * @throws SystemException if a system exception occurred 334 */ 335 public static com.liferay.portlet.polls.model.PollsChoice findByQuestionId_First( 336 long questionId, 337 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 338 throws com.liferay.portal.kernel.exception.SystemException, 339 com.liferay.portlet.polls.NoSuchChoiceException { 340 return getPersistence() 341 .findByQuestionId_First(questionId, orderByComparator); 342 } 343 344 /** 345 * Returns the first polls choice in the ordered set where questionId = ?. 346 * 347 * @param questionId the question ID 348 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 349 * @return the first matching polls choice, or <code>null</code> if a matching polls choice could not be found 350 * @throws SystemException if a system exception occurred 351 */ 352 public static com.liferay.portlet.polls.model.PollsChoice fetchByQuestionId_First( 353 long questionId, 354 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 355 throws com.liferay.portal.kernel.exception.SystemException { 356 return getPersistence() 357 .fetchByQuestionId_First(questionId, orderByComparator); 358 } 359 360 /** 361 * Returns the last polls choice in the ordered set where questionId = ?. 362 * 363 * @param questionId the question ID 364 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 365 * @return the last matching polls choice 366 * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found 367 * @throws SystemException if a system exception occurred 368 */ 369 public static com.liferay.portlet.polls.model.PollsChoice findByQuestionId_Last( 370 long questionId, 371 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 372 throws com.liferay.portal.kernel.exception.SystemException, 373 com.liferay.portlet.polls.NoSuchChoiceException { 374 return getPersistence() 375 .findByQuestionId_Last(questionId, orderByComparator); 376 } 377 378 /** 379 * Returns the last polls choice in the ordered set where questionId = ?. 380 * 381 * @param questionId the question ID 382 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 383 * @return the last matching polls choice, or <code>null</code> if a matching polls choice could not be found 384 * @throws SystemException if a system exception occurred 385 */ 386 public static com.liferay.portlet.polls.model.PollsChoice fetchByQuestionId_Last( 387 long questionId, 388 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 389 throws com.liferay.portal.kernel.exception.SystemException { 390 return getPersistence() 391 .fetchByQuestionId_Last(questionId, orderByComparator); 392 } 393 394 /** 395 * Returns the polls choices before and after the current polls choice in the ordered set where questionId = ?. 396 * 397 * @param choiceId the primary key of the current polls choice 398 * @param questionId the question ID 399 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 400 * @return the previous, current, and next polls choice 401 * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found 402 * @throws SystemException if a system exception occurred 403 */ 404 public static com.liferay.portlet.polls.model.PollsChoice[] findByQuestionId_PrevAndNext( 405 long choiceId, long questionId, 406 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 407 throws com.liferay.portal.kernel.exception.SystemException, 408 com.liferay.portlet.polls.NoSuchChoiceException { 409 return getPersistence() 410 .findByQuestionId_PrevAndNext(choiceId, questionId, 411 orderByComparator); 412 } 413 414 /** 415 * Removes all the polls choices where questionId = ? from the database. 416 * 417 * @param questionId the question ID 418 * @throws SystemException if a system exception occurred 419 */ 420 public static void removeByQuestionId(long questionId) 421 throws com.liferay.portal.kernel.exception.SystemException { 422 getPersistence().removeByQuestionId(questionId); 423 } 424 425 /** 426 * Returns the number of polls choices where questionId = ?. 427 * 428 * @param questionId the question ID 429 * @return the number of matching polls choices 430 * @throws SystemException if a system exception occurred 431 */ 432 public static int countByQuestionId(long questionId) 433 throws com.liferay.portal.kernel.exception.SystemException { 434 return getPersistence().countByQuestionId(questionId); 435 } 436 437 /** 438 * Returns the polls choice where questionId = ? and name = ? or throws a {@link com.liferay.portlet.polls.NoSuchChoiceException} if it could not be found. 439 * 440 * @param questionId the question ID 441 * @param name the name 442 * @return the matching polls choice 443 * @throws com.liferay.portlet.polls.NoSuchChoiceException if a matching polls choice could not be found 444 * @throws SystemException if a system exception occurred 445 */ 446 public static com.liferay.portlet.polls.model.PollsChoice findByQ_N( 447 long questionId, java.lang.String name) 448 throws com.liferay.portal.kernel.exception.SystemException, 449 com.liferay.portlet.polls.NoSuchChoiceException { 450 return getPersistence().findByQ_N(questionId, name); 451 } 452 453 /** 454 * Returns the polls choice where questionId = ? and name = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 455 * 456 * @param questionId the question ID 457 * @param name the name 458 * @return the matching polls choice, or <code>null</code> if a matching polls choice could not be found 459 * @throws SystemException if a system exception occurred 460 */ 461 public static com.liferay.portlet.polls.model.PollsChoice fetchByQ_N( 462 long questionId, java.lang.String name) 463 throws com.liferay.portal.kernel.exception.SystemException { 464 return getPersistence().fetchByQ_N(questionId, name); 465 } 466 467 /** 468 * Returns the polls choice where questionId = ? and name = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 469 * 470 * @param questionId the question ID 471 * @param name the name 472 * @param retrieveFromCache whether to use the finder cache 473 * @return the matching polls choice, or <code>null</code> if a matching polls choice could not be found 474 * @throws SystemException if a system exception occurred 475 */ 476 public static com.liferay.portlet.polls.model.PollsChoice fetchByQ_N( 477 long questionId, java.lang.String name, boolean retrieveFromCache) 478 throws com.liferay.portal.kernel.exception.SystemException { 479 return getPersistence().fetchByQ_N(questionId, name, retrieveFromCache); 480 } 481 482 /** 483 * Removes the polls choice where questionId = ? and name = ? from the database. 484 * 485 * @param questionId the question ID 486 * @param name the name 487 * @return the polls choice that was removed 488 * @throws SystemException if a system exception occurred 489 */ 490 public static com.liferay.portlet.polls.model.PollsChoice removeByQ_N( 491 long questionId, java.lang.String name) 492 throws com.liferay.portal.kernel.exception.SystemException, 493 com.liferay.portlet.polls.NoSuchChoiceException { 494 return getPersistence().removeByQ_N(questionId, name); 495 } 496 497 /** 498 * Returns the number of polls choices where questionId = ? and name = ?. 499 * 500 * @param questionId the question ID 501 * @param name the name 502 * @return the number of matching polls choices 503 * @throws SystemException if a system exception occurred 504 */ 505 public static int countByQ_N(long questionId, java.lang.String name) 506 throws com.liferay.portal.kernel.exception.SystemException { 507 return getPersistence().countByQ_N(questionId, name); 508 } 509 510 /** 511 * Caches the polls choice in the entity cache if it is enabled. 512 * 513 * @param pollsChoice the polls choice 514 */ 515 public static void cacheResult( 516 com.liferay.portlet.polls.model.PollsChoice pollsChoice) { 517 getPersistence().cacheResult(pollsChoice); 518 } 519 520 /** 521 * Caches the polls choices in the entity cache if it is enabled. 522 * 523 * @param pollsChoices the polls choices 524 */ 525 public static void cacheResult( 526 java.util.List<com.liferay.portlet.polls.model.PollsChoice> pollsChoices) { 527 getPersistence().cacheResult(pollsChoices); 528 } 529 530 /** 531 * Creates a new polls choice with the primary key. Does not add the polls choice to the database. 532 * 533 * @param choiceId the primary key for the new polls choice 534 * @return the new polls choice 535 */ 536 public static com.liferay.portlet.polls.model.PollsChoice create( 537 long choiceId) { 538 return getPersistence().create(choiceId); 539 } 540 541 /** 542 * Removes the polls choice with the primary key from the database. Also notifies the appropriate model listeners. 543 * 544 * @param choiceId the primary key of the polls choice 545 * @return the polls choice that was removed 546 * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found 547 * @throws SystemException if a system exception occurred 548 */ 549 public static com.liferay.portlet.polls.model.PollsChoice remove( 550 long choiceId) 551 throws com.liferay.portal.kernel.exception.SystemException, 552 com.liferay.portlet.polls.NoSuchChoiceException { 553 return getPersistence().remove(choiceId); 554 } 555 556 public static com.liferay.portlet.polls.model.PollsChoice updateImpl( 557 com.liferay.portlet.polls.model.PollsChoice pollsChoice) 558 throws com.liferay.portal.kernel.exception.SystemException { 559 return getPersistence().updateImpl(pollsChoice); 560 } 561 562 /** 563 * Returns the polls choice with the primary key or throws a {@link com.liferay.portlet.polls.NoSuchChoiceException} if it could not be found. 564 * 565 * @param choiceId the primary key of the polls choice 566 * @return the polls choice 567 * @throws com.liferay.portlet.polls.NoSuchChoiceException if a polls choice with the primary key could not be found 568 * @throws SystemException if a system exception occurred 569 */ 570 public static com.liferay.portlet.polls.model.PollsChoice findByPrimaryKey( 571 long choiceId) 572 throws com.liferay.portal.kernel.exception.SystemException, 573 com.liferay.portlet.polls.NoSuchChoiceException { 574 return getPersistence().findByPrimaryKey(choiceId); 575 } 576 577 /** 578 * Returns the polls choice with the primary key or returns <code>null</code> if it could not be found. 579 * 580 * @param choiceId the primary key of the polls choice 581 * @return the polls choice, or <code>null</code> if a polls choice with the primary key could not be found 582 * @throws SystemException if a system exception occurred 583 */ 584 public static com.liferay.portlet.polls.model.PollsChoice fetchByPrimaryKey( 585 long choiceId) 586 throws com.liferay.portal.kernel.exception.SystemException { 587 return getPersistence().fetchByPrimaryKey(choiceId); 588 } 589 590 /** 591 * Returns all the polls choices. 592 * 593 * @return the polls choices 594 * @throws SystemException if a system exception occurred 595 */ 596 public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll() 597 throws com.liferay.portal.kernel.exception.SystemException { 598 return getPersistence().findAll(); 599 } 600 601 /** 602 * Returns a range of all the polls choices. 603 * 604 * <p> 605 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsChoiceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 606 * </p> 607 * 608 * @param start the lower bound of the range of polls choices 609 * @param end the upper bound of the range of polls choices (not inclusive) 610 * @return the range of polls choices 611 * @throws SystemException if a system exception occurred 612 */ 613 public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll( 614 int start, int end) 615 throws com.liferay.portal.kernel.exception.SystemException { 616 return getPersistence().findAll(start, end); 617 } 618 619 /** 620 * Returns an ordered range of all the polls choices. 621 * 622 * <p> 623 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.polls.model.impl.PollsChoiceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 624 * </p> 625 * 626 * @param start the lower bound of the range of polls choices 627 * @param end the upper bound of the range of polls choices (not inclusive) 628 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 629 * @return the ordered range of polls choices 630 * @throws SystemException if a system exception occurred 631 */ 632 public static java.util.List<com.liferay.portlet.polls.model.PollsChoice> findAll( 633 int start, int end, 634 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 635 throws com.liferay.portal.kernel.exception.SystemException { 636 return getPersistence().findAll(start, end, orderByComparator); 637 } 638 639 /** 640 * Removes all the polls choices from the database. 641 * 642 * @throws SystemException if a system exception occurred 643 */ 644 public static void removeAll() 645 throws com.liferay.portal.kernel.exception.SystemException { 646 getPersistence().removeAll(); 647 } 648 649 /** 650 * Returns the number of polls choices. 651 * 652 * @return the number of polls choices 653 * @throws SystemException if a system exception occurred 654 */ 655 public static int countAll() 656 throws com.liferay.portal.kernel.exception.SystemException { 657 return getPersistence().countAll(); 658 } 659 660 public static PollsChoicePersistence getPersistence() { 661 if (_persistence == null) { 662 _persistence = (PollsChoicePersistence)PortalBeanLocatorUtil.locate(PollsChoicePersistence.class.getName()); 663 664 ReferenceRegistry.registerReference(PollsChoiceUtil.class, 665 "_persistence"); 666 } 667 668 return _persistence; 669 } 670 671 /** 672 * @deprecated 673 */ 674 public void setPersistence(PollsChoicePersistence persistence) { 675 } 676 677 private static PollsChoicePersistence _persistence; 678 }