001 /** 002 * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.service.persistence.BasePersistence; 020 021 import com.liferay.portlet.shopping.model.ShoppingCoupon; 022 023 /** 024 * The persistence interface for the shopping coupon service. 025 * 026 * <p> 027 * Caching information and settings can be found in <code>portal.properties</code> 028 * </p> 029 * 030 * @author Brian Wing Shun Chan 031 * @see com.liferay.portlet.shopping.service.persistence.impl.ShoppingCouponPersistenceImpl 032 * @see ShoppingCouponUtil 033 * @generated 034 */ 035 @ProviderType 036 public interface ShoppingCouponPersistence extends BasePersistence<ShoppingCoupon> { 037 /* 038 * NOTE FOR DEVELOPERS: 039 * 040 * 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. 041 */ 042 043 /** 044 * Returns all the shopping coupons where groupId = ?. 045 * 046 * @param groupId the group ID 047 * @return the matching shopping coupons 048 */ 049 public java.util.List<ShoppingCoupon> findByGroupId(long groupId); 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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 */ 063 public java.util.List<ShoppingCoupon> findByGroupId(long groupId, 064 int start, int end); 065 066 /** 067 * Returns an ordered range of all the shopping coupons where groupId = ?. 068 * 069 * <p> 070 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 071 * </p> 072 * 073 * @param groupId the group ID 074 * @param start the lower bound of the range of shopping coupons 075 * @param end the upper bound of the range of shopping coupons (not inclusive) 076 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 077 * @return the ordered range of matching shopping coupons 078 */ 079 public java.util.List<ShoppingCoupon> findByGroupId(long groupId, 080 int start, int end, 081 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCoupon> orderByComparator); 082 083 /** 084 * Returns the first shopping coupon in the ordered set where groupId = ?. 085 * 086 * @param groupId the group ID 087 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 088 * @return the first matching shopping coupon 089 * @throws NoSuchCouponException if a matching shopping coupon could not be found 090 */ 091 public ShoppingCoupon findByGroupId_First(long groupId, 092 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCoupon> orderByComparator) 093 throws com.liferay.portlet.shopping.NoSuchCouponException; 094 095 /** 096 * Returns the first shopping coupon in the ordered set where groupId = ?. 097 * 098 * @param groupId the group ID 099 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 100 * @return the first matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found 101 */ 102 public ShoppingCoupon fetchByGroupId_First(long groupId, 103 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCoupon> orderByComparator); 104 105 /** 106 * Returns the last shopping coupon in the ordered set where groupId = ?. 107 * 108 * @param groupId the group ID 109 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 110 * @return the last matching shopping coupon 111 * @throws NoSuchCouponException if a matching shopping coupon could not be found 112 */ 113 public ShoppingCoupon findByGroupId_Last(long groupId, 114 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCoupon> orderByComparator) 115 throws com.liferay.portlet.shopping.NoSuchCouponException; 116 117 /** 118 * Returns the last shopping coupon in the ordered set where groupId = ?. 119 * 120 * @param groupId the group ID 121 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 122 * @return the last matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found 123 */ 124 public ShoppingCoupon fetchByGroupId_Last(long groupId, 125 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCoupon> orderByComparator); 126 127 /** 128 * Returns the shopping coupons before and after the current shopping coupon in the ordered set where groupId = ?. 129 * 130 * @param couponId the primary key of the current shopping coupon 131 * @param groupId the group ID 132 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 133 * @return the previous, current, and next shopping coupon 134 * @throws NoSuchCouponException if a shopping coupon with the primary key could not be found 135 */ 136 public ShoppingCoupon[] findByGroupId_PrevAndNext(long couponId, 137 long groupId, 138 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCoupon> orderByComparator) 139 throws com.liferay.portlet.shopping.NoSuchCouponException; 140 141 /** 142 * Removes all the shopping coupons where groupId = ? from the database. 143 * 144 * @param groupId the group ID 145 */ 146 public void removeByGroupId(long groupId); 147 148 /** 149 * Returns the number of shopping coupons where groupId = ?. 150 * 151 * @param groupId the group ID 152 * @return the number of matching shopping coupons 153 */ 154 public int countByGroupId(long groupId); 155 156 /** 157 * Returns the shopping coupon where code = ? or throws a {@link NoSuchCouponException} if it could not be found. 158 * 159 * @param code the code 160 * @return the matching shopping coupon 161 * @throws NoSuchCouponException if a matching shopping coupon could not be found 162 */ 163 public ShoppingCoupon findByCode(java.lang.String code) 164 throws com.liferay.portlet.shopping.NoSuchCouponException; 165 166 /** 167 * Returns the shopping coupon where code = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 168 * 169 * @param code the code 170 * @return the matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found 171 */ 172 public ShoppingCoupon fetchByCode(java.lang.String code); 173 174 /** 175 * Returns the shopping coupon where code = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 176 * 177 * @param code the code 178 * @param retrieveFromCache whether to use the finder cache 179 * @return the matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found 180 */ 181 public ShoppingCoupon fetchByCode(java.lang.String code, 182 boolean retrieveFromCache); 183 184 /** 185 * Removes the shopping coupon where code = ? from the database. 186 * 187 * @param code the code 188 * @return the shopping coupon that was removed 189 */ 190 public ShoppingCoupon removeByCode(java.lang.String code) 191 throws com.liferay.portlet.shopping.NoSuchCouponException; 192 193 /** 194 * Returns the number of shopping coupons where code = ?. 195 * 196 * @param code the code 197 * @return the number of matching shopping coupons 198 */ 199 public int countByCode(java.lang.String code); 200 201 /** 202 * Caches the shopping coupon in the entity cache if it is enabled. 203 * 204 * @param shoppingCoupon the shopping coupon 205 */ 206 public void cacheResult(ShoppingCoupon shoppingCoupon); 207 208 /** 209 * Caches the shopping coupons in the entity cache if it is enabled. 210 * 211 * @param shoppingCoupons the shopping coupons 212 */ 213 public void cacheResult(java.util.List<ShoppingCoupon> shoppingCoupons); 214 215 /** 216 * Creates a new shopping coupon with the primary key. Does not add the shopping coupon to the database. 217 * 218 * @param couponId the primary key for the new shopping coupon 219 * @return the new shopping coupon 220 */ 221 public ShoppingCoupon create(long couponId); 222 223 /** 224 * Removes the shopping coupon with the primary key from the database. Also notifies the appropriate model listeners. 225 * 226 * @param couponId the primary key of the shopping coupon 227 * @return the shopping coupon that was removed 228 * @throws NoSuchCouponException if a shopping coupon with the primary key could not be found 229 */ 230 public ShoppingCoupon remove(long couponId) 231 throws com.liferay.portlet.shopping.NoSuchCouponException; 232 233 public ShoppingCoupon updateImpl(ShoppingCoupon shoppingCoupon); 234 235 /** 236 * Returns the shopping coupon with the primary key or throws a {@link NoSuchCouponException} if it could not be found. 237 * 238 * @param couponId the primary key of the shopping coupon 239 * @return the shopping coupon 240 * @throws NoSuchCouponException if a shopping coupon with the primary key could not be found 241 */ 242 public ShoppingCoupon findByPrimaryKey(long couponId) 243 throws com.liferay.portlet.shopping.NoSuchCouponException; 244 245 /** 246 * Returns the shopping coupon with the primary key or returns <code>null</code> if it could not be found. 247 * 248 * @param couponId the primary key of the shopping coupon 249 * @return the shopping coupon, or <code>null</code> if a shopping coupon with the primary key could not be found 250 */ 251 public ShoppingCoupon fetchByPrimaryKey(long couponId); 252 253 @Override 254 public java.util.Map<java.io.Serializable, ShoppingCoupon> fetchByPrimaryKeys( 255 java.util.Set<java.io.Serializable> primaryKeys); 256 257 /** 258 * Returns all the shopping coupons. 259 * 260 * @return the shopping coupons 261 */ 262 public java.util.List<ShoppingCoupon> findAll(); 263 264 /** 265 * Returns a range of all the shopping coupons. 266 * 267 * <p> 268 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 269 * </p> 270 * 271 * @param start the lower bound of the range of shopping coupons 272 * @param end the upper bound of the range of shopping coupons (not inclusive) 273 * @return the range of shopping coupons 274 */ 275 public java.util.List<ShoppingCoupon> findAll(int start, int end); 276 277 /** 278 * Returns an ordered range of all the shopping coupons. 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 282 * </p> 283 * 284 * @param start the lower bound of the range of shopping coupons 285 * @param end the upper bound of the range of shopping coupons (not inclusive) 286 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 287 * @return the ordered range of shopping coupons 288 */ 289 public java.util.List<ShoppingCoupon> findAll(int start, int end, 290 com.liferay.portal.kernel.util.OrderByComparator<ShoppingCoupon> orderByComparator); 291 292 /** 293 * Removes all the shopping coupons from the database. 294 */ 295 public void removeAll(); 296 297 /** 298 * Returns the number of shopping coupons. 299 * 300 * @return the number of shopping coupons 301 */ 302 public int countAll(); 303 }