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 to cache 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 to cache 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 to remove 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 * Finds 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 to find 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 * Finds 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 to find 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 * Finds all the shopping carts where groupId = ?. 203 * 204 * @param groupId the group ID to search with 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 * Finds 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 to search with 222 * @param start the lower bound of the range of shopping carts to return 223 * @param end the upper bound of the range of shopping carts to return (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 * Finds 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 to search with 241 * @param start the lower bound of the range of shopping carts to return 242 * @param end the upper bound of the range of shopping carts to return (not inclusive) 243 * @param orderByComparator the comparator to order the results by 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 * Finds 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 to search with 263 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 284 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 306 * @param orderByComparator the comparator to order the set by 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 * Finds all the shopping carts where userId = ?. 322 * 323 * @param userId the user ID to search with 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 * Finds 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 to search with 340 * @param start the lower bound of the range of shopping carts to return 341 * @param end the upper bound of the range of shopping carts to return (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 * Finds 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 to search with 359 * @param start the lower bound of the range of shopping carts to return 360 * @param end the upper bound of the range of shopping carts to return (not inclusive) 361 * @param orderByComparator the comparator to order the results by 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 * Finds 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 to search with 381 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 402 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 424 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 442 * @param userId the user ID to search with 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 * Finds 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 to search with 458 * @param userId the user ID to search with 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 * Finds 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 to search with 472 * @param userId the user ID to search with 473 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 474 * @throws SystemException if a system exception occurred 475 */ 476 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 477 long groupId, long userId, boolean retrieveFromCache) 478 throws com.liferay.portal.kernel.exception.SystemException { 479 return getPersistence().fetchByG_U(groupId, userId, retrieveFromCache); 480 } 481 482 /** 483 * Finds all the shopping carts. 484 * 485 * @return the shopping carts 486 * @throws SystemException if a system exception occurred 487 */ 488 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll() 489 throws com.liferay.portal.kernel.exception.SystemException { 490 return getPersistence().findAll(); 491 } 492 493 /** 494 * Finds a range of all the shopping carts. 495 * 496 * <p> 497 * 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. 498 * </p> 499 * 500 * @param start the lower bound of the range of shopping carts to return 501 * @param end the upper bound of the range of shopping carts to return (not inclusive) 502 * @return the range of shopping carts 503 * @throws SystemException if a system exception occurred 504 */ 505 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 506 int start, int end) 507 throws com.liferay.portal.kernel.exception.SystemException { 508 return getPersistence().findAll(start, end); 509 } 510 511 /** 512 * Finds an ordered range of all the shopping carts. 513 * 514 * <p> 515 * 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. 516 * </p> 517 * 518 * @param start the lower bound of the range of shopping carts to return 519 * @param end the upper bound of the range of shopping carts to return (not inclusive) 520 * @param orderByComparator the comparator to order the results by 521 * @return the ordered range of shopping carts 522 * @throws SystemException if a system exception occurred 523 */ 524 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 525 int start, int end, 526 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 527 throws com.liferay.portal.kernel.exception.SystemException { 528 return getPersistence().findAll(start, end, orderByComparator); 529 } 530 531 /** 532 * Removes all the shopping carts where groupId = ? from the database. 533 * 534 * @param groupId the group ID to search with 535 * @throws SystemException if a system exception occurred 536 */ 537 public static void removeByGroupId(long groupId) 538 throws com.liferay.portal.kernel.exception.SystemException { 539 getPersistence().removeByGroupId(groupId); 540 } 541 542 /** 543 * Removes all the shopping carts where userId = ? from the database. 544 * 545 * @param userId the user ID to search with 546 * @throws SystemException if a system exception occurred 547 */ 548 public static void removeByUserId(long userId) 549 throws com.liferay.portal.kernel.exception.SystemException { 550 getPersistence().removeByUserId(userId); 551 } 552 553 /** 554 * Removes the shopping cart where groupId = ? and userId = ? from the database. 555 * 556 * @param groupId the group ID to search with 557 * @param userId the user ID to search with 558 * @throws SystemException if a system exception occurred 559 */ 560 public static void removeByG_U(long groupId, long userId) 561 throws com.liferay.portal.kernel.exception.SystemException, 562 com.liferay.portlet.shopping.NoSuchCartException { 563 getPersistence().removeByG_U(groupId, userId); 564 } 565 566 /** 567 * Removes all the shopping carts from the database. 568 * 569 * @throws SystemException if a system exception occurred 570 */ 571 public static void removeAll() 572 throws com.liferay.portal.kernel.exception.SystemException { 573 getPersistence().removeAll(); 574 } 575 576 /** 577 * Counts all the shopping carts where groupId = ?. 578 * 579 * @param groupId the group ID to search with 580 * @return the number of matching shopping carts 581 * @throws SystemException if a system exception occurred 582 */ 583 public static int countByGroupId(long groupId) 584 throws com.liferay.portal.kernel.exception.SystemException { 585 return getPersistence().countByGroupId(groupId); 586 } 587 588 /** 589 * Counts all the shopping carts where userId = ?. 590 * 591 * @param userId the user ID to search with 592 * @return the number of matching shopping carts 593 * @throws SystemException if a system exception occurred 594 */ 595 public static int countByUserId(long userId) 596 throws com.liferay.portal.kernel.exception.SystemException { 597 return getPersistence().countByUserId(userId); 598 } 599 600 /** 601 * Counts all the shopping carts where groupId = ? and userId = ?. 602 * 603 * @param groupId the group ID to search with 604 * @param userId the user ID to search with 605 * @return the number of matching shopping carts 606 * @throws SystemException if a system exception occurred 607 */ 608 public static int countByG_U(long groupId, long userId) 609 throws com.liferay.portal.kernel.exception.SystemException { 610 return getPersistence().countByG_U(groupId, userId); 611 } 612 613 /** 614 * Counts all the shopping carts. 615 * 616 * @return the number of shopping carts 617 * @throws SystemException if a system exception occurred 618 */ 619 public static int countAll() 620 throws com.liferay.portal.kernel.exception.SystemException { 621 return getPersistence().countAll(); 622 } 623 624 public static ShoppingCartPersistence getPersistence() { 625 if (_persistence == null) { 626 _persistence = (ShoppingCartPersistence)PortalBeanLocatorUtil.locate(ShoppingCartPersistence.class.getName()); 627 628 ReferenceRegistry.registerReference(ShoppingCartUtil.class, 629 "_persistence"); 630 } 631 632 return _persistence; 633 } 634 635 public void setPersistence(ShoppingCartPersistence persistence) { 636 _persistence = persistence; 637 638 ReferenceRegistry.registerReference(ShoppingCartUtil.class, 639 "_persistence"); 640 } 641 642 private static ShoppingCartPersistence _persistence; 643 }