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