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