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