001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portlet.shopping.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.service.persistence.BasePersistence; 020 021 import com.liferay.portlet.shopping.model.ShoppingCart; 022 023 /** 024 * The persistence interface for the shopping cart service. 025 * 026 * <p> 027 * Caching information and settings can be found in <code>portal.properties</code> 028 * </p> 029 * 030 * @author Brian Wing Shun Chan 031 * @see ShoppingCartPersistenceImpl 032 * @see ShoppingCartUtil 033 * @generated 034 */ 035 @ProviderType 036 public interface ShoppingCartPersistence extends BasePersistence<ShoppingCart> { 037 /* 038 * NOTE FOR DEVELOPERS: 039 * 040 * 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. 041 */ 042 043 /** 044 * Returns all the shopping carts where groupId = ?. 045 * 046 * @param groupId the group ID 047 * @return the matching shopping carts 048 */ 049 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 050 long groupId); 051 052 /** 053 * Returns a range of all the shopping carts where groupId = ?. 054 * 055 * <p> 056 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCartModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 057 * </p> 058 * 059 * @param groupId the group ID 060 * @param start the lower bound of the range of shopping carts 061 * @param end the upper bound of the range of shopping carts (not inclusive) 062 * @return the range of matching shopping carts 063 */ 064 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 065 long groupId, int start, int end); 066 067 /** 068 * Returns an ordered range of all the shopping carts where groupId = ?. 069 * 070 * <p> 071 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCartModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 072 * </p> 073 * 074 * @param groupId the group ID 075 * @param start the lower bound of the range of shopping carts 076 * @param end the upper bound of the range of shopping carts (not inclusive) 077 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 078 * @return the ordered range of matching shopping carts 079 */ 080 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId( 081 long groupId, int start, int end, 082 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator); 083 084 /** 085 * Returns the first shopping cart in the ordered set where groupId = ?. 086 * 087 * @param groupId the group ID 088 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 089 * @return the first matching shopping cart 090 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 091 */ 092 public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First( 093 long groupId, 094 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator) 095 throws com.liferay.portlet.shopping.NoSuchCartException; 096 097 /** 098 * Returns the first shopping cart in the ordered set where groupId = ?. 099 * 100 * @param groupId the group ID 101 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 102 * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 103 */ 104 public com.liferay.portlet.shopping.model.ShoppingCart fetchByGroupId_First( 105 long groupId, 106 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator); 107 108 /** 109 * Returns the last shopping cart in the ordered set where groupId = ?. 110 * 111 * @param groupId the group ID 112 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 113 * @return the last matching shopping cart 114 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 115 */ 116 public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last( 117 long groupId, 118 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator) 119 throws com.liferay.portlet.shopping.NoSuchCartException; 120 121 /** 122 * Returns the last shopping cart in the ordered set where groupId = ?. 123 * 124 * @param groupId the group ID 125 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 126 * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 127 */ 128 public com.liferay.portlet.shopping.model.ShoppingCart fetchByGroupId_Last( 129 long groupId, 130 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator); 131 132 /** 133 * Returns the shopping carts before and after the current shopping cart in the ordered set where groupId = ?. 134 * 135 * @param cartId the primary key of the current shopping cart 136 * @param groupId the group ID 137 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 138 * @return the previous, current, and next shopping cart 139 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 140 */ 141 public com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext( 142 long cartId, long groupId, 143 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator) 144 throws com.liferay.portlet.shopping.NoSuchCartException; 145 146 /** 147 * Removes all the shopping carts where groupId = ? from the database. 148 * 149 * @param groupId the group ID 150 */ 151 public void removeByGroupId(long groupId); 152 153 /** 154 * Returns the number of shopping carts where groupId = ?. 155 * 156 * @param groupId the group ID 157 * @return the number of matching shopping carts 158 */ 159 public int countByGroupId(long groupId); 160 161 /** 162 * Returns all the shopping carts where userId = ?. 163 * 164 * @param userId the user ID 165 * @return the matching shopping carts 166 */ 167 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 168 long userId); 169 170 /** 171 * Returns a range of all the shopping carts where userId = ?. 172 * 173 * <p> 174 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCartModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 175 * </p> 176 * 177 * @param userId the user ID 178 * @param start the lower bound of the range of shopping carts 179 * @param end the upper bound of the range of shopping carts (not inclusive) 180 * @return the range of matching shopping carts 181 */ 182 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 183 long userId, int start, int end); 184 185 /** 186 * Returns an ordered range of all the shopping carts where userId = ?. 187 * 188 * <p> 189 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCartModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 190 * </p> 191 * 192 * @param userId the user ID 193 * @param start the lower bound of the range of shopping carts 194 * @param end the upper bound of the range of shopping carts (not inclusive) 195 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 196 * @return the ordered range of matching shopping carts 197 */ 198 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId( 199 long userId, int start, int end, 200 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator); 201 202 /** 203 * Returns the first shopping cart in the ordered set where userId = ?. 204 * 205 * @param userId the user ID 206 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 207 * @return the first matching shopping cart 208 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 209 */ 210 public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First( 211 long userId, 212 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator) 213 throws com.liferay.portlet.shopping.NoSuchCartException; 214 215 /** 216 * Returns the first shopping cart in the ordered set where userId = ?. 217 * 218 * @param userId the user ID 219 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 220 * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 221 */ 222 public com.liferay.portlet.shopping.model.ShoppingCart fetchByUserId_First( 223 long userId, 224 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator); 225 226 /** 227 * Returns the last shopping cart in the ordered set where userId = ?. 228 * 229 * @param userId the user ID 230 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 231 * @return the last matching shopping cart 232 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 233 */ 234 public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last( 235 long userId, 236 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator) 237 throws com.liferay.portlet.shopping.NoSuchCartException; 238 239 /** 240 * Returns the last shopping cart in the ordered set where userId = ?. 241 * 242 * @param userId the user ID 243 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 244 * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 245 */ 246 public com.liferay.portlet.shopping.model.ShoppingCart fetchByUserId_Last( 247 long userId, 248 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator); 249 250 /** 251 * Returns the shopping carts before and after the current shopping cart in the ordered set where userId = ?. 252 * 253 * @param cartId the primary key of the current shopping cart 254 * @param userId the user ID 255 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 256 * @return the previous, current, and next shopping cart 257 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 258 */ 259 public com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext( 260 long cartId, long userId, 261 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator) 262 throws com.liferay.portlet.shopping.NoSuchCartException; 263 264 /** 265 * Removes all the shopping carts where userId = ? from the database. 266 * 267 * @param userId the user ID 268 */ 269 public void removeByUserId(long userId); 270 271 /** 272 * Returns the number of shopping carts where userId = ?. 273 * 274 * @param userId the user ID 275 * @return the number of matching shopping carts 276 */ 277 public int countByUserId(long userId); 278 279 /** 280 * Returns the shopping cart where groupId = ? and userId = ? or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 281 * 282 * @param groupId the group ID 283 * @param userId the user ID 284 * @return the matching shopping cart 285 * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found 286 */ 287 public com.liferay.portlet.shopping.model.ShoppingCart findByG_U( 288 long groupId, long userId) 289 throws com.liferay.portlet.shopping.NoSuchCartException; 290 291 /** 292 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 293 * 294 * @param groupId the group ID 295 * @param userId the user ID 296 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 297 */ 298 public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 299 long groupId, long userId); 300 301 /** 302 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 303 * 304 * @param groupId the group ID 305 * @param userId the user ID 306 * @param retrieveFromCache whether to use the finder cache 307 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 308 */ 309 public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U( 310 long groupId, long userId, boolean retrieveFromCache); 311 312 /** 313 * Removes the shopping cart where groupId = ? and userId = ? from the database. 314 * 315 * @param groupId the group ID 316 * @param userId the user ID 317 * @return the shopping cart that was removed 318 */ 319 public com.liferay.portlet.shopping.model.ShoppingCart removeByG_U( 320 long groupId, long userId) 321 throws com.liferay.portlet.shopping.NoSuchCartException; 322 323 /** 324 * Returns the number of shopping carts where groupId = ? and userId = ?. 325 * 326 * @param groupId the group ID 327 * @param userId the user ID 328 * @return the number of matching shopping carts 329 */ 330 public int countByG_U(long groupId, long userId); 331 332 /** 333 * Caches the shopping cart in the entity cache if it is enabled. 334 * 335 * @param shoppingCart the shopping cart 336 */ 337 public void cacheResult( 338 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart); 339 340 /** 341 * Caches the shopping carts in the entity cache if it is enabled. 342 * 343 * @param shoppingCarts the shopping carts 344 */ 345 public void cacheResult( 346 java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts); 347 348 /** 349 * Creates a new shopping cart with the primary key. Does not add the shopping cart to the database. 350 * 351 * @param cartId the primary key for the new shopping cart 352 * @return the new shopping cart 353 */ 354 public com.liferay.portlet.shopping.model.ShoppingCart create(long cartId); 355 356 /** 357 * Removes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners. 358 * 359 * @param cartId the primary key of the shopping cart 360 * @return the shopping cart that was removed 361 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 362 */ 363 public com.liferay.portlet.shopping.model.ShoppingCart remove(long cartId) 364 throws com.liferay.portlet.shopping.NoSuchCartException; 365 366 public com.liferay.portlet.shopping.model.ShoppingCart updateImpl( 367 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart); 368 369 /** 370 * Returns the shopping cart with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found. 371 * 372 * @param cartId the primary key of the shopping cart 373 * @return the shopping cart 374 * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found 375 */ 376 public com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey( 377 long cartId) throws com.liferay.portlet.shopping.NoSuchCartException; 378 379 /** 380 * Returns the shopping cart with the primary key or returns <code>null</code> if it could not be found. 381 * 382 * @param cartId the primary key of the shopping cart 383 * @return the shopping cart, or <code>null</code> if a shopping cart with the primary key could not be found 384 */ 385 public com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey( 386 long cartId); 387 388 @Override 389 public java.util.Map<java.io.Serializable, com.liferay.portlet.shopping.model.ShoppingCart> fetchByPrimaryKeys( 390 java.util.Set<java.io.Serializable> primaryKeys); 391 392 /** 393 * Returns all the shopping carts. 394 * 395 * @return the shopping carts 396 */ 397 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(); 398 399 /** 400 * Returns a range of all the shopping carts. 401 * 402 * <p> 403 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCartModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 404 * </p> 405 * 406 * @param start the lower bound of the range of shopping carts 407 * @param end the upper bound of the range of shopping carts (not inclusive) 408 * @return the range of shopping carts 409 */ 410 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 411 int start, int end); 412 413 /** 414 * Returns an ordered range of all the shopping carts. 415 * 416 * <p> 417 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCartModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 418 * </p> 419 * 420 * @param start the lower bound of the range of shopping carts 421 * @param end the upper bound of the range of shopping carts (not inclusive) 422 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 423 * @return the ordered range of shopping carts 424 */ 425 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll( 426 int start, int end, 427 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingCart> orderByComparator); 428 429 /** 430 * Removes all the shopping carts from the database. 431 */ 432 public void removeAll(); 433 434 /** 435 * Returns the number of shopping carts. 436 * 437 * @return the number of shopping carts 438 */ 439 public int countAll(); 440 }