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.exception.SystemException; 018 import com.liferay.portal.service.persistence.BasePersistence; 019 020 import com.liferay.portlet.shopping.model.ShoppingCart; 021 022 /** 023 * The persistence interface for the shopping cart service. 024 * 025 * <p> 026 * Caching information and settings can be found in <code>portal.properties</code> 027 * </p> 028 * 029 * @author Brian Wing Shun Chan 030 * @see ShoppingCartPersistenceImpl 031 * @see ShoppingCartUtil 032 * @generated 033 */ 034 public interface ShoppingCartPersistence extends BasePersistence<ShoppingCart> { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify or reference this interface directly. Always use {@link ShoppingCartUtil} to access the shopping cart persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 039 */ 040 041 /** 042 * Caches the shopping cart in the entity cache if it is enabled. 043 * 044 * @param shoppingCart the shopping cart to cache 045 */ 046 public void cacheResult( 047 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart); 048 049 /** 050 * Caches the shopping carts in the entity cache if it is enabled. 051 * 052 * @param shoppingCarts the shopping carts to cache 053 */ 054 public void cacheResult( 055 java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts); 056 057 /** 058 * Creates a new shopping cart with the primary key. Does not add the shopping cart to the database. 059 * 060 * @param cartId the primary key for the new shopping cart 061 * @return the new shopping cart 062 */ 063 public com.liferay.portlet.shopping.model.ShoppingCart create(long cartId); 064 065 /** 066 * Removes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners. 067 * 068 * @param cartId the primary key of the shopping cart to remove 069 * @return the shopping cart that was removed 070 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 071 * @throws SystemException if a system exception occurred 072 */ 073 public com.liferay.portlet.shopping.model.ShoppingCart remove(long cartId) 074 throws com.liferay.portal.kernel.exception.SystemException, 075 com.liferay.portlet.shopping.NoSuchCartException; 076 077 public com.liferay.portlet.shopping.model.ShoppingCart updateImpl( 078 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart, 079 boolean merge) 080 throws com.liferay.portal.kernel.exception.SystemException; 081 082 /** 083 * Finds the shopping cart with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 084 * 085 * @param cartId the primary key of the shopping cart to find 086 * @return the shopping cart 087 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 088 * @throws SystemException if a system exception occurred 089 */ 090 public com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey( 091 long cartId) 092 throws com.liferay.portal.kernel.exception.SystemException, 093 com.liferay.portlet.shopping.NoSuchCartException; 094 095 /** 096 * Finds the shopping cart with the primary key or returns <code>null</code> if it could not be found. 097 * 098 * @param cartId the primary key of the shopping cart to find 099 * @return the shopping cart, or <code>null</code> if a shopping cart with the primary key could not be found 100 * @throws SystemException if a system exception occurred 101 */ 102 public com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey( 103 long cartId) throws com.liferay.portal.kernel.exception.SystemException; 104 105 /** 106 * Finds all the shopping carts where groupId = ?. 107 * 108 * @param groupId the group ID to search with 109 * @return the matching shopping carts 110 * @throws SystemException if a system exception occurred 111 */ 112 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 113 long groupId) 114 throws com.liferay.portal.kernel.exception.SystemException; 115 116 /** 117 * Finds a range of all the shopping carts where groupId = ?. 118 * 119 * <p> 120 * 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. 121 * </p> 122 * 123 * @param groupId the group ID to search with 124 * @param start the lower bound of the range of shopping carts to return 125 * @param end the upper bound of the range of shopping carts to return (not inclusive) 126 * @return the range of matching shopping carts 127 * @throws SystemException if a system exception occurred 128 */ 129 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 130 long groupId, int start, int end) 131 throws com.liferay.portal.kernel.exception.SystemException; 132 133 /** 134 * Finds an ordered range of all the shopping carts where groupId = ?. 135 * 136 * <p> 137 * 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. 138 * </p> 139 * 140 * @param groupId the group ID to search with 141 * @param start the lower bound of the range of shopping carts to return 142 * @param end the upper bound of the range of shopping carts to return (not inclusive) 143 * @param orderByComparator the comparator to order the results by 144 * @return the ordered range of matching shopping carts 145 * @throws SystemException if a system exception occurred 146 */ 147 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 148 long groupId, int start, int end, 149 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 150 throws com.liferay.portal.kernel.exception.SystemException; 151 152 /** 153 * Finds the first shopping cart in the ordered set where groupId = ?. 154 * 155 * <p> 156 * 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. 157 * </p> 158 * 159 * @param groupId the group ID to search with 160 * @param orderByComparator the comparator to order the set by 161 * @return the first matching shopping cart 162 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 163 * @throws SystemException if a system exception occurred 164 */ 165 public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First( 166 long groupId, 167 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 168 throws com.liferay.portal.kernel.exception.SystemException, 169 com.liferay.portlet.shopping.NoSuchCartException; 170 171 /** 172 * Finds the last shopping cart in the ordered set where groupId = ?. 173 * 174 * <p> 175 * 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. 176 * </p> 177 * 178 * @param groupId the group ID to search with 179 * @param orderByComparator the comparator to order the set by 180 * @return the last matching shopping cart 181 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 182 * @throws SystemException if a system exception occurred 183 */ 184 public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last( 185 long groupId, 186 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 187 throws com.liferay.portal.kernel.exception.SystemException, 188 com.liferay.portlet.shopping.NoSuchCartException; 189 190 /** 191 * Finds the shopping carts before and after the current shopping cart in the ordered set where groupId = ?. 192 * 193 * <p> 194 * 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. 195 * </p> 196 * 197 * @param cartId the primary key of the current shopping cart 198 * @param groupId the group ID to search with 199 * @param orderByComparator the comparator to order the set by 200 * @return the previous, current, and next shopping cart 201 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 202 * @throws SystemException if a system exception occurred 203 */ 204 public com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext( 205 long cartId, long groupId, 206 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 207 throws com.liferay.portal.kernel.exception.SystemException, 208 com.liferay.portlet.shopping.NoSuchCartException; 209 210 /** 211 * Finds all the shopping carts where userId = ?. 212 * 213 * @param userId the user ID to search with 214 * @return the matching shopping carts 215 * @throws SystemException if a system exception occurred 216 */ 217 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 218 long userId) throws com.liferay.portal.kernel.exception.SystemException; 219 220 /** 221 * Finds a range of all the shopping carts where userId = ?. 222 * 223 * <p> 224 * 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. 225 * </p> 226 * 227 * @param userId the user ID to search with 228 * @param start the lower bound of the range of shopping carts to return 229 * @param end the upper bound of the range of shopping carts to return (not inclusive) 230 * @return the range of matching shopping carts 231 * @throws SystemException if a system exception occurred 232 */ 233 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 234 long userId, int start, int end) 235 throws com.liferay.portal.kernel.exception.SystemException; 236 237 /** 238 * Finds an ordered range of all the shopping carts where userId = ?. 239 * 240 * <p> 241 * 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. 242 * </p> 243 * 244 * @param userId the user ID to search with 245 * @param start the lower bound of the range of shopping carts to return 246 * @param end the upper bound of the range of shopping carts to return (not inclusive) 247 * @param orderByComparator the comparator to order the results by 248 * @return the ordered range of matching shopping carts 249 * @throws SystemException if a system exception occurred 250 */ 251 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 252 long userId, int start, int end, 253 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 254 throws com.liferay.portal.kernel.exception.SystemException; 255 256 /** 257 * Finds the first shopping cart in the ordered set where userId = ?. 258 * 259 * <p> 260 * 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. 261 * </p> 262 * 263 * @param userId the user ID to search with 264 * @param orderByComparator the comparator to order the set by 265 * @return the first matching shopping cart 266 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 267 * @throws SystemException if a system exception occurred 268 */ 269 public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First( 270 long userId, 271 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 272 throws com.liferay.portal.kernel.exception.SystemException, 273 com.liferay.portlet.shopping.NoSuchCartException; 274 275 /** 276 * Finds the last shopping cart in the ordered set where userId = ?. 277 * 278 * <p> 279 * 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. 280 * </p> 281 * 282 * @param userId the user ID to search with 283 * @param orderByComparator the comparator to order the set by 284 * @return the last matching shopping cart 285 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 286 * @throws SystemException if a system exception occurred 287 */ 288 public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last( 289 long userId, 290 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 291 throws com.liferay.portal.kernel.exception.SystemException, 292 com.liferay.portlet.shopping.NoSuchCartException; 293 294 /** 295 * Finds the shopping carts before and after the current shopping cart in the ordered set where userId = ?. 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 userId the user 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 com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext( 309 long cartId, long userId, 310 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 311 throws com.liferay.portal.kernel.exception.SystemException, 312 com.liferay.portlet.shopping.NoSuchCartException; 313 314 /** 315 * Finds the shopping cart where groupId = ? and userId = ? or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 316 * 317 * @param groupId the group ID to search with 318 * @param userId the user ID to search with 319 * @return the matching shopping cart 320 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 321 * @throws SystemException if a system exception occurred 322 */ 323 public com.liferay.portlet.shopping.model.ShoppingCart findByG_U( 324 long groupId, long userId) 325 throws com.liferay.portal.kernel.exception.SystemException, 326 com.liferay.portlet.shopping.NoSuchCartException; 327 328 /** 329 * Finds the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 330 * 331 * @param groupId the group ID to search with 332 * @param userId the user ID to search with 333 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 334 * @throws SystemException if a system exception occurred 335 */ 336 public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 337 long groupId, long userId) 338 throws com.liferay.portal.kernel.exception.SystemException; 339 340 /** 341 * Finds the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 342 * 343 * @param groupId the group ID to search with 344 * @param userId the user ID to search with 345 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 346 * @throws SystemException if a system exception occurred 347 */ 348 public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 349 long groupId, long userId, boolean retrieveFromCache) 350 throws com.liferay.portal.kernel.exception.SystemException; 351 352 /** 353 * Finds all the shopping carts. 354 * 355 * @return the shopping carts 356 * @throws SystemException if a system exception occurred 357 */ 358 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll() 359 throws com.liferay.portal.kernel.exception.SystemException; 360 361 /** 362 * Finds a range of all the shopping carts. 363 * 364 * <p> 365 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 366 * </p> 367 * 368 * @param start the lower bound of the range of shopping carts to return 369 * @param end the upper bound of the range of shopping carts to return (not inclusive) 370 * @return the range of shopping carts 371 * @throws SystemException if a system exception occurred 372 */ 373 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 374 int start, int end) 375 throws com.liferay.portal.kernel.exception.SystemException; 376 377 /** 378 * Finds an ordered range of all the shopping carts. 379 * 380 * <p> 381 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 382 * </p> 383 * 384 * @param start the lower bound of the range of shopping carts to return 385 * @param end the upper bound of the range of shopping carts to return (not inclusive) 386 * @param orderByComparator the comparator to order the results by 387 * @return the ordered range of shopping carts 388 * @throws SystemException if a system exception occurred 389 */ 390 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 391 int start, int end, 392 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 393 throws com.liferay.portal.kernel.exception.SystemException; 394 395 /** 396 * Removes all the shopping carts where groupId = ? from the database. 397 * 398 * @param groupId the group ID to search with 399 * @throws SystemException if a system exception occurred 400 */ 401 public void removeByGroupId(long groupId) 402 throws com.liferay.portal.kernel.exception.SystemException; 403 404 /** 405 * Removes all the shopping carts where userId = ? from the database. 406 * 407 * @param userId the user ID to search with 408 * @throws SystemException if a system exception occurred 409 */ 410 public void removeByUserId(long userId) 411 throws com.liferay.portal.kernel.exception.SystemException; 412 413 /** 414 * Removes the shopping cart where groupId = ? and userId = ? from the database. 415 * 416 * @param groupId the group ID to search with 417 * @param userId the user ID to search with 418 * @throws SystemException if a system exception occurred 419 */ 420 public void removeByG_U(long groupId, long userId) 421 throws com.liferay.portal.kernel.exception.SystemException, 422 com.liferay.portlet.shopping.NoSuchCartException; 423 424 /** 425 * Removes all the shopping carts from the database. 426 * 427 * @throws SystemException if a system exception occurred 428 */ 429 public void removeAll() 430 throws com.liferay.portal.kernel.exception.SystemException; 431 432 /** 433 * Counts all the shopping carts where groupId = ?. 434 * 435 * @param groupId the group ID to search with 436 * @return the number of matching shopping carts 437 * @throws SystemException if a system exception occurred 438 */ 439 public int countByGroupId(long groupId) 440 throws com.liferay.portal.kernel.exception.SystemException; 441 442 /** 443 * Counts all the shopping carts where userId = ?. 444 * 445 * @param userId the user ID to search with 446 * @return the number of matching shopping carts 447 * @throws SystemException if a system exception occurred 448 */ 449 public int countByUserId(long userId) 450 throws com.liferay.portal.kernel.exception.SystemException; 451 452 /** 453 * Counts all the shopping carts where groupId = ? and userId = ?. 454 * 455 * @param groupId the group ID to search with 456 * @param userId the user ID to search with 457 * @return the number of matching shopping carts 458 * @throws SystemException if a system exception occurred 459 */ 460 public int countByG_U(long groupId, long userId) 461 throws com.liferay.portal.kernel.exception.SystemException; 462 463 /** 464 * Counts all the shopping carts. 465 * 466 * @return the number of shopping carts 467 * @throws SystemException if a system exception occurred 468 */ 469 public int countAll() 470 throws com.liferay.portal.kernel.exception.SystemException; 471 472 public ShoppingCart remove(ShoppingCart shoppingCart) 473 throws SystemException; 474 }