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.ShoppingOrderItem; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the shopping order item service. This utility wraps {@link com.liferay.portlet.shopping.service.persistence.impl.ShoppingOrderItemPersistenceImpl} 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 ShoppingOrderItemPersistence 038 * @see com.liferay.portlet.shopping.service.persistence.impl.ShoppingOrderItemPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class ShoppingOrderItemUtil { 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(ShoppingOrderItem shoppingOrderItem) { 060 getPersistence().clearCache(shoppingOrderItem); 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<ShoppingOrderItem> 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<ShoppingOrderItem> 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<ShoppingOrderItem> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator<ShoppingOrderItem> 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 ShoppingOrderItem update(ShoppingOrderItem shoppingOrderItem) { 101 return getPersistence().update(shoppingOrderItem); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 106 */ 107 public static ShoppingOrderItem update( 108 ShoppingOrderItem shoppingOrderItem, ServiceContext serviceContext) { 109 return getPersistence().update(shoppingOrderItem, serviceContext); 110 } 111 112 /** 113 * Returns all the shopping order items where orderId = ?. 114 * 115 * @param orderId the order ID 116 * @return the matching shopping order items 117 */ 118 public static List<ShoppingOrderItem> findByOrderId(long orderId) { 119 return getPersistence().findByOrderId(orderId); 120 } 121 122 /** 123 * Returns a range of all the shopping order items where orderId = ?. 124 * 125 * <p> 126 * 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 ShoppingOrderItemModelImpl}. 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. 127 * </p> 128 * 129 * @param orderId the order ID 130 * @param start the lower bound of the range of shopping order items 131 * @param end the upper bound of the range of shopping order items (not inclusive) 132 * @return the range of matching shopping order items 133 */ 134 public static List<ShoppingOrderItem> findByOrderId(long orderId, 135 int start, int end) { 136 return getPersistence().findByOrderId(orderId, start, end); 137 } 138 139 /** 140 * Returns an ordered range of all the shopping order items where orderId = ?. 141 * 142 * <p> 143 * 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 ShoppingOrderItemModelImpl}. 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. 144 * </p> 145 * 146 * @param orderId the order ID 147 * @param start the lower bound of the range of shopping order items 148 * @param end the upper bound of the range of shopping order items (not inclusive) 149 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 150 * @return the ordered range of matching shopping order items 151 */ 152 public static List<ShoppingOrderItem> findByOrderId(long orderId, 153 int start, int end, 154 OrderByComparator<ShoppingOrderItem> orderByComparator) { 155 return getPersistence() 156 .findByOrderId(orderId, start, end, orderByComparator); 157 } 158 159 /** 160 * Returns the first shopping order item in the ordered set where orderId = ?. 161 * 162 * @param orderId the order ID 163 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 164 * @return the first matching shopping order item 165 * @throws NoSuchOrderItemException if a matching shopping order item could not be found 166 */ 167 public static ShoppingOrderItem findByOrderId_First(long orderId, 168 OrderByComparator<ShoppingOrderItem> orderByComparator) 169 throws com.liferay.portlet.shopping.NoSuchOrderItemException { 170 return getPersistence().findByOrderId_First(orderId, orderByComparator); 171 } 172 173 /** 174 * Returns the first shopping order item in the ordered set where orderId = ?. 175 * 176 * @param orderId the order ID 177 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 178 * @return the first matching shopping order item, or <code>null</code> if a matching shopping order item could not be found 179 */ 180 public static ShoppingOrderItem fetchByOrderId_First(long orderId, 181 OrderByComparator<ShoppingOrderItem> orderByComparator) { 182 return getPersistence().fetchByOrderId_First(orderId, orderByComparator); 183 } 184 185 /** 186 * Returns the last shopping order item in the ordered set where orderId = ?. 187 * 188 * @param orderId the order ID 189 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 190 * @return the last matching shopping order item 191 * @throws NoSuchOrderItemException if a matching shopping order item could not be found 192 */ 193 public static ShoppingOrderItem findByOrderId_Last(long orderId, 194 OrderByComparator<ShoppingOrderItem> orderByComparator) 195 throws com.liferay.portlet.shopping.NoSuchOrderItemException { 196 return getPersistence().findByOrderId_Last(orderId, orderByComparator); 197 } 198 199 /** 200 * Returns the last shopping order item in the ordered set where orderId = ?. 201 * 202 * @param orderId the order ID 203 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 204 * @return the last matching shopping order item, or <code>null</code> if a matching shopping order item could not be found 205 */ 206 public static ShoppingOrderItem fetchByOrderId_Last(long orderId, 207 OrderByComparator<ShoppingOrderItem> orderByComparator) { 208 return getPersistence().fetchByOrderId_Last(orderId, orderByComparator); 209 } 210 211 /** 212 * Returns the shopping order items before and after the current shopping order item in the ordered set where orderId = ?. 213 * 214 * @param orderItemId the primary key of the current shopping order item 215 * @param orderId the order ID 216 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 217 * @return the previous, current, and next shopping order item 218 * @throws NoSuchOrderItemException if a shopping order item with the primary key could not be found 219 */ 220 public static ShoppingOrderItem[] findByOrderId_PrevAndNext( 221 long orderItemId, long orderId, 222 OrderByComparator<ShoppingOrderItem> orderByComparator) 223 throws com.liferay.portlet.shopping.NoSuchOrderItemException { 224 return getPersistence() 225 .findByOrderId_PrevAndNext(orderItemId, orderId, 226 orderByComparator); 227 } 228 229 /** 230 * Removes all the shopping order items where orderId = ? from the database. 231 * 232 * @param orderId the order ID 233 */ 234 public static void removeByOrderId(long orderId) { 235 getPersistence().removeByOrderId(orderId); 236 } 237 238 /** 239 * Returns the number of shopping order items where orderId = ?. 240 * 241 * @param orderId the order ID 242 * @return the number of matching shopping order items 243 */ 244 public static int countByOrderId(long orderId) { 245 return getPersistence().countByOrderId(orderId); 246 } 247 248 /** 249 * Caches the shopping order item in the entity cache if it is enabled. 250 * 251 * @param shoppingOrderItem the shopping order item 252 */ 253 public static void cacheResult(ShoppingOrderItem shoppingOrderItem) { 254 getPersistence().cacheResult(shoppingOrderItem); 255 } 256 257 /** 258 * Caches the shopping order items in the entity cache if it is enabled. 259 * 260 * @param shoppingOrderItems the shopping order items 261 */ 262 public static void cacheResult(List<ShoppingOrderItem> shoppingOrderItems) { 263 getPersistence().cacheResult(shoppingOrderItems); 264 } 265 266 /** 267 * Creates a new shopping order item with the primary key. Does not add the shopping order item to the database. 268 * 269 * @param orderItemId the primary key for the new shopping order item 270 * @return the new shopping order item 271 */ 272 public static ShoppingOrderItem create(long orderItemId) { 273 return getPersistence().create(orderItemId); 274 } 275 276 /** 277 * Removes the shopping order item with the primary key from the database. Also notifies the appropriate model listeners. 278 * 279 * @param orderItemId the primary key of the shopping order item 280 * @return the shopping order item that was removed 281 * @throws NoSuchOrderItemException if a shopping order item with the primary key could not be found 282 */ 283 public static ShoppingOrderItem remove(long orderItemId) 284 throws com.liferay.portlet.shopping.NoSuchOrderItemException { 285 return getPersistence().remove(orderItemId); 286 } 287 288 public static ShoppingOrderItem updateImpl( 289 ShoppingOrderItem shoppingOrderItem) { 290 return getPersistence().updateImpl(shoppingOrderItem); 291 } 292 293 /** 294 * Returns the shopping order item with the primary key or throws a {@link NoSuchOrderItemException} if it could not be found. 295 * 296 * @param orderItemId the primary key of the shopping order item 297 * @return the shopping order item 298 * @throws NoSuchOrderItemException if a shopping order item with the primary key could not be found 299 */ 300 public static ShoppingOrderItem findByPrimaryKey(long orderItemId) 301 throws com.liferay.portlet.shopping.NoSuchOrderItemException { 302 return getPersistence().findByPrimaryKey(orderItemId); 303 } 304 305 /** 306 * Returns the shopping order item with the primary key or returns <code>null</code> if it could not be found. 307 * 308 * @param orderItemId the primary key of the shopping order item 309 * @return the shopping order item, or <code>null</code> if a shopping order item with the primary key could not be found 310 */ 311 public static ShoppingOrderItem fetchByPrimaryKey(long orderItemId) { 312 return getPersistence().fetchByPrimaryKey(orderItemId); 313 } 314 315 public static java.util.Map<java.io.Serializable, ShoppingOrderItem> fetchByPrimaryKeys( 316 java.util.Set<java.io.Serializable> primaryKeys) { 317 return getPersistence().fetchByPrimaryKeys(primaryKeys); 318 } 319 320 /** 321 * Returns all the shopping order items. 322 * 323 * @return the shopping order items 324 */ 325 public static List<ShoppingOrderItem> findAll() { 326 return getPersistence().findAll(); 327 } 328 329 /** 330 * Returns a range of all the shopping order items. 331 * 332 * <p> 333 * 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 ShoppingOrderItemModelImpl}. 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. 334 * </p> 335 * 336 * @param start the lower bound of the range of shopping order items 337 * @param end the upper bound of the range of shopping order items (not inclusive) 338 * @return the range of shopping order items 339 */ 340 public static List<ShoppingOrderItem> findAll(int start, int end) { 341 return getPersistence().findAll(start, end); 342 } 343 344 /** 345 * Returns an ordered range of all the shopping order items. 346 * 347 * <p> 348 * 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 ShoppingOrderItemModelImpl}. 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. 349 * </p> 350 * 351 * @param start the lower bound of the range of shopping order items 352 * @param end the upper bound of the range of shopping order items (not inclusive) 353 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 354 * @return the ordered range of shopping order items 355 */ 356 public static List<ShoppingOrderItem> findAll(int start, int end, 357 OrderByComparator<ShoppingOrderItem> orderByComparator) { 358 return getPersistence().findAll(start, end, orderByComparator); 359 } 360 361 /** 362 * Removes all the shopping order items from the database. 363 */ 364 public static void removeAll() { 365 getPersistence().removeAll(); 366 } 367 368 /** 369 * Returns the number of shopping order items. 370 * 371 * @return the number of shopping order items 372 */ 373 public static int countAll() { 374 return getPersistence().countAll(); 375 } 376 377 public static ShoppingOrderItemPersistence getPersistence() { 378 if (_persistence == null) { 379 _persistence = (ShoppingOrderItemPersistence)PortalBeanLocatorUtil.locate(ShoppingOrderItemPersistence.class.getName()); 380 381 ReferenceRegistry.registerReference(ShoppingOrderItemUtil.class, 382 "_persistence"); 383 } 384 385 return _persistence; 386 } 387 388 /** 389 * @deprecated As of 6.2.0 390 */ 391 @Deprecated 392 public void setPersistence(ShoppingOrderItemPersistence persistence) { 393 } 394 395 private static ShoppingOrderItemPersistence _persistence; 396 }