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