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