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.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.util.OrderByComparator; 022 import com.liferay.portal.kernel.util.ReferenceRegistry; 023 import com.liferay.portal.service.ServiceContext; 024 025 import com.liferay.portlet.shopping.model.ShoppingItem; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the shopping item service. This utility wraps {@link com.liferay.portlet.shopping.service.persistence.impl.ShoppingItemPersistenceImpl} 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. 031 * 032 * <p> 033 * Caching information and settings can be found in <code>portal.properties</code> 034 * </p> 035 * 036 * @author Brian Wing Shun Chan 037 * @see ShoppingItemPersistence 038 * @see com.liferay.portlet.shopping.service.persistence.impl.ShoppingItemPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class ShoppingItemUtil { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 047 */ 048 049 /** 050 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 051 */ 052 public static void clearCache() { 053 getPersistence().clearCache(); 054 } 055 056 /** 057 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 058 */ 059 public static void clearCache(ShoppingItem shoppingItem) { 060 getPersistence().clearCache(shoppingItem); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 067 return getPersistence().countWithDynamicQuery(dynamicQuery); 068 } 069 070 /** 071 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 072 */ 073 public static List<ShoppingItem> findWithDynamicQuery( 074 DynamicQuery dynamicQuery) { 075 return getPersistence().findWithDynamicQuery(dynamicQuery); 076 } 077 078 /** 079 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 080 */ 081 public static List<ShoppingItem> findWithDynamicQuery( 082 DynamicQuery dynamicQuery, int start, int end) { 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<ShoppingItem> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator<ShoppingItem> orderByComparator) { 092 return getPersistence() 093 .findWithDynamicQuery(dynamicQuery, start, end, 094 orderByComparator); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 099 */ 100 public static ShoppingItem update(ShoppingItem shoppingItem) { 101 return getPersistence().update(shoppingItem); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 106 */ 107 public static ShoppingItem update(ShoppingItem shoppingItem, 108 ServiceContext serviceContext) { 109 return getPersistence().update(shoppingItem, serviceContext); 110 } 111 112 /** 113 * Returns the shopping item where smallImageId = ? or throws a {@link NoSuchItemException} if it could not be found. 114 * 115 * @param smallImageId the small image ID 116 * @return the matching shopping item 117 * @throws NoSuchItemException if a matching shopping item could not be found 118 */ 119 public static ShoppingItem findBySmallImageId(long smallImageId) 120 throws com.liferay.portlet.shopping.NoSuchItemException { 121 return getPersistence().findBySmallImageId(smallImageId); 122 } 123 124 /** 125 * Returns the shopping item where smallImageId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 126 * 127 * @param smallImageId the small image ID 128 * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found 129 */ 130 public static ShoppingItem fetchBySmallImageId(long smallImageId) { 131 return getPersistence().fetchBySmallImageId(smallImageId); 132 } 133 134 /** 135 * Returns the shopping item where smallImageId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 136 * 137 * @param smallImageId the small image ID 138 * @param retrieveFromCache whether to use the finder cache 139 * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found 140 */ 141 public static ShoppingItem fetchBySmallImageId(long smallImageId, 142 boolean retrieveFromCache) { 143 return getPersistence() 144 .fetchBySmallImageId(smallImageId, retrieveFromCache); 145 } 146 147 /** 148 * Removes the shopping item where smallImageId = ? from the database. 149 * 150 * @param smallImageId the small image ID 151 * @return the shopping item that was removed 152 */ 153 public static ShoppingItem removeBySmallImageId(long smallImageId) 154 throws com.liferay.portlet.shopping.NoSuchItemException { 155 return getPersistence().removeBySmallImageId(smallImageId); 156 } 157 158 /** 159 * Returns the number of shopping items where smallImageId = ?. 160 * 161 * @param smallImageId the small image ID 162 * @return the number of matching shopping items 163 */ 164 public static int countBySmallImageId(long smallImageId) { 165 return getPersistence().countBySmallImageId(smallImageId); 166 } 167 168 /** 169 * Returns the shopping item where mediumImageId = ? or throws a {@link NoSuchItemException} if it could not be found. 170 * 171 * @param mediumImageId the medium image ID 172 * @return the matching shopping item 173 * @throws NoSuchItemException if a matching shopping item could not be found 174 */ 175 public static ShoppingItem findByMediumImageId(long mediumImageId) 176 throws com.liferay.portlet.shopping.NoSuchItemException { 177 return getPersistence().findByMediumImageId(mediumImageId); 178 } 179 180 /** 181 * Returns the shopping item where mediumImageId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 182 * 183 * @param mediumImageId the medium image ID 184 * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found 185 */ 186 public static ShoppingItem fetchByMediumImageId(long mediumImageId) { 187 return getPersistence().fetchByMediumImageId(mediumImageId); 188 } 189 190 /** 191 * Returns the shopping item where mediumImageId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 192 * 193 * @param mediumImageId the medium image ID 194 * @param retrieveFromCache whether to use the finder cache 195 * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found 196 */ 197 public static ShoppingItem fetchByMediumImageId(long mediumImageId, 198 boolean retrieveFromCache) { 199 return getPersistence() 200 .fetchByMediumImageId(mediumImageId, retrieveFromCache); 201 } 202 203 /** 204 * Removes the shopping item where mediumImageId = ? from the database. 205 * 206 * @param mediumImageId the medium image ID 207 * @return the shopping item that was removed 208 */ 209 public static ShoppingItem removeByMediumImageId(long mediumImageId) 210 throws com.liferay.portlet.shopping.NoSuchItemException { 211 return getPersistence().removeByMediumImageId(mediumImageId); 212 } 213 214 /** 215 * Returns the number of shopping items where mediumImageId = ?. 216 * 217 * @param mediumImageId the medium image ID 218 * @return the number of matching shopping items 219 */ 220 public static int countByMediumImageId(long mediumImageId) { 221 return getPersistence().countByMediumImageId(mediumImageId); 222 } 223 224 /** 225 * Returns the shopping item where largeImageId = ? or throws a {@link NoSuchItemException} if it could not be found. 226 * 227 * @param largeImageId the large image ID 228 * @return the matching shopping item 229 * @throws NoSuchItemException if a matching shopping item could not be found 230 */ 231 public static ShoppingItem findByLargeImageId(long largeImageId) 232 throws com.liferay.portlet.shopping.NoSuchItemException { 233 return getPersistence().findByLargeImageId(largeImageId); 234 } 235 236 /** 237 * Returns the shopping item where largeImageId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 238 * 239 * @param largeImageId the large image ID 240 * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found 241 */ 242 public static ShoppingItem fetchByLargeImageId(long largeImageId) { 243 return getPersistence().fetchByLargeImageId(largeImageId); 244 } 245 246 /** 247 * Returns the shopping item where largeImageId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 248 * 249 * @param largeImageId the large image ID 250 * @param retrieveFromCache whether to use the finder cache 251 * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found 252 */ 253 public static ShoppingItem fetchByLargeImageId(long largeImageId, 254 boolean retrieveFromCache) { 255 return getPersistence() 256 .fetchByLargeImageId(largeImageId, retrieveFromCache); 257 } 258 259 /** 260 * Removes the shopping item where largeImageId = ? from the database. 261 * 262 * @param largeImageId the large image ID 263 * @return the shopping item that was removed 264 */ 265 public static ShoppingItem removeByLargeImageId(long largeImageId) 266 throws com.liferay.portlet.shopping.NoSuchItemException { 267 return getPersistence().removeByLargeImageId(largeImageId); 268 } 269 270 /** 271 * Returns the number of shopping items where largeImageId = ?. 272 * 273 * @param largeImageId the large image ID 274 * @return the number of matching shopping items 275 */ 276 public static int countByLargeImageId(long largeImageId) { 277 return getPersistence().countByLargeImageId(largeImageId); 278 } 279 280 /** 281 * Returns all the shopping items where groupId = ? and categoryId = ?. 282 * 283 * @param groupId the group ID 284 * @param categoryId the category ID 285 * @return the matching shopping items 286 */ 287 public static List<ShoppingItem> findByG_C(long groupId, long categoryId) { 288 return getPersistence().findByG_C(groupId, categoryId); 289 } 290 291 /** 292 * Returns a range of all the shopping items where groupId = ? and categoryId = ?. 293 * 294 * <p> 295 * 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 ShoppingItemModelImpl}. 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. 296 * </p> 297 * 298 * @param groupId the group ID 299 * @param categoryId the category ID 300 * @param start the lower bound of the range of shopping items 301 * @param end the upper bound of the range of shopping items (not inclusive) 302 * @return the range of matching shopping items 303 */ 304 public static List<ShoppingItem> findByG_C(long groupId, long categoryId, 305 int start, int end) { 306 return getPersistence().findByG_C(groupId, categoryId, start, end); 307 } 308 309 /** 310 * Returns an ordered range of all the shopping items where groupId = ? and categoryId = ?. 311 * 312 * <p> 313 * 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 ShoppingItemModelImpl}. 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. 314 * </p> 315 * 316 * @param groupId the group ID 317 * @param categoryId the category ID 318 * @param start the lower bound of the range of shopping items 319 * @param end the upper bound of the range of shopping items (not inclusive) 320 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 321 * @return the ordered range of matching shopping items 322 */ 323 public static List<ShoppingItem> findByG_C(long groupId, long categoryId, 324 int start, int end, OrderByComparator<ShoppingItem> orderByComparator) { 325 return getPersistence() 326 .findByG_C(groupId, categoryId, start, end, orderByComparator); 327 } 328 329 /** 330 * Returns the first shopping item in the ordered set where groupId = ? and categoryId = ?. 331 * 332 * @param groupId the group ID 333 * @param categoryId the category ID 334 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 335 * @return the first matching shopping item 336 * @throws NoSuchItemException if a matching shopping item could not be found 337 */ 338 public static ShoppingItem findByG_C_First(long groupId, long categoryId, 339 OrderByComparator<ShoppingItem> orderByComparator) 340 throws com.liferay.portlet.shopping.NoSuchItemException { 341 return getPersistence() 342 .findByG_C_First(groupId, categoryId, orderByComparator); 343 } 344 345 /** 346 * Returns the first shopping item in the ordered set where groupId = ? and categoryId = ?. 347 * 348 * @param groupId the group ID 349 * @param categoryId the category ID 350 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 351 * @return the first matching shopping item, or <code>null</code> if a matching shopping item could not be found 352 */ 353 public static ShoppingItem fetchByG_C_First(long groupId, long categoryId, 354 OrderByComparator<ShoppingItem> orderByComparator) { 355 return getPersistence() 356 .fetchByG_C_First(groupId, categoryId, orderByComparator); 357 } 358 359 /** 360 * Returns the last shopping item in the ordered set where groupId = ? and categoryId = ?. 361 * 362 * @param groupId the group ID 363 * @param categoryId the category ID 364 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 365 * @return the last matching shopping item 366 * @throws NoSuchItemException if a matching shopping item could not be found 367 */ 368 public static ShoppingItem findByG_C_Last(long groupId, long categoryId, 369 OrderByComparator<ShoppingItem> orderByComparator) 370 throws com.liferay.portlet.shopping.NoSuchItemException { 371 return getPersistence() 372 .findByG_C_Last(groupId, categoryId, orderByComparator); 373 } 374 375 /** 376 * Returns the last shopping item in the ordered set where groupId = ? and categoryId = ?. 377 * 378 * @param groupId the group ID 379 * @param categoryId the category ID 380 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 381 * @return the last matching shopping item, or <code>null</code> if a matching shopping item could not be found 382 */ 383 public static ShoppingItem fetchByG_C_Last(long groupId, long categoryId, 384 OrderByComparator<ShoppingItem> orderByComparator) { 385 return getPersistence() 386 .fetchByG_C_Last(groupId, categoryId, orderByComparator); 387 } 388 389 /** 390 * Returns the shopping items before and after the current shopping item in the ordered set where groupId = ? and categoryId = ?. 391 * 392 * @param itemId the primary key of the current shopping item 393 * @param groupId the group ID 394 * @param categoryId the category ID 395 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 396 * @return the previous, current, and next shopping item 397 * @throws NoSuchItemException if a shopping item with the primary key could not be found 398 */ 399 public static ShoppingItem[] findByG_C_PrevAndNext(long itemId, 400 long groupId, long categoryId, 401 OrderByComparator<ShoppingItem> orderByComparator) 402 throws com.liferay.portlet.shopping.NoSuchItemException { 403 return getPersistence() 404 .findByG_C_PrevAndNext(itemId, groupId, categoryId, 405 orderByComparator); 406 } 407 408 /** 409 * Returns all the shopping items that the user has permission to view where groupId = ? and categoryId = ?. 410 * 411 * @param groupId the group ID 412 * @param categoryId the category ID 413 * @return the matching shopping items that the user has permission to view 414 */ 415 public static List<ShoppingItem> filterFindByG_C(long groupId, 416 long categoryId) { 417 return getPersistence().filterFindByG_C(groupId, categoryId); 418 } 419 420 /** 421 * Returns a range of all the shopping items that the user has permission to view where groupId = ? and categoryId = ?. 422 * 423 * <p> 424 * 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 ShoppingItemModelImpl}. 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. 425 * </p> 426 * 427 * @param groupId the group ID 428 * @param categoryId the category ID 429 * @param start the lower bound of the range of shopping items 430 * @param end the upper bound of the range of shopping items (not inclusive) 431 * @return the range of matching shopping items that the user has permission to view 432 */ 433 public static List<ShoppingItem> filterFindByG_C(long groupId, 434 long categoryId, int start, int end) { 435 return getPersistence().filterFindByG_C(groupId, categoryId, start, end); 436 } 437 438 /** 439 * Returns an ordered range of all the shopping items that the user has permissions to view where groupId = ? and categoryId = ?. 440 * 441 * <p> 442 * 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 ShoppingItemModelImpl}. 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. 443 * </p> 444 * 445 * @param groupId the group ID 446 * @param categoryId the category ID 447 * @param start the lower bound of the range of shopping items 448 * @param end the upper bound of the range of shopping items (not inclusive) 449 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 450 * @return the ordered range of matching shopping items that the user has permission to view 451 */ 452 public static List<ShoppingItem> filterFindByG_C(long groupId, 453 long categoryId, int start, int end, 454 OrderByComparator<ShoppingItem> orderByComparator) { 455 return getPersistence() 456 .filterFindByG_C(groupId, categoryId, start, end, 457 orderByComparator); 458 } 459 460 /** 461 * Returns the shopping items before and after the current shopping item in the ordered set of shopping items that the user has permission to view where groupId = ? and categoryId = ?. 462 * 463 * @param itemId the primary key of the current shopping item 464 * @param groupId the group ID 465 * @param categoryId the category ID 466 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 467 * @return the previous, current, and next shopping item 468 * @throws NoSuchItemException if a shopping item with the primary key could not be found 469 */ 470 public static ShoppingItem[] filterFindByG_C_PrevAndNext(long itemId, 471 long groupId, long categoryId, 472 OrderByComparator<ShoppingItem> orderByComparator) 473 throws com.liferay.portlet.shopping.NoSuchItemException { 474 return getPersistence() 475 .filterFindByG_C_PrevAndNext(itemId, groupId, categoryId, 476 orderByComparator); 477 } 478 479 /** 480 * Removes all the shopping items where groupId = ? and categoryId = ? from the database. 481 * 482 * @param groupId the group ID 483 * @param categoryId the category ID 484 */ 485 public static void removeByG_C(long groupId, long categoryId) { 486 getPersistence().removeByG_C(groupId, categoryId); 487 } 488 489 /** 490 * Returns the number of shopping items where groupId = ? and categoryId = ?. 491 * 492 * @param groupId the group ID 493 * @param categoryId the category ID 494 * @return the number of matching shopping items 495 */ 496 public static int countByG_C(long groupId, long categoryId) { 497 return getPersistence().countByG_C(groupId, categoryId); 498 } 499 500 /** 501 * Returns the number of shopping items that the user has permission to view where groupId = ? and categoryId = ?. 502 * 503 * @param groupId the group ID 504 * @param categoryId the category ID 505 * @return the number of matching shopping items that the user has permission to view 506 */ 507 public static int filterCountByG_C(long groupId, long categoryId) { 508 return getPersistence().filterCountByG_C(groupId, categoryId); 509 } 510 511 /** 512 * Returns the shopping item where companyId = ? and sku = ? or throws a {@link NoSuchItemException} if it could not be found. 513 * 514 * @param companyId the company ID 515 * @param sku the sku 516 * @return the matching shopping item 517 * @throws NoSuchItemException if a matching shopping item could not be found 518 */ 519 public static ShoppingItem findByC_S(long companyId, java.lang.String sku) 520 throws com.liferay.portlet.shopping.NoSuchItemException { 521 return getPersistence().findByC_S(companyId, sku); 522 } 523 524 /** 525 * Returns the shopping item where companyId = ? and sku = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 526 * 527 * @param companyId the company ID 528 * @param sku the sku 529 * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found 530 */ 531 public static ShoppingItem fetchByC_S(long companyId, java.lang.String sku) { 532 return getPersistence().fetchByC_S(companyId, sku); 533 } 534 535 /** 536 * Returns the shopping item where companyId = ? and sku = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 537 * 538 * @param companyId the company ID 539 * @param sku the sku 540 * @param retrieveFromCache whether to use the finder cache 541 * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found 542 */ 543 public static ShoppingItem fetchByC_S(long companyId, java.lang.String sku, 544 boolean retrieveFromCache) { 545 return getPersistence().fetchByC_S(companyId, sku, retrieveFromCache); 546 } 547 548 /** 549 * Removes the shopping item where companyId = ? and sku = ? from the database. 550 * 551 * @param companyId the company ID 552 * @param sku the sku 553 * @return the shopping item that was removed 554 */ 555 public static ShoppingItem removeByC_S(long companyId, java.lang.String sku) 556 throws com.liferay.portlet.shopping.NoSuchItemException { 557 return getPersistence().removeByC_S(companyId, sku); 558 } 559 560 /** 561 * Returns the number of shopping items where companyId = ? and sku = ?. 562 * 563 * @param companyId the company ID 564 * @param sku the sku 565 * @return the number of matching shopping items 566 */ 567 public static int countByC_S(long companyId, java.lang.String sku) { 568 return getPersistence().countByC_S(companyId, sku); 569 } 570 571 /** 572 * Caches the shopping item in the entity cache if it is enabled. 573 * 574 * @param shoppingItem the shopping item 575 */ 576 public static void cacheResult(ShoppingItem shoppingItem) { 577 getPersistence().cacheResult(shoppingItem); 578 } 579 580 /** 581 * Caches the shopping items in the entity cache if it is enabled. 582 * 583 * @param shoppingItems the shopping items 584 */ 585 public static void cacheResult(List<ShoppingItem> shoppingItems) { 586 getPersistence().cacheResult(shoppingItems); 587 } 588 589 /** 590 * Creates a new shopping item with the primary key. Does not add the shopping item to the database. 591 * 592 * @param itemId the primary key for the new shopping item 593 * @return the new shopping item 594 */ 595 public static ShoppingItem create(long itemId) { 596 return getPersistence().create(itemId); 597 } 598 599 /** 600 * Removes the shopping item with the primary key from the database. Also notifies the appropriate model listeners. 601 * 602 * @param itemId the primary key of the shopping item 603 * @return the shopping item that was removed 604 * @throws NoSuchItemException if a shopping item with the primary key could not be found 605 */ 606 public static ShoppingItem remove(long itemId) 607 throws com.liferay.portlet.shopping.NoSuchItemException { 608 return getPersistence().remove(itemId); 609 } 610 611 public static ShoppingItem updateImpl(ShoppingItem shoppingItem) { 612 return getPersistence().updateImpl(shoppingItem); 613 } 614 615 /** 616 * Returns the shopping item with the primary key or throws a {@link NoSuchItemException} if it could not be found. 617 * 618 * @param itemId the primary key of the shopping item 619 * @return the shopping item 620 * @throws NoSuchItemException if a shopping item with the primary key could not be found 621 */ 622 public static ShoppingItem findByPrimaryKey(long itemId) 623 throws com.liferay.portlet.shopping.NoSuchItemException { 624 return getPersistence().findByPrimaryKey(itemId); 625 } 626 627 /** 628 * Returns the shopping item with the primary key or returns <code>null</code> if it could not be found. 629 * 630 * @param itemId the primary key of the shopping item 631 * @return the shopping item, or <code>null</code> if a shopping item with the primary key could not be found 632 */ 633 public static ShoppingItem fetchByPrimaryKey(long itemId) { 634 return getPersistence().fetchByPrimaryKey(itemId); 635 } 636 637 public static java.util.Map<java.io.Serializable, ShoppingItem> fetchByPrimaryKeys( 638 java.util.Set<java.io.Serializable> primaryKeys) { 639 return getPersistence().fetchByPrimaryKeys(primaryKeys); 640 } 641 642 /** 643 * Returns all the shopping items. 644 * 645 * @return the shopping items 646 */ 647 public static List<ShoppingItem> findAll() { 648 return getPersistence().findAll(); 649 } 650 651 /** 652 * Returns a range of all the shopping items. 653 * 654 * <p> 655 * 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 ShoppingItemModelImpl}. 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. 656 * </p> 657 * 658 * @param start the lower bound of the range of shopping items 659 * @param end the upper bound of the range of shopping items (not inclusive) 660 * @return the range of shopping items 661 */ 662 public static List<ShoppingItem> findAll(int start, int end) { 663 return getPersistence().findAll(start, end); 664 } 665 666 /** 667 * Returns an ordered range of all the shopping items. 668 * 669 * <p> 670 * 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 ShoppingItemModelImpl}. 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. 671 * </p> 672 * 673 * @param start the lower bound of the range of shopping items 674 * @param end the upper bound of the range of shopping items (not inclusive) 675 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 676 * @return the ordered range of shopping items 677 */ 678 public static List<ShoppingItem> findAll(int start, int end, 679 OrderByComparator<ShoppingItem> orderByComparator) { 680 return getPersistence().findAll(start, end, orderByComparator); 681 } 682 683 /** 684 * Removes all the shopping items from the database. 685 */ 686 public static void removeAll() { 687 getPersistence().removeAll(); 688 } 689 690 /** 691 * Returns the number of shopping items. 692 * 693 * @return the number of shopping items 694 */ 695 public static int countAll() { 696 return getPersistence().countAll(); 697 } 698 699 public static ShoppingItemPersistence getPersistence() { 700 if (_persistence == null) { 701 _persistence = (ShoppingItemPersistence)PortalBeanLocatorUtil.locate(ShoppingItemPersistence.class.getName()); 702 703 ReferenceRegistry.registerReference(ShoppingItemUtil.class, 704 "_persistence"); 705 } 706 707 return _persistence; 708 } 709 710 /** 711 * @deprecated As of 6.2.0 712 */ 713 @Deprecated 714 public void setPersistence(ShoppingItemPersistence persistence) { 715 } 716 717 private static ShoppingItemPersistence _persistence; 718 }