001 /** 002 * Copyright (c) 2000-2012 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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.kernel.util.ReferenceRegistry; 022 import com.liferay.portal.service.ServiceContext; 023 024 import com.liferay.portlet.shopping.model.ShoppingOrderItem; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the shopping order item service. This utility wraps {@link 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. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see ShoppingOrderItemPersistence 037 * @see ShoppingOrderItemPersistenceImpl 038 * @generated 039 */ 040 public class ShoppingOrderItemUtil { 041 /* 042 * NOTE FOR DEVELOPERS: 043 * 044 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 045 */ 046 047 /** 048 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 049 */ 050 public static void clearCache() { 051 getPersistence().clearCache(); 052 } 053 054 /** 055 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 056 */ 057 public static void clearCache(ShoppingOrderItem shoppingOrderItem) { 058 getPersistence().clearCache(shoppingOrderItem); 059 } 060 061 /** 062 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 063 */ 064 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 065 throws SystemException { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<ShoppingOrderItem> findWithDynamicQuery( 073 DynamicQuery dynamicQuery) throws SystemException { 074 return getPersistence().findWithDynamicQuery(dynamicQuery); 075 } 076 077 /** 078 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 079 */ 080 public static List<ShoppingOrderItem> findWithDynamicQuery( 081 DynamicQuery dynamicQuery, int start, int end) 082 throws SystemException { 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 orderByComparator) throws SystemException { 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 throws SystemException { 102 return getPersistence().update(shoppingOrderItem); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 107 */ 108 public static ShoppingOrderItem update( 109 ShoppingOrderItem shoppingOrderItem, ServiceContext serviceContext) 110 throws SystemException { 111 return getPersistence().update(shoppingOrderItem, serviceContext); 112 } 113 114 /** 115 * Returns all the shopping order items where orderId = ?. 116 * 117 * @param orderId the order ID 118 * @return the matching shopping order items 119 * @throws SystemException if a system exception occurred 120 */ 121 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findByOrderId( 122 long orderId) 123 throws com.liferay.portal.kernel.exception.SystemException { 124 return getPersistence().findByOrderId(orderId); 125 } 126 127 /** 128 * Returns a range of all the shopping order items where orderId = ?. 129 * 130 * <p> 131 * 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.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. 132 * </p> 133 * 134 * @param orderId the order ID 135 * @param start the lower bound of the range of shopping order items 136 * @param end the upper bound of the range of shopping order items (not inclusive) 137 * @return the range of matching shopping order items 138 * @throws SystemException if a system exception occurred 139 */ 140 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findByOrderId( 141 long orderId, int start, int end) 142 throws com.liferay.portal.kernel.exception.SystemException { 143 return getPersistence().findByOrderId(orderId, start, end); 144 } 145 146 /** 147 * Returns an ordered range of all the shopping order items where orderId = ?. 148 * 149 * <p> 150 * 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.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. 151 * </p> 152 * 153 * @param orderId the order ID 154 * @param start the lower bound of the range of shopping order items 155 * @param end the upper bound of the range of shopping order items (not inclusive) 156 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 157 * @return the ordered range of matching shopping order items 158 * @throws SystemException if a system exception occurred 159 */ 160 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findByOrderId( 161 long orderId, int start, int end, 162 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 163 throws com.liferay.portal.kernel.exception.SystemException { 164 return getPersistence() 165 .findByOrderId(orderId, start, end, orderByComparator); 166 } 167 168 /** 169 * Returns the first shopping order item in the ordered set where orderId = ?. 170 * 171 * @param orderId the order ID 172 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 173 * @return the first matching shopping order item 174 * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a matching shopping order item could not be found 175 * @throws SystemException if a system exception occurred 176 */ 177 public static com.liferay.portlet.shopping.model.ShoppingOrderItem findByOrderId_First( 178 long orderId, 179 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 180 throws com.liferay.portal.kernel.exception.SystemException, 181 com.liferay.portlet.shopping.NoSuchOrderItemException { 182 return getPersistence().findByOrderId_First(orderId, orderByComparator); 183 } 184 185 /** 186 * Returns the first 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 first matching shopping order item, or <code>null</code> if a matching shopping order item could not be found 191 * @throws SystemException if a system exception occurred 192 */ 193 public static com.liferay.portlet.shopping.model.ShoppingOrderItem fetchByOrderId_First( 194 long orderId, 195 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 196 throws com.liferay.portal.kernel.exception.SystemException { 197 return getPersistence().fetchByOrderId_First(orderId, orderByComparator); 198 } 199 200 /** 201 * Returns the last shopping order item in the ordered set where orderId = ?. 202 * 203 * @param orderId the order ID 204 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 205 * @return the last matching shopping order item 206 * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a matching shopping order item could not be found 207 * @throws SystemException if a system exception occurred 208 */ 209 public static com.liferay.portlet.shopping.model.ShoppingOrderItem findByOrderId_Last( 210 long orderId, 211 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 212 throws com.liferay.portal.kernel.exception.SystemException, 213 com.liferay.portlet.shopping.NoSuchOrderItemException { 214 return getPersistence().findByOrderId_Last(orderId, orderByComparator); 215 } 216 217 /** 218 * Returns the last shopping order item in the ordered set where orderId = ?. 219 * 220 * @param orderId the order ID 221 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 222 * @return the last matching shopping order item, or <code>null</code> if a matching shopping order item could not be found 223 * @throws SystemException if a system exception occurred 224 */ 225 public static com.liferay.portlet.shopping.model.ShoppingOrderItem fetchByOrderId_Last( 226 long orderId, 227 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 228 throws com.liferay.portal.kernel.exception.SystemException { 229 return getPersistence().fetchByOrderId_Last(orderId, orderByComparator); 230 } 231 232 /** 233 * Returns the shopping order items before and after the current shopping order item in the ordered set where orderId = ?. 234 * 235 * @param orderItemId the primary key of the current shopping order item 236 * @param orderId the order ID 237 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 238 * @return the previous, current, and next shopping order item 239 * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a shopping order item with the primary key could not be found 240 * @throws SystemException if a system exception occurred 241 */ 242 public static com.liferay.portlet.shopping.model.ShoppingOrderItem[] findByOrderId_PrevAndNext( 243 long orderItemId, long orderId, 244 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 245 throws com.liferay.portal.kernel.exception.SystemException, 246 com.liferay.portlet.shopping.NoSuchOrderItemException { 247 return getPersistence() 248 .findByOrderId_PrevAndNext(orderItemId, orderId, 249 orderByComparator); 250 } 251 252 /** 253 * Removes all the shopping order items where orderId = ? from the database. 254 * 255 * @param orderId the order ID 256 * @throws SystemException if a system exception occurred 257 */ 258 public static void removeByOrderId(long orderId) 259 throws com.liferay.portal.kernel.exception.SystemException { 260 getPersistence().removeByOrderId(orderId); 261 } 262 263 /** 264 * Returns the number of shopping order items where orderId = ?. 265 * 266 * @param orderId the order ID 267 * @return the number of matching shopping order items 268 * @throws SystemException if a system exception occurred 269 */ 270 public static int countByOrderId(long orderId) 271 throws com.liferay.portal.kernel.exception.SystemException { 272 return getPersistence().countByOrderId(orderId); 273 } 274 275 /** 276 * Caches the shopping order item in the entity cache if it is enabled. 277 * 278 * @param shoppingOrderItem the shopping order item 279 */ 280 public static void cacheResult( 281 com.liferay.portlet.shopping.model.ShoppingOrderItem shoppingOrderItem) { 282 getPersistence().cacheResult(shoppingOrderItem); 283 } 284 285 /** 286 * Caches the shopping order items in the entity cache if it is enabled. 287 * 288 * @param shoppingOrderItems the shopping order items 289 */ 290 public static void cacheResult( 291 java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> shoppingOrderItems) { 292 getPersistence().cacheResult(shoppingOrderItems); 293 } 294 295 /** 296 * Creates a new shopping order item with the primary key. Does not add the shopping order item to the database. 297 * 298 * @param orderItemId the primary key for the new shopping order item 299 * @return the new shopping order item 300 */ 301 public static com.liferay.portlet.shopping.model.ShoppingOrderItem create( 302 long orderItemId) { 303 return getPersistence().create(orderItemId); 304 } 305 306 /** 307 * Removes the shopping order item with the primary key from the database. Also notifies the appropriate model listeners. 308 * 309 * @param orderItemId the primary key of the shopping order item 310 * @return the shopping order item that was removed 311 * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a shopping order item with the primary key could not be found 312 * @throws SystemException if a system exception occurred 313 */ 314 public static com.liferay.portlet.shopping.model.ShoppingOrderItem remove( 315 long orderItemId) 316 throws com.liferay.portal.kernel.exception.SystemException, 317 com.liferay.portlet.shopping.NoSuchOrderItemException { 318 return getPersistence().remove(orderItemId); 319 } 320 321 public static com.liferay.portlet.shopping.model.ShoppingOrderItem updateImpl( 322 com.liferay.portlet.shopping.model.ShoppingOrderItem shoppingOrderItem) 323 throws com.liferay.portal.kernel.exception.SystemException { 324 return getPersistence().updateImpl(shoppingOrderItem); 325 } 326 327 /** 328 * Returns the shopping order item with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchOrderItemException} if it could not be found. 329 * 330 * @param orderItemId the primary key of the shopping order item 331 * @return the shopping order item 332 * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a shopping order item with the primary key could not be found 333 * @throws SystemException if a system exception occurred 334 */ 335 public static com.liferay.portlet.shopping.model.ShoppingOrderItem findByPrimaryKey( 336 long orderItemId) 337 throws com.liferay.portal.kernel.exception.SystemException, 338 com.liferay.portlet.shopping.NoSuchOrderItemException { 339 return getPersistence().findByPrimaryKey(orderItemId); 340 } 341 342 /** 343 * Returns the shopping order item with the primary key or returns <code>null</code> if it could not be found. 344 * 345 * @param orderItemId the primary key of the shopping order item 346 * @return the shopping order item, or <code>null</code> if a shopping order item with the primary key could not be found 347 * @throws SystemException if a system exception occurred 348 */ 349 public static com.liferay.portlet.shopping.model.ShoppingOrderItem fetchByPrimaryKey( 350 long orderItemId) 351 throws com.liferay.portal.kernel.exception.SystemException { 352 return getPersistence().fetchByPrimaryKey(orderItemId); 353 } 354 355 /** 356 * Returns all the shopping order items. 357 * 358 * @return the shopping order items 359 * @throws SystemException if a system exception occurred 360 */ 361 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findAll() 362 throws com.liferay.portal.kernel.exception.SystemException { 363 return getPersistence().findAll(); 364 } 365 366 /** 367 * Returns a range of all the shopping order items. 368 * 369 * <p> 370 * 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.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. 371 * </p> 372 * 373 * @param start the lower bound of the range of shopping order items 374 * @param end the upper bound of the range of shopping order items (not inclusive) 375 * @return the range of shopping order items 376 * @throws SystemException if a system exception occurred 377 */ 378 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findAll( 379 int start, int end) 380 throws com.liferay.portal.kernel.exception.SystemException { 381 return getPersistence().findAll(start, end); 382 } 383 384 /** 385 * Returns an ordered range of all the shopping order items. 386 * 387 * <p> 388 * 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.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. 389 * </p> 390 * 391 * @param start the lower bound of the range of shopping order items 392 * @param end the upper bound of the range of shopping order items (not inclusive) 393 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 394 * @return the ordered range of shopping order items 395 * @throws SystemException if a system exception occurred 396 */ 397 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findAll( 398 int start, int end, 399 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 400 throws com.liferay.portal.kernel.exception.SystemException { 401 return getPersistence().findAll(start, end, orderByComparator); 402 } 403 404 /** 405 * Removes all the shopping order items from the database. 406 * 407 * @throws SystemException if a system exception occurred 408 */ 409 public static void removeAll() 410 throws com.liferay.portal.kernel.exception.SystemException { 411 getPersistence().removeAll(); 412 } 413 414 /** 415 * Returns the number of shopping order items. 416 * 417 * @return the number of shopping order items 418 * @throws SystemException if a system exception occurred 419 */ 420 public static int countAll() 421 throws com.liferay.portal.kernel.exception.SystemException { 422 return getPersistence().countAll(); 423 } 424 425 public static ShoppingOrderItemPersistence getPersistence() { 426 if (_persistence == null) { 427 _persistence = (ShoppingOrderItemPersistence)PortalBeanLocatorUtil.locate(ShoppingOrderItemPersistence.class.getName()); 428 429 ReferenceRegistry.registerReference(ShoppingOrderItemUtil.class, 430 "_persistence"); 431 } 432 433 return _persistence; 434 } 435 436 /** 437 * @deprecated 438 */ 439 public void setPersistence(ShoppingOrderItemPersistence persistence) { 440 } 441 442 private static ShoppingOrderItemPersistence _persistence; 443 }