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