001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 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#remove(com.liferay.portal.model.BaseModel) 099 */ 100 public static ShoppingCart remove(ShoppingCart shoppingCart) 101 throws SystemException { 102 return getPersistence().remove(shoppingCart); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 107 */ 108 public static ShoppingCart update(ShoppingCart shoppingCart, boolean merge) 109 throws SystemException { 110 return getPersistence().update(shoppingCart, merge); 111 } 112 113 /** 114 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 115 */ 116 public static ShoppingCart update(ShoppingCart shoppingCart, boolean merge, 117 ServiceContext serviceContext) throws SystemException { 118 return getPersistence().update(shoppingCart, merge, serviceContext); 119 } 120 121 /** 122 * Caches the shopping cart in the entity cache if it is enabled. 123 * 124 * @param shoppingCart the shopping cart 125 */ 126 public static void cacheResult( 127 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart) { 128 getPersistence().cacheResult(shoppingCart); 129 } 130 131 /** 132 * Caches the shopping carts in the entity cache if it is enabled. 133 * 134 * @param shoppingCarts the shopping carts 135 */ 136 public static void cacheResult( 137 java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts) { 138 getPersistence().cacheResult(shoppingCarts); 139 } 140 141 /** 142 * Creates a new shopping cart with the primary key. Does not add the shopping cart to the database. 143 * 144 * @param cartId the primary key for the new shopping cart 145 * @return the new shopping cart 146 */ 147 public static com.liferay.portlet.shopping.model.ShoppingCart create( 148 long cartId) { 149 return getPersistence().create(cartId); 150 } 151 152 /** 153 * Removes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners. 154 * 155 * @param cartId the primary key of the shopping cart 156 * @return the shopping cart that was removed 157 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 158 * @throws SystemException if a system exception occurred 159 */ 160 public static com.liferay.portlet.shopping.model.ShoppingCart remove( 161 long cartId) 162 throws com.liferay.portal.kernel.exception.SystemException, 163 com.liferay.portlet.shopping.NoSuchCartException { 164 return getPersistence().remove(cartId); 165 } 166 167 public static com.liferay.portlet.shopping.model.ShoppingCart updateImpl( 168 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart, 169 boolean merge) 170 throws com.liferay.portal.kernel.exception.SystemException { 171 return getPersistence().updateImpl(shoppingCart, merge); 172 } 173 174 /** 175 * Returns the shopping cart with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 176 * 177 * @param cartId the primary key of the shopping cart 178 * @return the shopping cart 179 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 180 * @throws SystemException if a system exception occurred 181 */ 182 public static com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey( 183 long cartId) 184 throws com.liferay.portal.kernel.exception.SystemException, 185 com.liferay.portlet.shopping.NoSuchCartException { 186 return getPersistence().findByPrimaryKey(cartId); 187 } 188 189 /** 190 * Returns the shopping cart with the primary key or returns <code>null</code> if it could not be found. 191 * 192 * @param cartId the primary key of the shopping cart 193 * @return the shopping cart, or <code>null</code> if a shopping cart with the primary key could not be found 194 * @throws SystemException if a system exception occurred 195 */ 196 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey( 197 long cartId) throws com.liferay.portal.kernel.exception.SystemException { 198 return getPersistence().fetchByPrimaryKey(cartId); 199 } 200 201 /** 202 * Returns all the shopping carts where groupId = ?. 203 * 204 * @param groupId the group ID 205 * @return the matching shopping carts 206 * @throws SystemException if a system exception occurred 207 */ 208 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 209 long groupId) 210 throws com.liferay.portal.kernel.exception.SystemException { 211 return getPersistence().findByGroupId(groupId); 212 } 213 214 /** 215 * Returns a range of all the shopping carts where groupId = ?. 216 * 217 * <p> 218 * 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. 219 * </p> 220 * 221 * @param groupId the group ID 222 * @param start the lower bound of the range of shopping carts 223 * @param end the upper bound of the range of shopping carts (not inclusive) 224 * @return the range of matching shopping carts 225 * @throws SystemException if a system exception occurred 226 */ 227 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 228 long groupId, int start, int end) 229 throws com.liferay.portal.kernel.exception.SystemException { 230 return getPersistence().findByGroupId(groupId, start, end); 231 } 232 233 /** 234 * Returns an ordered range of all the shopping carts where groupId = ?. 235 * 236 * <p> 237 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 238 * </p> 239 * 240 * @param groupId the group ID 241 * @param start the lower bound of the range of shopping carts 242 * @param end the upper bound of the range of shopping carts (not inclusive) 243 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 244 * @return the ordered range of matching shopping carts 245 * @throws SystemException if a system exception occurred 246 */ 247 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 248 long groupId, int start, int end, 249 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 250 throws com.liferay.portal.kernel.exception.SystemException { 251 return getPersistence() 252 .findByGroupId(groupId, start, end, orderByComparator); 253 } 254 255 /** 256 * Returns the first shopping cart in the ordered set where groupId = ?. 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 groupId the group 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 static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First( 269 long groupId, 270 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 271 throws com.liferay.portal.kernel.exception.SystemException, 272 com.liferay.portlet.shopping.NoSuchCartException { 273 return getPersistence().findByGroupId_First(groupId, orderByComparator); 274 } 275 276 /** 277 * Returns the last shopping cart in the ordered set where groupId = ?. 278 * 279 * <p> 280 * 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. 281 * </p> 282 * 283 * @param groupId the group ID 284 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 285 * @return the last matching shopping cart 286 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 287 * @throws SystemException if a system exception occurred 288 */ 289 public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last( 290 long groupId, 291 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 292 throws com.liferay.portal.kernel.exception.SystemException, 293 com.liferay.portlet.shopping.NoSuchCartException { 294 return getPersistence().findByGroupId_Last(groupId, orderByComparator); 295 } 296 297 /** 298 * Returns the shopping carts before and after the current shopping cart in the ordered set where groupId = ?. 299 * 300 * <p> 301 * 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. 302 * </p> 303 * 304 * @param cartId the primary key of the current shopping cart 305 * @param groupId the group ID 306 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 307 * @return the previous, current, and next shopping cart 308 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 309 * @throws SystemException if a system exception occurred 310 */ 311 public static com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext( 312 long cartId, long groupId, 313 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 314 throws com.liferay.portal.kernel.exception.SystemException, 315 com.liferay.portlet.shopping.NoSuchCartException { 316 return getPersistence() 317 .findByGroupId_PrevAndNext(cartId, groupId, orderByComparator); 318 } 319 320 /** 321 * Returns all the shopping carts where userId = ?. 322 * 323 * @param userId the user ID 324 * @return the matching shopping carts 325 * @throws SystemException if a system exception occurred 326 */ 327 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 328 long userId) throws com.liferay.portal.kernel.exception.SystemException { 329 return getPersistence().findByUserId(userId); 330 } 331 332 /** 333 * Returns a range of all the shopping carts where userId = ?. 334 * 335 * <p> 336 * 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. 337 * </p> 338 * 339 * @param userId the user ID 340 * @param start the lower bound of the range of shopping carts 341 * @param end the upper bound of the range of shopping carts (not inclusive) 342 * @return the range of matching shopping carts 343 * @throws SystemException if a system exception occurred 344 */ 345 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 346 long userId, int start, int end) 347 throws com.liferay.portal.kernel.exception.SystemException { 348 return getPersistence().findByUserId(userId, start, end); 349 } 350 351 /** 352 * Returns an ordered range of all the shopping carts where userId = ?. 353 * 354 * <p> 355 * 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. 356 * </p> 357 * 358 * @param userId the user ID 359 * @param start the lower bound of the range of shopping carts 360 * @param end the upper bound of the range of shopping carts (not inclusive) 361 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 362 * @return the ordered range of matching shopping carts 363 * @throws SystemException if a system exception occurred 364 */ 365 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 366 long userId, int start, int end, 367 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 368 throws com.liferay.portal.kernel.exception.SystemException { 369 return getPersistence() 370 .findByUserId(userId, start, end, orderByComparator); 371 } 372 373 /** 374 * Returns the first shopping cart in the ordered set where userId = ?. 375 * 376 * <p> 377 * 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. 378 * </p> 379 * 380 * @param userId the user ID 381 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 382 * @return the first matching shopping cart 383 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 384 * @throws SystemException if a system exception occurred 385 */ 386 public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First( 387 long userId, 388 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 389 throws com.liferay.portal.kernel.exception.SystemException, 390 com.liferay.portlet.shopping.NoSuchCartException { 391 return getPersistence().findByUserId_First(userId, orderByComparator); 392 } 393 394 /** 395 * Returns the last shopping cart in the ordered set where userId = ?. 396 * 397 * <p> 398 * 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. 399 * </p> 400 * 401 * @param userId the user ID 402 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 403 * @return the last matching shopping cart 404 * @throws com.liferay.portlet.shopping.NoSuchCartException 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 findByUserId_Last( 408 long userId, 409 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 410 throws com.liferay.portal.kernel.exception.SystemException, 411 com.liferay.portlet.shopping.NoSuchCartException { 412 return getPersistence().findByUserId_Last(userId, orderByComparator); 413 } 414 415 /** 416 * Returns the shopping carts before and after the current shopping cart in the ordered set where userId = ?. 417 * 418 * <p> 419 * 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. 420 * </p> 421 * 422 * @param cartId the primary key of the current shopping cart 423 * @param userId the user ID 424 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 425 * @return the previous, current, and next shopping cart 426 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 427 * @throws SystemException if a system exception occurred 428 */ 429 public static com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext( 430 long cartId, long userId, 431 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 432 throws com.liferay.portal.kernel.exception.SystemException, 433 com.liferay.portlet.shopping.NoSuchCartException { 434 return getPersistence() 435 .findByUserId_PrevAndNext(cartId, userId, orderByComparator); 436 } 437 438 /** 439 * Returns the shopping cart where groupId = ? and userId = ? or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 440 * 441 * @param groupId the group ID 442 * @param userId the user ID 443 * @return the matching shopping cart 444 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 445 * @throws SystemException if a system exception occurred 446 */ 447 public static com.liferay.portlet.shopping.model.ShoppingCart findByG_U( 448 long groupId, long userId) 449 throws com.liferay.portal.kernel.exception.SystemException, 450 com.liferay.portlet.shopping.NoSuchCartException { 451 return getPersistence().findByG_U(groupId, userId); 452 } 453 454 /** 455 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 456 * 457 * @param groupId the group ID 458 * @param userId the user ID 459 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 460 * @throws SystemException if a system exception occurred 461 */ 462 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 463 long groupId, long userId) 464 throws com.liferay.portal.kernel.exception.SystemException { 465 return getPersistence().fetchByG_U(groupId, userId); 466 } 467 468 /** 469 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 470 * 471 * @param groupId the group ID 472 * @param userId the user ID 473 * @param retrieveFromCache whether to use the finder cache 474 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 475 * @throws SystemException if a system exception occurred 476 */ 477 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 478 long groupId, long userId, boolean retrieveFromCache) 479 throws com.liferay.portal.kernel.exception.SystemException { 480 return getPersistence().fetchByG_U(groupId, userId, retrieveFromCache); 481 } 482 483 /** 484 * Returns all the shopping carts. 485 * 486 * @return the shopping carts 487 * @throws SystemException if a system exception occurred 488 */ 489 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll() 490 throws com.liferay.portal.kernel.exception.SystemException { 491 return getPersistence().findAll(); 492 } 493 494 /** 495 * Returns a range of all the shopping carts. 496 * 497 * <p> 498 * 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. 499 * </p> 500 * 501 * @param start the lower bound of the range of shopping carts 502 * @param end the upper bound of the range of shopping carts (not inclusive) 503 * @return the range of shopping carts 504 * @throws SystemException if a system exception occurred 505 */ 506 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 507 int start, int end) 508 throws com.liferay.portal.kernel.exception.SystemException { 509 return getPersistence().findAll(start, end); 510 } 511 512 /** 513 * Returns an ordered range of all the shopping carts. 514 * 515 * <p> 516 * 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. 517 * </p> 518 * 519 * @param start the lower bound of the range of shopping carts 520 * @param end the upper bound of the range of shopping carts (not inclusive) 521 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 522 * @return the ordered range of shopping carts 523 * @throws SystemException if a system exception occurred 524 */ 525 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 526 int start, int end, 527 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 528 throws com.liferay.portal.kernel.exception.SystemException { 529 return getPersistence().findAll(start, end, orderByComparator); 530 } 531 532 /** 533 * Removes all the shopping carts where groupId = ? from the database. 534 * 535 * @param groupId the group ID 536 * @throws SystemException if a system exception occurred 537 */ 538 public static void removeByGroupId(long groupId) 539 throws com.liferay.portal.kernel.exception.SystemException { 540 getPersistence().removeByGroupId(groupId); 541 } 542 543 /** 544 * Removes all the shopping carts where userId = ? from the database. 545 * 546 * @param userId the user ID 547 * @throws SystemException if a system exception occurred 548 */ 549 public static void removeByUserId(long userId) 550 throws com.liferay.portal.kernel.exception.SystemException { 551 getPersistence().removeByUserId(userId); 552 } 553 554 /** 555 * Removes the shopping cart where groupId = ? and userId = ? from the database. 556 * 557 * @param groupId the group ID 558 * @param userId the user ID 559 * @throws SystemException if a system exception occurred 560 */ 561 public static void removeByG_U(long groupId, long userId) 562 throws com.liferay.portal.kernel.exception.SystemException, 563 com.liferay.portlet.shopping.NoSuchCartException { 564 getPersistence().removeByG_U(groupId, userId); 565 } 566 567 /** 568 * Removes all the shopping carts from the database. 569 * 570 * @throws SystemException if a system exception occurred 571 */ 572 public static void removeAll() 573 throws com.liferay.portal.kernel.exception.SystemException { 574 getPersistence().removeAll(); 575 } 576 577 /** 578 * Returns the number of shopping carts where groupId = ?. 579 * 580 * @param groupId the group ID 581 * @return the number of matching shopping carts 582 * @throws SystemException if a system exception occurred 583 */ 584 public static int countByGroupId(long groupId) 585 throws com.liferay.portal.kernel.exception.SystemException { 586 return getPersistence().countByGroupId(groupId); 587 } 588 589 /** 590 * Returns the number of shopping carts where userId = ?. 591 * 592 * @param userId the user ID 593 * @return the number of matching shopping carts 594 * @throws SystemException if a system exception occurred 595 */ 596 public static int countByUserId(long userId) 597 throws com.liferay.portal.kernel.exception.SystemException { 598 return getPersistence().countByUserId(userId); 599 } 600 601 /** 602 * Returns the number of shopping carts where groupId = ? and userId = ?. 603 * 604 * @param groupId the group ID 605 * @param userId the user ID 606 * @return the number of matching shopping carts 607 * @throws SystemException if a system exception occurred 608 */ 609 public static int countByG_U(long groupId, long userId) 610 throws com.liferay.portal.kernel.exception.SystemException { 611 return getPersistence().countByG_U(groupId, userId); 612 } 613 614 /** 615 * Returns the number of shopping carts. 616 * 617 * @return the number of shopping carts 618 * @throws SystemException if a system exception occurred 619 */ 620 public static int countAll() 621 throws com.liferay.portal.kernel.exception.SystemException { 622 return getPersistence().countAll(); 623 } 624 625 public static ShoppingCartPersistence getPersistence() { 626 if (_persistence == null) { 627 _persistence = (ShoppingCartPersistence)PortalBeanLocatorUtil.locate(ShoppingCartPersistence.class.getName()); 628 629 ReferenceRegistry.registerReference(ShoppingCartUtil.class, 630 "_persistence"); 631 } 632 633 return _persistence; 634 } 635 636 public void setPersistence(ShoppingCartPersistence persistence) { 637 _persistence = persistence; 638 639 ReferenceRegistry.registerReference(ShoppingCartUtil.class, 640 "_persistence"); 641 } 642 643 private static ShoppingCartPersistence _persistence; 644 }