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 com.liferay.portlet.shopping.service.persistence.impl.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<ShoppingCart> findByGroupId(long groupId); 050 051 /** 052 * Returns a range of all the shopping carts where groupId = ?. 053 * 054 * <p> 055 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 056 * </p> 057 * 058 * @param groupId the group ID 059 * @param start the lower bound of the range of shopping carts 060 * @param end the upper bound of the range of shopping carts (not inclusive) 061 * @return the range of matching shopping carts 062 */ 063 public java.util.List<ShoppingCart> findByGroupId(long groupId, int start, 064 int end); 065 066 /** 067 * Returns an ordered range of all the shopping carts where groupId = ?. 068 * 069 * <p> 070 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 071 * </p> 072 * 073 * @param groupId the group ID 074 * @param start the lower bound of the range of shopping carts 075 * @param end the upper bound of the range of shopping carts (not inclusive) 076 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 077 * @return the ordered range of matching shopping carts 078 */ 079 public java.util.List<ShoppingCart> findByGroupId(long groupId, int start, 080 int end, 081 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator); 082 083 /** 084 * Returns the first shopping cart in the ordered set where groupId = ?. 085 * 086 * @param groupId the group ID 087 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 088 * @return the first matching shopping cart 089 * @throws NoSuchCartException if a matching shopping cart could not be found 090 */ 091 public ShoppingCart findByGroupId_First(long groupId, 092 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator) 093 throws com.liferay.portlet.shopping.NoSuchCartException; 094 095 /** 096 * Returns the first shopping cart in the ordered set where groupId = ?. 097 * 098 * @param groupId the group ID 099 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 100 * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 101 */ 102 public ShoppingCart fetchByGroupId_First(long groupId, 103 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator); 104 105 /** 106 * Returns the last shopping cart in the ordered set where groupId = ?. 107 * 108 * @param groupId the group ID 109 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 110 * @return the last matching shopping cart 111 * @throws NoSuchCartException if a matching shopping cart could not be found 112 */ 113 public ShoppingCart findByGroupId_Last(long groupId, 114 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator) 115 throws com.liferay.portlet.shopping.NoSuchCartException; 116 117 /** 118 * Returns the last shopping cart in the ordered set where groupId = ?. 119 * 120 * @param groupId the group ID 121 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 122 * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 123 */ 124 public ShoppingCart fetchByGroupId_Last(long groupId, 125 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator); 126 127 /** 128 * Returns the shopping carts before and after the current shopping cart in the ordered set where groupId = ?. 129 * 130 * @param cartId the primary key of the current shopping cart 131 * @param groupId the group ID 132 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 133 * @return the previous, current, and next shopping cart 134 * @throws NoSuchCartException if a shopping cart with the primary key could not be found 135 */ 136 public ShoppingCart[] findByGroupId_PrevAndNext(long cartId, long groupId, 137 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator) 138 throws com.liferay.portlet.shopping.NoSuchCartException; 139 140 /** 141 * Removes all the shopping carts where groupId = ? from the database. 142 * 143 * @param groupId the group ID 144 */ 145 public void removeByGroupId(long groupId); 146 147 /** 148 * Returns the number of shopping carts where groupId = ?. 149 * 150 * @param groupId the group ID 151 * @return the number of matching shopping carts 152 */ 153 public int countByGroupId(long groupId); 154 155 /** 156 * Returns all the shopping carts where userId = ?. 157 * 158 * @param userId the user ID 159 * @return the matching shopping carts 160 */ 161 public java.util.List<ShoppingCart> findByUserId(long userId); 162 163 /** 164 * Returns a range of all the shopping carts where userId = ?. 165 * 166 * <p> 167 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 168 * </p> 169 * 170 * @param userId the user ID 171 * @param start the lower bound of the range of shopping carts 172 * @param end the upper bound of the range of shopping carts (not inclusive) 173 * @return the range of matching shopping carts 174 */ 175 public java.util.List<ShoppingCart> findByUserId(long userId, int start, 176 int end); 177 178 /** 179 * Returns an ordered range of all the shopping carts where userId = ?. 180 * 181 * <p> 182 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 183 * </p> 184 * 185 * @param userId the user ID 186 * @param start the lower bound of the range of shopping carts 187 * @param end the upper bound of the range of shopping carts (not inclusive) 188 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 189 * @return the ordered range of matching shopping carts 190 */ 191 public java.util.List<ShoppingCart> findByUserId(long userId, int start, 192 int end, 193 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator); 194 195 /** 196 * Returns the first shopping cart in the ordered set where userId = ?. 197 * 198 * @param userId the user ID 199 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 200 * @return the first matching shopping cart 201 * @throws NoSuchCartException if a matching shopping cart could not be found 202 */ 203 public ShoppingCart findByUserId_First(long userId, 204 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator) 205 throws com.liferay.portlet.shopping.NoSuchCartException; 206 207 /** 208 * Returns the first shopping cart in the ordered set where userId = ?. 209 * 210 * @param userId the user ID 211 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 212 * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 213 */ 214 public ShoppingCart fetchByUserId_First(long userId, 215 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator); 216 217 /** 218 * Returns the last shopping cart in the ordered set where userId = ?. 219 * 220 * @param userId the user ID 221 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 222 * @return the last matching shopping cart 223 * @throws NoSuchCartException if a matching shopping cart could not be found 224 */ 225 public ShoppingCart findByUserId_Last(long userId, 226 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator) 227 throws com.liferay.portlet.shopping.NoSuchCartException; 228 229 /** 230 * Returns the last shopping cart in the ordered set where userId = ?. 231 * 232 * @param userId the user ID 233 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 234 * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 235 */ 236 public ShoppingCart fetchByUserId_Last(long userId, 237 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator); 238 239 /** 240 * Returns the shopping carts before and after the current shopping cart in the ordered set where userId = ?. 241 * 242 * @param cartId the primary key of the current shopping cart 243 * @param userId the user ID 244 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 245 * @return the previous, current, and next shopping cart 246 * @throws NoSuchCartException if a shopping cart with the primary key could not be found 247 */ 248 public ShoppingCart[] findByUserId_PrevAndNext(long cartId, long userId, 249 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator) 250 throws com.liferay.portlet.shopping.NoSuchCartException; 251 252 /** 253 * Removes all the shopping carts where userId = ? from the database. 254 * 255 * @param userId the user ID 256 */ 257 public void removeByUserId(long userId); 258 259 /** 260 * Returns the number of shopping carts where userId = ?. 261 * 262 * @param userId the user ID 263 * @return the number of matching shopping carts 264 */ 265 public int countByUserId(long userId); 266 267 /** 268 * Returns the shopping cart where groupId = ? and userId = ? or throws a {@link NoSuchCartException} if it could not be found. 269 * 270 * @param groupId the group ID 271 * @param userId the user ID 272 * @return the matching shopping cart 273 * @throws NoSuchCartException if a matching shopping cart could not be found 274 */ 275 public ShoppingCart findByG_U(long groupId, long userId) 276 throws com.liferay.portlet.shopping.NoSuchCartException; 277 278 /** 279 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 280 * 281 * @param groupId the group ID 282 * @param userId the user ID 283 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 284 */ 285 public ShoppingCart fetchByG_U(long groupId, long userId); 286 287 /** 288 * Returns the shopping cart where groupId = ? and userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 289 * 290 * @param groupId the group ID 291 * @param userId the user ID 292 * @param retrieveFromCache whether to use the finder cache 293 * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found 294 */ 295 public ShoppingCart fetchByG_U(long groupId, long userId, 296 boolean retrieveFromCache); 297 298 /** 299 * Removes the shopping cart where groupId = ? and userId = ? from the database. 300 * 301 * @param groupId the group ID 302 * @param userId the user ID 303 * @return the shopping cart that was removed 304 */ 305 public ShoppingCart removeByG_U(long groupId, long userId) 306 throws com.liferay.portlet.shopping.NoSuchCartException; 307 308 /** 309 * Returns the number of shopping carts where groupId = ? and userId = ?. 310 * 311 * @param groupId the group ID 312 * @param userId the user ID 313 * @return the number of matching shopping carts 314 */ 315 public int countByG_U(long groupId, long userId); 316 317 /** 318 * Caches the shopping cart in the entity cache if it is enabled. 319 * 320 * @param shoppingCart the shopping cart 321 */ 322 public void cacheResult(ShoppingCart shoppingCart); 323 324 /** 325 * Caches the shopping carts in the entity cache if it is enabled. 326 * 327 * @param shoppingCarts the shopping carts 328 */ 329 public void cacheResult(java.util.List<ShoppingCart> shoppingCarts); 330 331 /** 332 * Creates a new shopping cart with the primary key. Does not add the shopping cart to the database. 333 * 334 * @param cartId the primary key for the new shopping cart 335 * @return the new shopping cart 336 */ 337 public ShoppingCart create(long cartId); 338 339 /** 340 * Removes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners. 341 * 342 * @param cartId the primary key of the shopping cart 343 * @return the shopping cart that was removed 344 * @throws NoSuchCartException if a shopping cart with the primary key could not be found 345 */ 346 public ShoppingCart remove(long cartId) 347 throws com.liferay.portlet.shopping.NoSuchCartException; 348 349 public ShoppingCart updateImpl(ShoppingCart shoppingCart); 350 351 /** 352 * Returns the shopping cart with the primary key or throws a {@link NoSuchCartException} if it could not be found. 353 * 354 * @param cartId the primary key of the shopping cart 355 * @return the shopping cart 356 * @throws NoSuchCartException if a shopping cart with the primary key could not be found 357 */ 358 public ShoppingCart findByPrimaryKey(long cartId) 359 throws com.liferay.portlet.shopping.NoSuchCartException; 360 361 /** 362 * Returns the shopping cart with the primary key or returns <code>null</code> if it could not be found. 363 * 364 * @param cartId the primary key of the shopping cart 365 * @return the shopping cart, or <code>null</code> if a shopping cart with the primary key could not be found 366 */ 367 public ShoppingCart fetchByPrimaryKey(long cartId); 368 369 @Override 370 public java.util.Map<java.io.Serializable, ShoppingCart> fetchByPrimaryKeys( 371 java.util.Set<java.io.Serializable> primaryKeys); 372 373 /** 374 * Returns all the shopping carts. 375 * 376 * @return the shopping carts 377 */ 378 public java.util.List<ShoppingCart> findAll(); 379 380 /** 381 * Returns a range of all the shopping carts. 382 * 383 * <p> 384 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 385 * </p> 386 * 387 * @param start the lower bound of the range of shopping carts 388 * @param end the upper bound of the range of shopping carts (not inclusive) 389 * @return the range of shopping carts 390 */ 391 public java.util.List<ShoppingCart> findAll(int start, int end); 392 393 /** 394 * Returns an ordered range of all the shopping carts. 395 * 396 * <p> 397 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 398 * </p> 399 * 400 * @param start the lower bound of the range of shopping carts 401 * @param end the upper bound of the range of shopping carts (not inclusive) 402 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 403 * @return the ordered range of shopping carts 404 */ 405 public java.util.List<ShoppingCart> findAll(int start, int end, 406 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCart> orderByComparator); 407 408 /** 409 * Removes all the shopping carts from the database. 410 */ 411 public void removeAll(); 412 413 /** 414 * Returns the number of shopping carts. 415 * 416 * @return the number of shopping carts 417 */ 418 public int countAll(); 419 }