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.service.persistence.BasePersistence; 018 019 import com.liferay.portlet.shopping.model.ShoppingCoupon; 020 021 /** 022 * The persistence interface for the shopping coupon service. 023 * 024 * <p> 025 * Never modify this interface directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this interface. 026 * </p> 027 * 028 * @author Brian Wing Shun Chan 029 * @see ShoppingCouponPersistenceImpl 030 * @see ShoppingCouponUtil 031 * @generated 032 */ 033 public interface ShoppingCouponPersistence extends BasePersistence<ShoppingCoupon> { 034 /** 035 * Caches the shopping coupon in the entity cache if it is enabled. 036 * 037 * @param shoppingCoupon the shopping coupon to cache 038 */ 039 public void cacheResult( 040 com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon); 041 042 /** 043 * Caches the shopping coupons in the entity cache if it is enabled. 044 * 045 * @param shoppingCoupons the shopping coupons to cache 046 */ 047 public void cacheResult( 048 java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> shoppingCoupons); 049 050 /** 051 * Creates a new shopping coupon with the primary key. 052 * 053 * @param couponId the primary key for the new shopping coupon 054 * @return the new shopping coupon 055 */ 056 public com.liferay.portlet.shopping.model.ShoppingCoupon create( 057 long couponId); 058 059 /** 060 * Removes the shopping coupon with the primary key from the database. Also notifies the appropriate model listeners. 061 * 062 * @param couponId the primary key of the shopping coupon to remove 063 * @return the shopping coupon that was removed 064 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a shopping coupon with the primary key could not be found 065 * @throws SystemException if a system exception occurred 066 */ 067 public com.liferay.portlet.shopping.model.ShoppingCoupon remove( 068 long couponId) 069 throws com.liferay.portal.kernel.exception.SystemException, 070 com.liferay.portlet.shopping.NoSuchCouponException; 071 072 public com.liferay.portlet.shopping.model.ShoppingCoupon updateImpl( 073 com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon, 074 boolean merge) 075 throws com.liferay.portal.kernel.exception.SystemException; 076 077 /** 078 * Finds the shopping coupon with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCouponException} if it could not be found. 079 * 080 * @param couponId the primary key of the shopping coupon to find 081 * @return the shopping coupon 082 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a shopping coupon with the primary key could not be found 083 * @throws SystemException if a system exception occurred 084 */ 085 public com.liferay.portlet.shopping.model.ShoppingCoupon findByPrimaryKey( 086 long couponId) 087 throws com.liferay.portal.kernel.exception.SystemException, 088 com.liferay.portlet.shopping.NoSuchCouponException; 089 090 /** 091 * Finds the shopping coupon with the primary key or returns <code>null</code> if it could not be found. 092 * 093 * @param couponId the primary key of the shopping coupon to find 094 * @return the shopping coupon, or <code>null</code> if a shopping coupon with the primary key could not be found 095 * @throws SystemException if a system exception occurred 096 */ 097 public com.liferay.portlet.shopping.model.ShoppingCoupon fetchByPrimaryKey( 098 long couponId) 099 throws com.liferay.portal.kernel.exception.SystemException; 100 101 /** 102 * Finds all the shopping coupons where groupId = ?. 103 * 104 * @param groupId the group id to search with 105 * @return the matching shopping coupons 106 * @throws SystemException if a system exception occurred 107 */ 108 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId( 109 long groupId) 110 throws com.liferay.portal.kernel.exception.SystemException; 111 112 /** 113 * Finds a range of all the shopping coupons where groupId = ?. 114 * 115 * <p> 116 * 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. 117 * </p> 118 * 119 * @param groupId the group id to search with 120 * @param start the lower bound of the range of shopping coupons to return 121 * @param end the upper bound of the range of shopping coupons to return (not inclusive) 122 * @return the range of matching shopping coupons 123 * @throws SystemException if a system exception occurred 124 */ 125 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId( 126 long groupId, int start, int end) 127 throws com.liferay.portal.kernel.exception.SystemException; 128 129 /** 130 * Finds an ordered range of all the shopping coupons where groupId = ?. 131 * 132 * <p> 133 * 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. 134 * </p> 135 * 136 * @param groupId the group id to search with 137 * @param start the lower bound of the range of shopping coupons to return 138 * @param end the upper bound of the range of shopping coupons to return (not inclusive) 139 * @param orderByComparator the comparator to order the results by 140 * @return the ordered range of matching shopping coupons 141 * @throws SystemException if a system exception occurred 142 */ 143 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId( 144 long groupId, int start, int end, 145 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 146 throws com.liferay.portal.kernel.exception.SystemException; 147 148 /** 149 * Finds the first shopping coupon in the ordered set where groupId = ?. 150 * 151 * <p> 152 * 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. 153 * </p> 154 * 155 * @param groupId the group id to search with 156 * @param orderByComparator the comparator to order the set by 157 * @return the first matching shopping coupon 158 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a matching shopping coupon could not be found 159 * @throws SystemException if a system exception occurred 160 */ 161 public com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_First( 162 long groupId, 163 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 164 throws com.liferay.portal.kernel.exception.SystemException, 165 com.liferay.portlet.shopping.NoSuchCouponException; 166 167 /** 168 * Finds the last shopping coupon in the ordered set where groupId = ?. 169 * 170 * <p> 171 * 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. 172 * </p> 173 * 174 * @param groupId the group id to search with 175 * @param orderByComparator the comparator to order the set by 176 * @return the last matching shopping coupon 177 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a matching shopping coupon could not be found 178 * @throws SystemException if a system exception occurred 179 */ 180 public com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_Last( 181 long groupId, 182 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 183 throws com.liferay.portal.kernel.exception.SystemException, 184 com.liferay.portlet.shopping.NoSuchCouponException; 185 186 /** 187 * Finds the shopping coupons before and after the current shopping coupon in the ordered set where groupId = ?. 188 * 189 * <p> 190 * 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. 191 * </p> 192 * 193 * @param couponId the primary key of the current shopping coupon 194 * @param groupId the group id to search with 195 * @param orderByComparator the comparator to order the set by 196 * @return the previous, current, and next shopping coupon 197 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a shopping coupon with the primary key could not be found 198 * @throws SystemException if a system exception occurred 199 */ 200 public com.liferay.portlet.shopping.model.ShoppingCoupon[] findByGroupId_PrevAndNext( 201 long couponId, long groupId, 202 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 203 throws com.liferay.portal.kernel.exception.SystemException, 204 com.liferay.portlet.shopping.NoSuchCouponException; 205 206 /** 207 * Finds the shopping coupon where code = ? or throws a {@link com.liferay.portlet.shopping.NoSuchCouponException} if it could not be found. 208 * 209 * @param code the code to search with 210 * @return the matching shopping coupon 211 * @throws com.liferay.portlet.shopping.NoSuchCouponException if a matching shopping coupon could not be found 212 * @throws SystemException if a system exception occurred 213 */ 214 public com.liferay.portlet.shopping.model.ShoppingCoupon findByCode( 215 java.lang.String code) 216 throws com.liferay.portal.kernel.exception.SystemException, 217 com.liferay.portlet.shopping.NoSuchCouponException; 218 219 /** 220 * Finds the shopping coupon where code = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 221 * 222 * @param code the code to search with 223 * @return the matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found 224 * @throws SystemException if a system exception occurred 225 */ 226 public com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode( 227 java.lang.String code) 228 throws com.liferay.portal.kernel.exception.SystemException; 229 230 /** 231 * Finds the shopping coupon where code = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 232 * 233 * @param code the code to search with 234 * @return the matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found 235 * @throws SystemException if a system exception occurred 236 */ 237 public com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode( 238 java.lang.String code, boolean retrieveFromCache) 239 throws com.liferay.portal.kernel.exception.SystemException; 240 241 /** 242 * Finds all the shopping coupons. 243 * 244 * @return the shopping coupons 245 * @throws SystemException if a system exception occurred 246 */ 247 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll() 248 throws com.liferay.portal.kernel.exception.SystemException; 249 250 /** 251 * Finds a range of all the shopping coupons. 252 * 253 * <p> 254 * 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. 255 * </p> 256 * 257 * @param start the lower bound of the range of shopping coupons to return 258 * @param end the upper bound of the range of shopping coupons to return (not inclusive) 259 * @return the range of shopping coupons 260 * @throws SystemException if a system exception occurred 261 */ 262 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll( 263 int start, int end) 264 throws com.liferay.portal.kernel.exception.SystemException; 265 266 /** 267 * Finds an ordered range of all the shopping coupons. 268 * 269 * <p> 270 * 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. 271 * </p> 272 * 273 * @param start the lower bound of the range of shopping coupons to return 274 * @param end the upper bound of the range of shopping coupons to return (not inclusive) 275 * @param orderByComparator the comparator to order the results by 276 * @return the ordered range of shopping coupons 277 * @throws SystemException if a system exception occurred 278 */ 279 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll( 280 int start, int end, 281 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 282 throws com.liferay.portal.kernel.exception.SystemException; 283 284 /** 285 * Removes all the shopping coupons where groupId = ? from the database. 286 * 287 * @param groupId the group id to search with 288 * @throws SystemException if a system exception occurred 289 */ 290 public void removeByGroupId(long groupId) 291 throws com.liferay.portal.kernel.exception.SystemException; 292 293 /** 294 * Removes the shopping coupon where code = ? from the database. 295 * 296 * @param code the code to search with 297 * @throws SystemException if a system exception occurred 298 */ 299 public void removeByCode(java.lang.String code) 300 throws com.liferay.portal.kernel.exception.SystemException, 301 com.liferay.portlet.shopping.NoSuchCouponException; 302 303 /** 304 * Removes all the shopping coupons from the database. 305 * 306 * @throws SystemException if a system exception occurred 307 */ 308 public void removeAll() 309 throws com.liferay.portal.kernel.exception.SystemException; 310 311 /** 312 * Counts all the shopping coupons where groupId = ?. 313 * 314 * @param groupId the group id to search with 315 * @return the number of matching shopping coupons 316 * @throws SystemException if a system exception occurred 317 */ 318 public int countByGroupId(long groupId) 319 throws com.liferay.portal.kernel.exception.SystemException; 320 321 /** 322 * Counts all the shopping coupons where code = ?. 323 * 324 * @param code the code to search with 325 * @return the number of matching shopping coupons 326 * @throws SystemException if a system exception occurred 327 */ 328 public int countByCode(java.lang.String code) 329 throws com.liferay.portal.kernel.exception.SystemException; 330 331 /** 332 * Counts all the shopping coupons. 333 * 334 * @return the number of shopping coupons 335 * @throws SystemException if a system exception occurred 336 */ 337 public int countAll() 338 throws com.liferay.portal.kernel.exception.SystemException; 339 }