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