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