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