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