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