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.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.kernel.util.ReferenceRegistry; 022 import com.liferay.portal.service.ServiceContext; 023 024 import com.liferay.portlet.shopping.model.ShoppingCart; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the shopping cart service. This utility wraps {@link ShoppingCartPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see ShoppingCartPersistence 037 * @see ShoppingCartPersistenceImpl 038 * @generated 039 */ 040 public class ShoppingCartUtil { 041 /* 042 * NOTE FOR DEVELOPERS: 043 * 044 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 045 */ 046 047 /** 048 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 049 */ 050 public static void clearCache() { 051 getPersistence().clearCache(); 052 } 053 054 /** 055 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 056 */ 057 public static void clearCache(ShoppingCart shoppingCart) { 058 getPersistence().clearCache(shoppingCart); 059 } 060 061 /** 062 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 063 */ 064 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 065 throws SystemException { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<ShoppingCart> findWithDynamicQuery( 073 DynamicQuery dynamicQuery) throws SystemException { 074 return getPersistence().findWithDynamicQuery(dynamicQuery); 075 } 076 077 /** 078 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 079 */ 080 public static List<ShoppingCart> findWithDynamicQuery( 081 DynamicQuery dynamicQuery, int start, int end) 082 throws SystemException { 083 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 084 } 085 086 /** 087 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 088 */ 089 public static List<ShoppingCart> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator orderByComparator) throws SystemException { 092 return getPersistence() 093 .findWithDynamicQuery(dynamicQuery, start, end, 094 orderByComparator); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 099 */ 100 public static ShoppingCart update(ShoppingCart shoppingCart) 101 throws SystemException { 102 return getPersistence().update(shoppingCart); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 107 */ 108 public static ShoppingCart update(ShoppingCart shoppingCart, 109 ServiceContext serviceContext) throws SystemException { 110 return getPersistence().update(shoppingCart, serviceContext); 111 } 112 113 /** 114 * Caches the shopping cart in the entity cache if it is enabled. 115 * 116 * @param shoppingCart the shopping cart 117 */ 118 public static void cacheResult( 119 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart) { 120 getPersistence().cacheResult(shoppingCart); 121 } 122 123 /** 124 * Caches the shopping carts in the entity cache if it is enabled. 125 * 126 * @param shoppingCarts the shopping carts 127 */ 128 public static void cacheResult( 129 java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts) { 130 getPersistence().cacheResult(shoppingCarts); 131 } 132 133 /** 134 * Creates a new shopping cart with the primary key. Does not add the shopping cart to the database. 135 * 136 * @param cartId the primary key for the new shopping cart 137 * @return the new shopping cart 138 */ 139 public static com.liferay.portlet.shopping.model.ShoppingCart create( 140 long cartId) { 141 return getPersistence().create(cartId); 142 } 143 144 /** 145 * Removes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners. 146 * 147 * @param cartId the primary key of the shopping cart 148 * @return the shopping cart that was removed 149 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 150 * @throws SystemException if a system exception occurred 151 */ 152 public static com.liferay.portlet.shopping.model.ShoppingCart remove( 153 long cartId) 154 throws com.liferay.portal.kernel.exception.SystemException, 155 com.liferay.portlet.shopping.NoSuchCartException { 156 return getPersistence().remove(cartId); 157 } 158 159 public static com.liferay.portlet.shopping.model.ShoppingCart updateImpl( 160 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart) 161 throws com.liferay.portal.kernel.exception.SystemException { 162 return getPersistence().updateImpl(shoppingCart); 163 } 164 165 /** 166 * Returns the shopping cart with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 167 * 168 * @param cartId the primary key of the shopping cart 169 * @return the shopping cart 170 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 171 * @throws SystemException if a system exception occurred 172 */ 173 public static com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey( 174 long cartId) 175 throws com.liferay.portal.kernel.exception.SystemException, 176 com.liferay.portlet.shopping.NoSuchCartException { 177 return getPersistence().findByPrimaryKey(cartId); 178 } 179 180 /** 181 * Returns the shopping cart with the primary key or returns <code>null</code> if it could not be found. 182 * 183 * @param cartId the primary key of the shopping cart 184 * @return the shopping cart, or <code>null</code> if a shopping cart with the primary key could not be found 185 * @throws SystemException if a system exception occurred 186 */ 187 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey( 188 long cartId) throws com.liferay.portal.kernel.exception.SystemException { 189 return getPersistence().fetchByPrimaryKey(cartId); 190 } 191 192 /** 193 * Returns all the shopping carts where groupId = ?. 194 * 195 * @param groupId the group ID 196 * @return the matching shopping carts 197 * @throws SystemException if a system exception occurred 198 */ 199 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 200 long groupId) 201 throws com.liferay.portal.kernel.exception.SystemException { 202 return getPersistence().findByGroupId(groupId); 203 } 204 205 /** 206 * Returns a range of all the shopping carts where groupId = ?. 207 * 208 * <p> 209 * 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. 210 * </p> 211 * 212 * @param groupId the group ID 213 * @param start the lower bound of the range of shopping carts 214 * @param end the upper bound of the range of shopping carts (not inclusive) 215 * @return the range of matching shopping carts 216 * @throws SystemException if a system exception occurred 217 */ 218 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 219 long groupId, int start, int end) 220 throws com.liferay.portal.kernel.exception.SystemException { 221 return getPersistence().findByGroupId(groupId, start, end); 222 } 223 224 /** 225 * Returns an ordered range of all the shopping carts where groupId = ?. 226 * 227 * <p> 228 * 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. 229 * </p> 230 * 231 * @param groupId the group ID 232 * @param start the lower bound of the range of shopping carts 233 * @param end the upper bound of the range of shopping carts (not inclusive) 234 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 235 * @return the ordered range of matching shopping carts 236 * @throws SystemException if a system exception occurred 237 */ 238 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 239 long groupId, int start, int end, 240 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 241 throws com.liferay.portal.kernel.exception.SystemException { 242 return getPersistence() 243 .findByGroupId(groupId, start, end, orderByComparator); 244 } 245 246 /** 247 * Returns the first shopping cart in the ordered set where groupId = ?. 248 * 249 * @param groupId the group ID 250 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 251 * @return the first matching shopping cart 252 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 253 * @throws SystemException if a system exception occurred 254 */ 255 public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First( 256 long groupId, 257 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 258 throws com.liferay.portal.kernel.exception.SystemException, 259 com.liferay.portlet.shopping.NoSuchCartException { 260 return getPersistence().findByGroupId_First(groupId, orderByComparator); 261 } 262 263 /** 264 * Returns the first shopping cart in the ordered set where groupId = ?. 265 * 266 * @param groupId the group ID 267 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 268 * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 269 * @throws SystemException if a system exception occurred 270 */ 271 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByGroupId_First( 272 long groupId, 273 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 274 throws com.liferay.portal.kernel.exception.SystemException { 275 return getPersistence().fetchByGroupId_First(groupId, orderByComparator); 276 } 277 278 /** 279 * Returns the last shopping cart in the ordered set where groupId = ?. 280 * 281 * @param groupId the group 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 static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last( 288 long groupId, 289 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 290 throws com.liferay.portal.kernel.exception.SystemException, 291 com.liferay.portlet.shopping.NoSuchCartException { 292 return getPersistence().findByGroupId_Last(groupId, orderByComparator); 293 } 294 295 /** 296 * Returns the last shopping cart in the ordered set where groupId = ?. 297 * 298 * @param groupId the group ID 299 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 300 * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 301 * @throws SystemException if a system exception occurred 302 */ 303 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByGroupId_Last( 304 long groupId, 305 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 306 throws com.liferay.portal.kernel.exception.SystemException { 307 return getPersistence().fetchByGroupId_Last(groupId, orderByComparator); 308 } 309 310 /** 311 * Returns the shopping carts before and after the current shopping cart in the ordered set where groupId = ?. 312 * 313 * @param cartId the primary key of the current shopping cart 314 * @param groupId the group ID 315 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 316 * @return the previous, current, and next shopping cart 317 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 318 * @throws SystemException if a system exception occurred 319 */ 320 public static com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext( 321 long cartId, long groupId, 322 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 323 throws com.liferay.portal.kernel.exception.SystemException, 324 com.liferay.portlet.shopping.NoSuchCartException { 325 return getPersistence() 326 .findByGroupId_PrevAndNext(cartId, groupId, orderByComparator); 327 } 328 329 /** 330 * Returns all the shopping carts where userId = ?. 331 * 332 * @param userId the user ID 333 * @return the matching shopping carts 334 * @throws SystemException if a system exception occurred 335 */ 336 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 337 long userId) throws com.liferay.portal.kernel.exception.SystemException { 338 return getPersistence().findByUserId(userId); 339 } 340 341 /** 342 * Returns a range of all the shopping carts where userId = ?. 343 * 344 * <p> 345 * 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. 346 * </p> 347 * 348 * @param userId the user ID 349 * @param start the lower bound of the range of shopping carts 350 * @param end the upper bound of the range of shopping carts (not inclusive) 351 * @return the range of matching shopping carts 352 * @throws SystemException if a system exception occurred 353 */ 354 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 355 long userId, int start, int end) 356 throws com.liferay.portal.kernel.exception.SystemException { 357 return getPersistence().findByUserId(userId, start, end); 358 } 359 360 /** 361 * Returns an ordered range of all the shopping carts where userId = ?. 362 * 363 * <p> 364 * 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. 365 * </p> 366 * 367 * @param userId the user ID 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 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 371 * @return the ordered range of matching shopping carts 372 * @throws SystemException if a system exception occurred 373 */ 374 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 375 long userId, int start, int end, 376 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 377 throws com.liferay.portal.kernel.exception.SystemException { 378 return getPersistence() 379 .findByUserId(userId, start, end, orderByComparator); 380 } 381 382 /** 383 * Returns the first shopping cart in the ordered set where userId = ?. 384 * 385 * @param userId the user ID 386 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 387 * @return the first matching shopping cart 388 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 389 * @throws SystemException if a system exception occurred 390 */ 391 public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First( 392 long userId, 393 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 394 throws com.liferay.portal.kernel.exception.SystemException, 395 com.liferay.portlet.shopping.NoSuchCartException { 396 return getPersistence().findByUserId_First(userId, orderByComparator); 397 } 398 399 /** 400 * Returns the first shopping cart in the ordered set where userId = ?. 401 * 402 * @param userId the user ID 403 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 404 * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 405 * @throws SystemException if a system exception occurred 406 */ 407 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByUserId_First( 408 long userId, 409 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 410 throws com.liferay.portal.kernel.exception.SystemException { 411 return getPersistence().fetchByUserId_First(userId, orderByComparator); 412 } 413 414 /** 415 * Returns the last shopping cart in the ordered set where userId = ?. 416 * 417 * @param userId the user ID 418 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 419 * @return the last matching shopping cart 420 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 421 * @throws SystemException if a system exception occurred 422 */ 423 public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last( 424 long userId, 425 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 426 throws com.liferay.portal.kernel.exception.SystemException, 427 com.liferay.portlet.shopping.NoSuchCartException { 428 return getPersistence().findByUserId_Last(userId, orderByComparator); 429 } 430 431 /** 432 * Returns the last shopping cart in the ordered set where userId = ?. 433 * 434 * @param userId the user ID 435 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 436 * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 437 * @throws SystemException if a system exception occurred 438 */ 439 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByUserId_Last( 440 long userId, 441 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 442 throws com.liferay.portal.kernel.exception.SystemException { 443 return getPersistence().fetchByUserId_Last(userId, orderByComparator); 444 } 445 446 /** 447 * Returns the shopping carts before and after the current shopping cart in the ordered set where userId = ?. 448 * 449 * @param cartId the primary key of the current shopping cart 450 * @param userId the user ID 451 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 452 * @return the previous, current, and next shopping cart 453 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 454 * @throws SystemException if a system exception occurred 455 */ 456 public static com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext( 457 long cartId, long userId, 458 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 459 throws com.liferay.portal.kernel.exception.SystemException, 460 com.liferay.portlet.shopping.NoSuchCartException { 461 return getPersistence() 462 .findByUserId_PrevAndNext(cartId, userId, orderByComparator); 463 } 464 465 /** 466 * Returns the shopping cart where groupId = ? and userId = ? or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 467 * 468 * @param groupId the group ID 469 * @param userId the user ID 470 * @return the matching shopping cart 471 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 472 * @throws SystemException if a system exception occurred 473 */ 474 public static com.liferay.portlet.shopping.model.ShoppingCart findByG_U( 475 long groupId, long userId) 476 throws com.liferay.portal.kernel.exception.SystemException, 477 com.liferay.portlet.shopping.NoSuchCartException { 478 return getPersistence().findByG_U(groupId, userId); 479 } 480 481 /** 482 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 483 * 484 * @param groupId the group ID 485 * @param userId the user ID 486 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 487 * @throws SystemException if a system exception occurred 488 */ 489 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 490 long groupId, long userId) 491 throws com.liferay.portal.kernel.exception.SystemException { 492 return getPersistence().fetchByG_U(groupId, userId); 493 } 494 495 /** 496 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 497 * 498 * @param groupId the group ID 499 * @param userId the user ID 500 * @param retrieveFromCache whether to use the finder cache 501 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 502 * @throws SystemException if a system exception occurred 503 */ 504 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 505 long groupId, long userId, boolean retrieveFromCache) 506 throws com.liferay.portal.kernel.exception.SystemException { 507 return getPersistence().fetchByG_U(groupId, userId, retrieveFromCache); 508 } 509 510 /** 511 * Returns all the shopping carts. 512 * 513 * @return the shopping carts 514 * @throws SystemException if a system exception occurred 515 */ 516 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll() 517 throws com.liferay.portal.kernel.exception.SystemException { 518 return getPersistence().findAll(); 519 } 520 521 /** 522 * Returns a range of all the shopping carts. 523 * 524 * <p> 525 * 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. 526 * </p> 527 * 528 * @param start the lower bound of the range of shopping carts 529 * @param end the upper bound of the range of shopping carts (not inclusive) 530 * @return the range of shopping carts 531 * @throws SystemException if a system exception occurred 532 */ 533 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 534 int start, int end) 535 throws com.liferay.portal.kernel.exception.SystemException { 536 return getPersistence().findAll(start, end); 537 } 538 539 /** 540 * Returns an ordered range of all the shopping carts. 541 * 542 * <p> 543 * 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. 544 * </p> 545 * 546 * @param start the lower bound of the range of shopping carts 547 * @param end the upper bound of the range of shopping carts (not inclusive) 548 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 549 * @return the ordered range of shopping carts 550 * @throws SystemException if a system exception occurred 551 */ 552 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 553 int start, int end, 554 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 555 throws com.liferay.portal.kernel.exception.SystemException { 556 return getPersistence().findAll(start, end, orderByComparator); 557 } 558 559 /** 560 * Removes all the shopping carts where groupId = ? from the database. 561 * 562 * @param groupId the group ID 563 * @throws SystemException if a system exception occurred 564 */ 565 public static void removeByGroupId(long groupId) 566 throws com.liferay.portal.kernel.exception.SystemException { 567 getPersistence().removeByGroupId(groupId); 568 } 569 570 /** 571 * Removes all the shopping carts where userId = ? from the database. 572 * 573 * @param userId the user ID 574 * @throws SystemException if a system exception occurred 575 */ 576 public static void removeByUserId(long userId) 577 throws com.liferay.portal.kernel.exception.SystemException { 578 getPersistence().removeByUserId(userId); 579 } 580 581 /** 582 * Removes the shopping cart where groupId = ? and userId = ? from the database. 583 * 584 * @param groupId the group ID 585 * @param userId the user ID 586 * @return the shopping cart that was removed 587 * @throws SystemException if a system exception occurred 588 */ 589 public static com.liferay.portlet.shopping.model.ShoppingCart removeByG_U( 590 long groupId, long userId) 591 throws com.liferay.portal.kernel.exception.SystemException, 592 com.liferay.portlet.shopping.NoSuchCartException { 593 return getPersistence().removeByG_U(groupId, userId); 594 } 595 596 /** 597 * Removes all the shopping carts from the database. 598 * 599 * @throws SystemException if a system exception occurred 600 */ 601 public static void removeAll() 602 throws com.liferay.portal.kernel.exception.SystemException { 603 getPersistence().removeAll(); 604 } 605 606 /** 607 * Returns the number of shopping carts where groupId = ?. 608 * 609 * @param groupId the group ID 610 * @return the number of matching shopping carts 611 * @throws SystemException if a system exception occurred 612 */ 613 public static int countByGroupId(long groupId) 614 throws com.liferay.portal.kernel.exception.SystemException { 615 return getPersistence().countByGroupId(groupId); 616 } 617 618 /** 619 * Returns the number of shopping carts where userId = ?. 620 * 621 * @param userId the user ID 622 * @return the number of matching shopping carts 623 * @throws SystemException if a system exception occurred 624 */ 625 public static int countByUserId(long userId) 626 throws com.liferay.portal.kernel.exception.SystemException { 627 return getPersistence().countByUserId(userId); 628 } 629 630 /** 631 * Returns the number of shopping carts where groupId = ? and userId = ?. 632 * 633 * @param groupId the group ID 634 * @param userId the user ID 635 * @return the number of matching shopping carts 636 * @throws SystemException if a system exception occurred 637 */ 638 public static int countByG_U(long groupId, long userId) 639 throws com.liferay.portal.kernel.exception.SystemException { 640 return getPersistence().countByG_U(groupId, userId); 641 } 642 643 /** 644 * Returns the number of shopping carts. 645 * 646 * @return the number of shopping carts 647 * @throws SystemException if a system exception occurred 648 */ 649 public static int countAll() 650 throws com.liferay.portal.kernel.exception.SystemException { 651 return getPersistence().countAll(); 652 } 653 654 public static ShoppingCartPersistence getPersistence() { 655 if (_persistence == null) { 656 _persistence = (ShoppingCartPersistence)PortalBeanLocatorUtil.locate(ShoppingCartPersistence.class.getName()); 657 658 ReferenceRegistry.registerReference(ShoppingCartUtil.class, 659 "_persistence"); 660 } 661 662 return _persistence; 663 } 664 665 /** 666 * @deprecated 667 */ 668 public void setPersistence(ShoppingCartPersistence persistence) { 669 } 670 671 private static ShoppingCartPersistence _persistence; 672 }