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.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 * <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 groupId the group ID 159 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 160 * @return the first matching shopping cart 161 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 162 * @throws SystemException if a system exception occurred 163 */ 164 public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First( 165 long groupId, 166 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 167 throws com.liferay.portal.kernel.exception.SystemException, 168 com.liferay.portlet.shopping.NoSuchCartException; 169 170 /** 171 * Returns the last shopping cart in the ordered set where groupId = ?. 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 groupId the group ID 178 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 179 * @return the last matching shopping cart 180 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 181 * @throws SystemException if a system exception occurred 182 */ 183 public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last( 184 long groupId, 185 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 186 throws com.liferay.portal.kernel.exception.SystemException, 187 com.liferay.portlet.shopping.NoSuchCartException; 188 189 /** 190 * Returns the shopping carts before and after the current shopping cart in the ordered set where groupId = ?. 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 cartId the primary key of the current shopping cart 197 * @param groupId the group ID 198 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 199 * @return the previous, current, and next shopping cart 200 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 201 * @throws SystemException if a system exception occurred 202 */ 203 public com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext( 204 long cartId, long groupId, 205 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 206 throws com.liferay.portal.kernel.exception.SystemException, 207 com.liferay.portlet.shopping.NoSuchCartException; 208 209 /** 210 * Returns all the shopping carts where userId = ?. 211 * 212 * @param userId the user ID 213 * @return the matching shopping carts 214 * @throws SystemException if a system exception occurred 215 */ 216 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 217 long userId) throws com.liferay.portal.kernel.exception.SystemException; 218 219 /** 220 * Returns a range of all the shopping carts where userId = ?. 221 * 222 * <p> 223 * 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. 224 * </p> 225 * 226 * @param userId the user ID 227 * @param start the lower bound of the range of shopping carts 228 * @param end the upper bound of the range of shopping carts (not inclusive) 229 * @return the range of matching shopping carts 230 * @throws SystemException if a system exception occurred 231 */ 232 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 233 long userId, int start, int end) 234 throws com.liferay.portal.kernel.exception.SystemException; 235 236 /** 237 * Returns an ordered range of all the shopping carts where userId = ?. 238 * 239 * <p> 240 * 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. 241 * </p> 242 * 243 * @param userId the user ID 244 * @param start the lower bound of the range of shopping carts 245 * @param end the upper bound of the range of shopping carts (not inclusive) 246 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 247 * @return the ordered range of matching shopping carts 248 * @throws SystemException if a system exception occurred 249 */ 250 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 251 long userId, int start, int end, 252 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 253 throws com.liferay.portal.kernel.exception.SystemException; 254 255 /** 256 * Returns the first shopping cart in the ordered set where userId = ?. 257 * 258 * <p> 259 * 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. 260 * </p> 261 * 262 * @param userId the user ID 263 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 264 * @return the first matching shopping cart 265 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 266 * @throws SystemException if a system exception occurred 267 */ 268 public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First( 269 long userId, 270 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 271 throws com.liferay.portal.kernel.exception.SystemException, 272 com.liferay.portlet.shopping.NoSuchCartException; 273 274 /** 275 * Returns the last shopping cart in the ordered set where userId = ?. 276 * 277 * <p> 278 * 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. 279 * </p> 280 * 281 * @param userId the user ID 282 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 283 * @return the last matching shopping cart 284 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 285 * @throws SystemException if a system exception occurred 286 */ 287 public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last( 288 long userId, 289 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 290 throws com.liferay.portal.kernel.exception.SystemException, 291 com.liferay.portlet.shopping.NoSuchCartException; 292 293 /** 294 * Returns the shopping carts before and after the current shopping cart in the ordered set where userId = ?. 295 * 296 * <p> 297 * 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. 298 * </p> 299 * 300 * @param cartId the primary key of the current shopping cart 301 * @param userId the user ID 302 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 303 * @return the previous, current, and next shopping cart 304 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 305 * @throws SystemException if a system exception occurred 306 */ 307 public com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext( 308 long cartId, long userId, 309 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 310 throws com.liferay.portal.kernel.exception.SystemException, 311 com.liferay.portlet.shopping.NoSuchCartException; 312 313 /** 314 * Returns the shopping cart where groupId = ? and userId = ? or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 315 * 316 * @param groupId the group ID 317 * @param userId the user ID 318 * @return the matching shopping cart 319 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 320 * @throws SystemException if a system exception occurred 321 */ 322 public com.liferay.portlet.shopping.model.ShoppingCart findByG_U( 323 long groupId, long userId) 324 throws com.liferay.portal.kernel.exception.SystemException, 325 com.liferay.portlet.shopping.NoSuchCartException; 326 327 /** 328 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 329 * 330 * @param groupId the group ID 331 * @param userId the user ID 332 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 333 * @throws SystemException if a system exception occurred 334 */ 335 public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 336 long groupId, long userId) 337 throws com.liferay.portal.kernel.exception.SystemException; 338 339 /** 340 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 341 * 342 * @param groupId the group ID 343 * @param userId the user ID 344 * @param retrieveFromCache whether to use the finder cache 345 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 346 * @throws SystemException if a system exception occurred 347 */ 348 public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 349 long groupId, long userId, boolean retrieveFromCache) 350 throws com.liferay.portal.kernel.exception.SystemException; 351 352 /** 353 * Returns all the shopping carts. 354 * 355 * @return the shopping carts 356 * @throws SystemException if a system exception occurred 357 */ 358 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll() 359 throws com.liferay.portal.kernel.exception.SystemException; 360 361 /** 362 * Returns a range of all the shopping carts. 363 * 364 * <p> 365 * 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. 366 * </p> 367 * 368 * @param start the lower bound of the range of shopping carts 369 * @param end the upper bound of the range of shopping carts (not inclusive) 370 * @return the range of shopping carts 371 * @throws SystemException if a system exception occurred 372 */ 373 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 374 int start, int end) 375 throws com.liferay.portal.kernel.exception.SystemException; 376 377 /** 378 * Returns an ordered range of all the shopping carts. 379 * 380 * <p> 381 * 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. 382 * </p> 383 * 384 * @param start the lower bound of the range of shopping carts 385 * @param end the upper bound of the range of shopping carts (not inclusive) 386 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 387 * @return the ordered range of shopping carts 388 * @throws SystemException if a system exception occurred 389 */ 390 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 391 int start, int end, 392 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 393 throws com.liferay.portal.kernel.exception.SystemException; 394 395 /** 396 * Removes all the shopping carts where groupId = ? from the database. 397 * 398 * @param groupId the group ID 399 * @throws SystemException if a system exception occurred 400 */ 401 public void removeByGroupId(long groupId) 402 throws com.liferay.portal.kernel.exception.SystemException; 403 404 /** 405 * Removes all the shopping carts where userId = ? from the database. 406 * 407 * @param userId the user ID 408 * @throws SystemException if a system exception occurred 409 */ 410 public void removeByUserId(long userId) 411 throws com.liferay.portal.kernel.exception.SystemException; 412 413 /** 414 * Removes the shopping cart where groupId = ? and userId = ? from the database. 415 * 416 * @param groupId the group ID 417 * @param userId the user ID 418 * @throws SystemException if a system exception occurred 419 */ 420 public void removeByG_U(long groupId, long userId) 421 throws com.liferay.portal.kernel.exception.SystemException, 422 com.liferay.portlet.shopping.NoSuchCartException; 423 424 /** 425 * Removes all the shopping carts from the database. 426 * 427 * @throws SystemException if a system exception occurred 428 */ 429 public void removeAll() 430 throws com.liferay.portal.kernel.exception.SystemException; 431 432 /** 433 * Returns the number of shopping carts where groupId = ?. 434 * 435 * @param groupId the group ID 436 * @return the number of matching shopping carts 437 * @throws SystemException if a system exception occurred 438 */ 439 public int countByGroupId(long groupId) 440 throws com.liferay.portal.kernel.exception.SystemException; 441 442 /** 443 * Returns the number of shopping carts where userId = ?. 444 * 445 * @param userId the user ID 446 * @return the number of matching shopping carts 447 * @throws SystemException if a system exception occurred 448 */ 449 public int countByUserId(long userId) 450 throws com.liferay.portal.kernel.exception.SystemException; 451 452 /** 453 * Returns the number of shopping carts where groupId = ? and userId = ?. 454 * 455 * @param groupId the group ID 456 * @param userId the user ID 457 * @return the number of matching shopping carts 458 * @throws SystemException if a system exception occurred 459 */ 460 public int countByG_U(long groupId, long userId) 461 throws com.liferay.portal.kernel.exception.SystemException; 462 463 /** 464 * Returns the number of shopping carts. 465 * 466 * @return the number of shopping carts 467 * @throws SystemException if a system exception occurred 468 */ 469 public int countAll() 470 throws com.liferay.portal.kernel.exception.SystemException; 471 }