001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 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.ShoppingCoupon; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the shopping coupon service. This utility wraps {@link ShoppingCouponPersistenceImpl} 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 ShoppingCouponPersistence 037 * @see ShoppingCouponPersistenceImpl 038 * @generated 039 */ 040 public class ShoppingCouponUtil { 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(ShoppingCoupon shoppingCoupon) { 058 getPersistence().clearCache(shoppingCoupon); 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<ShoppingCoupon> 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<ShoppingCoupon> 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<ShoppingCoupon> 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 ShoppingCoupon remove(ShoppingCoupon shoppingCoupon) 101 throws SystemException { 102 return getPersistence().remove(shoppingCoupon); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 107 */ 108 public static ShoppingCoupon update(ShoppingCoupon shoppingCoupon, 109 boolean merge) throws SystemException { 110 return getPersistence().update(shoppingCoupon, merge); 111 } 112 113 /** 114 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 115 */ 116 public static ShoppingCoupon update(ShoppingCoupon shoppingCoupon, 117 boolean merge, ServiceContext serviceContext) throws SystemException { 118 return getPersistence().update(shoppingCoupon, merge, serviceContext); 119 } 120 121 /** 122 * Caches the shopping coupon in the entity cache if it is enabled. 123 * 124 * @param shoppingCoupon the shopping coupon to cache 125 */ 126 public static void cacheResult( 127 com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon) { 128 getPersistence().cacheResult(shoppingCoupon); 129 } 130 131 /** 132 * Caches the shopping coupons in the entity cache if it is enabled. 133 * 134 * @param shoppingCoupons the shopping coupons to cache 135 */ 136 public static void cacheResult( 137 java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> shoppingCoupons) { 138 getPersistence().cacheResult(shoppingCoupons); 139 } 140 141 /** 142 * Creates a new shopping coupon with the primary key. Does not add the shopping coupon to the database. 143 * 144 * @param couponId the primary key for the new shopping coupon 145 * @return the new shopping coupon 146 */ 147 public static com.liferay.portlet.shopping.model.ShoppingCoupon create( 148 long couponId) { 149 return getPersistence().create(couponId); 150 } 151 152 /** 153 * Removes the shopping coupon with the primary key from the database. Also notifies the appropriate model listeners. 154 * 155 * @param couponId the primary key of the shopping coupon to remove 156 * @return the shopping coupon that was removed 157 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a shopping coupon with the primary key could not be found 158 * @throws SystemException if a system exception occurred 159 */ 160 public static com.liferay.portlet.shopping.model.ShoppingCoupon remove( 161 long couponId) 162 throws com.liferay.portal.kernel.exception.SystemException, 163 com.liferay.portlet.shopping.NoSuchCouponException { 164 return getPersistence().remove(couponId); 165 } 166 167 public static com.liferay.portlet.shopping.model.ShoppingCoupon updateImpl( 168 com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon, 169 boolean merge) 170 throws com.liferay.portal.kernel.exception.SystemException { 171 return getPersistence().updateImpl(shoppingCoupon, merge); 172 } 173 174 /** 175 * Finds the shopping coupon with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCouponException} if it could not be found. 176 * 177 * @param couponId the primary key of the shopping coupon to find 178 * @return the shopping coupon 179 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a shopping coupon with the primary key could not be found 180 * @throws SystemException if a system exception occurred 181 */ 182 public static com.liferay.portlet.shopping.model.ShoppingCoupon findByPrimaryKey( 183 long couponId) 184 throws com.liferay.portal.kernel.exception.SystemException, 185 com.liferay.portlet.shopping.NoSuchCouponException { 186 return getPersistence().findByPrimaryKey(couponId); 187 } 188 189 /** 190 * Finds the shopping coupon with the primary key or returns <code>null</code> if it could not be found. 191 * 192 * @param couponId the primary key of the shopping coupon to find 193 * @return the shopping coupon, or <code>null</code> if a shopping coupon with the primary key could not be found 194 * @throws SystemException if a system exception occurred 195 */ 196 public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByPrimaryKey( 197 long couponId) 198 throws com.liferay.portal.kernel.exception.SystemException { 199 return getPersistence().fetchByPrimaryKey(couponId); 200 } 201 202 /** 203 * Finds all the shopping coupons where groupId = ?. 204 * 205 * @param groupId the group ID to search with 206 * @return the matching shopping coupons 207 * @throws SystemException if a system exception occurred 208 */ 209 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId( 210 long groupId) 211 throws com.liferay.portal.kernel.exception.SystemException { 212 return getPersistence().findByGroupId(groupId); 213 } 214 215 /** 216 * Finds a range of all the shopping coupons where groupId = ?. 217 * 218 * <p> 219 * 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. 220 * </p> 221 * 222 * @param groupId the group ID to search with 223 * @param start the lower bound of the range of shopping coupons to return 224 * @param end the upper bound of the range of shopping coupons to return (not inclusive) 225 * @return the range of matching shopping coupons 226 * @throws SystemException if a system exception occurred 227 */ 228 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId( 229 long groupId, int start, int end) 230 throws com.liferay.portal.kernel.exception.SystemException { 231 return getPersistence().findByGroupId(groupId, start, end); 232 } 233 234 /** 235 * Finds an ordered range of all the shopping coupons where groupId = ?. 236 * 237 * <p> 238 * 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. 239 * </p> 240 * 241 * @param groupId the group ID to search with 242 * @param start the lower bound of the range of shopping coupons to return 243 * @param end the upper bound of the range of shopping coupons to return (not inclusive) 244 * @param orderByComparator the comparator to order the results by 245 * @return the ordered range of matching shopping coupons 246 * @throws SystemException if a system exception occurred 247 */ 248 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId( 249 long groupId, int start, int end, 250 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 251 throws com.liferay.portal.kernel.exception.SystemException { 252 return getPersistence() 253 .findByGroupId(groupId, start, end, orderByComparator); 254 } 255 256 /** 257 * Finds the first shopping coupon in the ordered set where groupId = ?. 258 * 259 * <p> 260 * 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. 261 * </p> 262 * 263 * @param groupId the group ID to search with 264 * @param orderByComparator the comparator to order the set by 265 * @return the first matching shopping coupon 266 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a matching shopping coupon could not be found 267 * @throws SystemException if a system exception occurred 268 */ 269 public static com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_First( 270 long groupId, 271 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 272 throws com.liferay.portal.kernel.exception.SystemException, 273 com.liferay.portlet.shopping.NoSuchCouponException { 274 return getPersistence().findByGroupId_First(groupId, orderByComparator); 275 } 276 277 /** 278 * Finds the last shopping coupon in the ordered set where groupId = ?. 279 * 280 * <p> 281 * 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. 282 * </p> 283 * 284 * @param groupId the group ID to search with 285 * @param orderByComparator the comparator to order the set by 286 * @return the last matching shopping coupon 287 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a matching shopping coupon could not be found 288 * @throws SystemException if a system exception occurred 289 */ 290 public static com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_Last( 291 long groupId, 292 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 293 throws com.liferay.portal.kernel.exception.SystemException, 294 com.liferay.portlet.shopping.NoSuchCouponException { 295 return getPersistence().findByGroupId_Last(groupId, orderByComparator); 296 } 297 298 /** 299 * Finds the shopping coupons before and after the current shopping coupon in the ordered set where groupId = ?. 300 * 301 * <p> 302 * 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. 303 * </p> 304 * 305 * @param couponId the primary key of the current shopping coupon 306 * @param groupId the group ID to search with 307 * @param orderByComparator the comparator to order the set by 308 * @return the previous, current, and next shopping coupon 309 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a shopping coupon with the primary key could not be found 310 * @throws SystemException if a system exception occurred 311 */ 312 public static com.liferay.portlet.shopping.model.ShoppingCoupon[] findByGroupId_PrevAndNext( 313 long couponId, long groupId, 314 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 315 throws com.liferay.portal.kernel.exception.SystemException, 316 com.liferay.portlet.shopping.NoSuchCouponException { 317 return getPersistence() 318 .findByGroupId_PrevAndNext(couponId, groupId, 319 orderByComparator); 320 } 321 322 /** 323 * Finds the shopping coupon where code = ? or throws a {@link com.liferay.portlet.shopping.NoSuchCouponException} if it could not be found. 324 * 325 * @param code the code to search with 326 * @return the matching shopping coupon 327 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a matching shopping coupon could not be found 328 * @throws SystemException if a system exception occurred 329 */ 330 public static com.liferay.portlet.shopping.model.ShoppingCoupon findByCode( 331 java.lang.String code) 332 throws com.liferay.portal.kernel.exception.SystemException, 333 com.liferay.portlet.shopping.NoSuchCouponException { 334 return getPersistence().findByCode(code); 335 } 336 337 /** 338 * Finds the shopping coupon where code = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 339 * 340 * @param code the code to search with 341 * @return the matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found 342 * @throws SystemException if a system exception occurred 343 */ 344 public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode( 345 java.lang.String code) 346 throws com.liferay.portal.kernel.exception.SystemException { 347 return getPersistence().fetchByCode(code); 348 } 349 350 /** 351 * Finds the shopping coupon where code = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 352 * 353 * @param code the code to search with 354 * @return the matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found 355 * @throws SystemException if a system exception occurred 356 */ 357 public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode( 358 java.lang.String code, boolean retrieveFromCache) 359 throws com.liferay.portal.kernel.exception.SystemException { 360 return getPersistence().fetchByCode(code, retrieveFromCache); 361 } 362 363 /** 364 * Finds all the shopping coupons. 365 * 366 * @return the shopping coupons 367 * @throws SystemException if a system exception occurred 368 */ 369 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll() 370 throws com.liferay.portal.kernel.exception.SystemException { 371 return getPersistence().findAll(); 372 } 373 374 /** 375 * Finds a range of all the shopping coupons. 376 * 377 * <p> 378 * 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. 379 * </p> 380 * 381 * @param start the lower bound of the range of shopping coupons to return 382 * @param end the upper bound of the range of shopping coupons to return (not inclusive) 383 * @return the range of shopping coupons 384 * @throws SystemException if a system exception occurred 385 */ 386 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll( 387 int start, int end) 388 throws com.liferay.portal.kernel.exception.SystemException { 389 return getPersistence().findAll(start, end); 390 } 391 392 /** 393 * Finds an ordered range of all the shopping coupons. 394 * 395 * <p> 396 * 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. 397 * </p> 398 * 399 * @param start the lower bound of the range of shopping coupons to return 400 * @param end the upper bound of the range of shopping coupons to return (not inclusive) 401 * @param orderByComparator the comparator to order the results by 402 * @return the ordered range of shopping coupons 403 * @throws SystemException if a system exception occurred 404 */ 405 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll( 406 int start, int end, 407 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 408 throws com.liferay.portal.kernel.exception.SystemException { 409 return getPersistence().findAll(start, end, orderByComparator); 410 } 411 412 /** 413 * Removes all the shopping coupons where groupId = ? from the database. 414 * 415 * @param groupId the group ID to search with 416 * @throws SystemException if a system exception occurred 417 */ 418 public static void removeByGroupId(long groupId) 419 throws com.liferay.portal.kernel.exception.SystemException { 420 getPersistence().removeByGroupId(groupId); 421 } 422 423 /** 424 * Removes the shopping coupon where code = ? from the database. 425 * 426 * @param code the code to search with 427 * @throws SystemException if a system exception occurred 428 */ 429 public static void removeByCode(java.lang.String code) 430 throws com.liferay.portal.kernel.exception.SystemException, 431 com.liferay.portlet.shopping.NoSuchCouponException { 432 getPersistence().removeByCode(code); 433 } 434 435 /** 436 * Removes all the shopping coupons from the database. 437 * 438 * @throws SystemException if a system exception occurred 439 */ 440 public static void removeAll() 441 throws com.liferay.portal.kernel.exception.SystemException { 442 getPersistence().removeAll(); 443 } 444 445 /** 446 * Counts all the shopping coupons where groupId = ?. 447 * 448 * @param groupId the group ID to search with 449 * @return the number of matching shopping coupons 450 * @throws SystemException if a system exception occurred 451 */ 452 public static int countByGroupId(long groupId) 453 throws com.liferay.portal.kernel.exception.SystemException { 454 return getPersistence().countByGroupId(groupId); 455 } 456 457 /** 458 * Counts all the shopping coupons where code = ?. 459 * 460 * @param code the code to search with 461 * @return the number of matching shopping coupons 462 * @throws SystemException if a system exception occurred 463 */ 464 public static int countByCode(java.lang.String code) 465 throws com.liferay.portal.kernel.exception.SystemException { 466 return getPersistence().countByCode(code); 467 } 468 469 /** 470 * Counts all the shopping coupons. 471 * 472 * @return the number of shopping coupons 473 * @throws SystemException if a system exception occurred 474 */ 475 public static int countAll() 476 throws com.liferay.portal.kernel.exception.SystemException { 477 return getPersistence().countAll(); 478 } 479 480 public static ShoppingCouponPersistence getPersistence() { 481 if (_persistence == null) { 482 _persistence = (ShoppingCouponPersistence)PortalBeanLocatorUtil.locate(ShoppingCouponPersistence.class.getName()); 483 484 ReferenceRegistry.registerReference(ShoppingCouponUtil.class, 485 "_persistence"); 486 } 487 488 return _persistence; 489 } 490 491 public void setPersistence(ShoppingCouponPersistence persistence) { 492 _persistence = persistence; 493 494 ReferenceRegistry.registerReference(ShoppingCouponUtil.class, 495 "_persistence"); 496 } 497 498 private static ShoppingCouponPersistence _persistence; 499 }