001 /** 002 * Copyright (c) 2000-2011 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.kernel.exception.SystemException; 018 import com.liferay.portal.service.persistence.BasePersistence; 019 020 import com.liferay.portlet.shopping.model.ShoppingCart; 021 022 /** 023 * The persistence interface for the shopping cart service. 024 * 025 * <p> 026 * Caching information and settings can be found in <code>portal.properties</code> 027 * </p> 028 * 029 * @author Brian Wing Shun Chan 030 * @see ShoppingCartPersistenceImpl 031 * @see ShoppingCartUtil 032 * @generated 033 */ 034 public interface ShoppingCartPersistence extends BasePersistence<ShoppingCart> { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * 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. 039 */ 040 041 /** 042 * Caches the shopping cart in the entity cache if it is enabled. 043 * 044 * @param shoppingCart the shopping cart 045 */ 046 public void cacheResult( 047 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart); 048 049 /** 050 * Caches the shopping carts in the entity cache if it is enabled. 051 * 052 * @param shoppingCarts the shopping carts 053 */ 054 public void cacheResult( 055 java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts); 056 057 /** 058 * Creates a new shopping cart with the primary key. Does not add the shopping cart to the database. 059 * 060 * @param cartId the primary key for the new shopping cart 061 * @return the new shopping cart 062 */ 063 public com.liferay.portlet.shopping.model.ShoppingCart create(long cartId); 064 065 /** 066 * Removes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners. 067 * 068 * @param cartId the primary key of the shopping cart 069 * @return the shopping cart that was removed 070 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 071 * @throws SystemException if a system exception occurred 072 */ 073 public com.liferay.portlet.shopping.model.ShoppingCart remove(long cartId) 074 throws com.liferay.portal.kernel.exception.SystemException, 075 com.liferay.portlet.shopping.NoSuchCartException; 076 077 public com.liferay.portlet.shopping.model.ShoppingCart updateImpl( 078 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart, 079 boolean merge) 080 throws com.liferay.portal.kernel.exception.SystemException; 081 082 /** 083 * Returns the shopping cart with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 084 * 085 * @param cartId the primary key of the shopping cart 086 * @return the shopping cart 087 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 088 * @throws SystemException if a system exception occurred 089 */ 090 public com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey( 091 long cartId) 092 throws com.liferay.portal.kernel.exception.SystemException, 093 com.liferay.portlet.shopping.NoSuchCartException; 094 095 /** 096 * Returns the shopping cart with the primary key or returns <code>null</code> if it could not be found. 097 * 098 * @param cartId the primary key of the shopping cart 099 * @return the shopping cart, or <code>null</code> if a shopping cart with the primary key could not be found 100 * @throws SystemException if a system exception occurred 101 */ 102 public com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey( 103 long cartId) throws com.liferay.portal.kernel.exception.SystemException; 104 105 /** 106 * Returns all the shopping carts where groupId = ?. 107 * 108 * @param groupId the group ID 109 * @return the matching shopping carts 110 * @throws SystemException if a system exception occurred 111 */ 112 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 113 long groupId) 114 throws com.liferay.portal.kernel.exception.SystemException; 115 116 /** 117 * Returns a range of all the shopping carts where groupId = ?. 118 * 119 * <p> 120 * 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. 121 * </p> 122 * 123 * @param groupId the group ID 124 * @param start the lower bound of the range of shopping carts 125 * @param end the upper bound of the range of shopping carts (not inclusive) 126 * @return the range of matching shopping carts 127 * @throws SystemException if a system exception occurred 128 */ 129 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 130 long groupId, int start, int end) 131 throws com.liferay.portal.kernel.exception.SystemException; 132 133 /** 134 * Returns an ordered range of all the shopping carts where groupId = ?. 135 * 136 * <p> 137 * 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. 138 * </p> 139 * 140 * @param groupId the group ID 141 * @param start the lower bound of the range of shopping carts 142 * @param end the upper bound of the range of shopping carts (not inclusive) 143 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 144 * @return the ordered range of matching shopping carts 145 * @throws SystemException if a system exception occurred 146 */ 147 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 148 long groupId, int start, int end, 149 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 150 throws com.liferay.portal.kernel.exception.SystemException; 151 152 /** 153 * Returns the first shopping cart in the ordered set where groupId = ?. 154 * 155 * <p> 156 * 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. 157 * </p> 158 * 159 * @param groupId the group ID 160 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 161 * @return the first matching shopping cart 162 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 163 * @throws SystemException if a system exception occurred 164 */ 165 public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First( 166 long groupId, 167 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 168 throws com.liferay.portal.kernel.exception.SystemException, 169 com.liferay.portlet.shopping.NoSuchCartException; 170 171 /** 172 * Returns the last shopping cart in the ordered set where groupId = ?. 173 * 174 * <p> 175 * 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. 176 * </p> 177 * 178 * @param groupId the group ID 179 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 180 * @return the last matching shopping cart 181 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 182 * @throws SystemException if a system exception occurred 183 */ 184 public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last( 185 long groupId, 186 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 187 throws com.liferay.portal.kernel.exception.SystemException, 188 com.liferay.portlet.shopping.NoSuchCartException; 189 190 /** 191 * Returns the shopping carts before and after the current shopping cart in the ordered set where groupId = ?. 192 * 193 * <p> 194 * 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. 195 * </p> 196 * 197 * @param cartId the primary key of the current shopping cart 198 * @param groupId the group ID 199 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 200 * @return the previous, current, and next shopping cart 201 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 202 * @throws SystemException if a system exception occurred 203 */ 204 public com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext( 205 long cartId, long groupId, 206 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 207 throws com.liferay.portal.kernel.exception.SystemException, 208 com.liferay.portlet.shopping.NoSuchCartException; 209 210 /** 211 * Returns all the shopping carts where userId = ?. 212 * 213 * @param userId the user ID 214 * @return the matching shopping carts 215 * @throws SystemException if a system exception occurred 216 */ 217 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 218 long userId) throws com.liferay.portal.kernel.exception.SystemException; 219 220 /** 221 * Returns a range of all the shopping carts where userId = ?. 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 userId the user ID 228 * @param start the lower bound of the range of shopping carts 229 * @param end the upper bound of the range of shopping carts (not inclusive) 230 * @return the range of matching shopping carts 231 * @throws SystemException if a system exception occurred 232 */ 233 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 234 long userId, int start, int end) 235 throws com.liferay.portal.kernel.exception.SystemException; 236 237 /** 238 * Returns an ordered range of all the shopping carts where userId = ?. 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 userId the user ID 245 * @param start the lower bound of the range of shopping carts 246 * @param end the upper bound of the range of shopping carts (not inclusive) 247 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 248 * @return the ordered range of matching shopping carts 249 * @throws SystemException if a system exception occurred 250 */ 251 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 252 long userId, 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 shopping cart in the ordered set where userId = ?. 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 userId the user ID 264 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 265 * @return the first matching shopping cart 266 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 267 * @throws SystemException if a system exception occurred 268 */ 269 public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First( 270 long userId, 271 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 272 throws com.liferay.portal.kernel.exception.SystemException, 273 com.liferay.portlet.shopping.NoSuchCartException; 274 275 /** 276 * Returns the last shopping cart in the ordered set where userId = ?. 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 userId the user ID 283 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 284 * @return the last matching shopping cart 285 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 286 * @throws SystemException if a system exception occurred 287 */ 288 public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last( 289 long userId, 290 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 291 throws com.liferay.portal.kernel.exception.SystemException, 292 com.liferay.portlet.shopping.NoSuchCartException; 293 294 /** 295 * Returns the shopping carts before and after the current shopping cart in the ordered set where userId = ?. 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 cartId the primary key of the current shopping cart 302 * @param userId the user ID 303 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 304 * @return the previous, current, and next shopping cart 305 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 306 * @throws SystemException if a system exception occurred 307 */ 308 public com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext( 309 long cartId, long userId, 310 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 311 throws com.liferay.portal.kernel.exception.SystemException, 312 com.liferay.portlet.shopping.NoSuchCartException; 313 314 /** 315 * Returns the shopping cart where groupId = ? and userId = ? or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 316 * 317 * @param groupId the group ID 318 * @param userId the user ID 319 * @return the matching shopping cart 320 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 321 * @throws SystemException if a system exception occurred 322 */ 323 public com.liferay.portlet.shopping.model.ShoppingCart findByG_U( 324 long groupId, long userId) 325 throws com.liferay.portal.kernel.exception.SystemException, 326 com.liferay.portlet.shopping.NoSuchCartException; 327 328 /** 329 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 330 * 331 * @param groupId the group ID 332 * @param userId the user ID 333 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 334 * @throws SystemException if a system exception occurred 335 */ 336 public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 337 long groupId, long userId) 338 throws com.liferay.portal.kernel.exception.SystemException; 339 340 /** 341 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 342 * 343 * @param groupId the group ID 344 * @param userId the user ID 345 * @param retrieveFromCache whether to use the finder cache 346 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 347 * @throws SystemException if a system exception occurred 348 */ 349 public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 350 long groupId, long userId, boolean retrieveFromCache) 351 throws com.liferay.portal.kernel.exception.SystemException; 352 353 /** 354 * Returns all the shopping carts. 355 * 356 * @return the shopping carts 357 * @throws SystemException if a system exception occurred 358 */ 359 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll() 360 throws com.liferay.portal.kernel.exception.SystemException; 361 362 /** 363 * Returns a range of all the shopping carts. 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 shopping carts 370 * @param end the upper bound of the range of shopping carts (not inclusive) 371 * @return the range of shopping carts 372 * @throws SystemException if a system exception occurred 373 */ 374 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 375 int start, int end) 376 throws com.liferay.portal.kernel.exception.SystemException; 377 378 /** 379 * Returns an ordered range of all the shopping carts. 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 shopping carts 386 * @param end the upper bound of the range of shopping carts (not inclusive) 387 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 388 * @return the ordered range of shopping carts 389 * @throws SystemException if a system exception occurred 390 */ 391 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> 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 shopping carts where groupId = ? from the database. 398 * 399 * @param groupId the group ID 400 * @throws SystemException if a system exception occurred 401 */ 402 public void removeByGroupId(long groupId) 403 throws com.liferay.portal.kernel.exception.SystemException; 404 405 /** 406 * Removes all the shopping carts where userId = ? from the database. 407 * 408 * @param userId the user ID 409 * @throws SystemException if a system exception occurred 410 */ 411 public void removeByUserId(long userId) 412 throws com.liferay.portal.kernel.exception.SystemException; 413 414 /** 415 * Removes the shopping cart where groupId = ? and userId = ? from the database. 416 * 417 * @param groupId the group ID 418 * @param userId the user ID 419 * @throws SystemException if a system exception occurred 420 */ 421 public void removeByG_U(long groupId, long userId) 422 throws com.liferay.portal.kernel.exception.SystemException, 423 com.liferay.portlet.shopping.NoSuchCartException; 424 425 /** 426 * Removes all the shopping carts 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 shopping carts where groupId = ?. 435 * 436 * @param groupId the group ID 437 * @return the number of matching shopping carts 438 * @throws SystemException if a system exception occurred 439 */ 440 public int countByGroupId(long groupId) 441 throws com.liferay.portal.kernel.exception.SystemException; 442 443 /** 444 * Returns the number of shopping carts where userId = ?. 445 * 446 * @param userId the user ID 447 * @return the number of matching shopping carts 448 * @throws SystemException if a system exception occurred 449 */ 450 public int countByUserId(long userId) 451 throws com.liferay.portal.kernel.exception.SystemException; 452 453 /** 454 * Returns the number of shopping carts where groupId = ? and userId = ?. 455 * 456 * @param groupId the group ID 457 * @param userId the user ID 458 * @return the number of matching shopping carts 459 * @throws SystemException if a system exception occurred 460 */ 461 public int countByG_U(long groupId, long userId) 462 throws com.liferay.portal.kernel.exception.SystemException; 463 464 /** 465 * Returns the number of shopping carts. 466 * 467 * @return the number of shopping carts 468 * @throws SystemException if a system exception occurred 469 */ 470 public int countAll() 471 throws com.liferay.portal.kernel.exception.SystemException; 472 473 public ShoppingCart remove(ShoppingCart shoppingCart) 474 throws SystemException; 475 }