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