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.announcements.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.service.persistence.BasePersistence; 020 021 import com.liferay.portlet.announcements.model.AnnouncementsDelivery; 022 023 /** 024 * The persistence interface for the announcements delivery 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.announcements.service.persistence.impl.AnnouncementsDeliveryPersistenceImpl 032 * @see AnnouncementsDeliveryUtil 033 * @generated 034 */ 035 @ProviderType 036 public interface AnnouncementsDeliveryPersistence extends BasePersistence<AnnouncementsDelivery> { 037 /* 038 * NOTE FOR DEVELOPERS: 039 * 040 * Never modify or reference this interface directly. Always use {@link AnnouncementsDeliveryUtil} to access the announcements delivery persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 041 */ 042 043 /** 044 * Returns all the announcements deliveries where userId = ?. 045 * 046 * @param userId the user ID 047 * @return the matching announcements deliveries 048 */ 049 public java.util.List<AnnouncementsDelivery> findByUserId(long userId); 050 051 /** 052 * Returns a range of all the announcements deliveries where userId = ?. 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 AnnouncementsDeliveryModelImpl}. 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 userId the user ID 059 * @param start the lower bound of the range of announcements deliveries 060 * @param end the upper bound of the range of announcements deliveries (not inclusive) 061 * @return the range of matching announcements deliveries 062 */ 063 public java.util.List<AnnouncementsDelivery> findByUserId(long userId, 064 int start, int end); 065 066 /** 067 * Returns an ordered range of all the announcements deliveries where userId = ?. 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 AnnouncementsDeliveryModelImpl}. 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 userId the user ID 074 * @param start the lower bound of the range of announcements deliveries 075 * @param end the upper bound of the range of announcements deliveries (not inclusive) 076 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 077 * @return the ordered range of matching announcements deliveries 078 */ 079 public java.util.List<AnnouncementsDelivery> findByUserId(long userId, 080 int start, int end, 081 com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsDelivery> orderByComparator); 082 083 /** 084 * Returns the first announcements delivery in the ordered set where userId = ?. 085 * 086 * @param userId the user ID 087 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 088 * @return the first matching announcements delivery 089 * @throws NoSuchDeliveryException if a matching announcements delivery could not be found 090 */ 091 public AnnouncementsDelivery findByUserId_First(long userId, 092 com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsDelivery> orderByComparator) 093 throws com.liferay.portlet.announcements.NoSuchDeliveryException; 094 095 /** 096 * Returns the first announcements delivery in the ordered set where userId = ?. 097 * 098 * @param userId the user ID 099 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 100 * @return the first matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 101 */ 102 public AnnouncementsDelivery fetchByUserId_First(long userId, 103 com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsDelivery> orderByComparator); 104 105 /** 106 * Returns the last announcements delivery in the ordered set where userId = ?. 107 * 108 * @param userId the user ID 109 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 110 * @return the last matching announcements delivery 111 * @throws NoSuchDeliveryException if a matching announcements delivery could not be found 112 */ 113 public AnnouncementsDelivery findByUserId_Last(long userId, 114 com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsDelivery> orderByComparator) 115 throws com.liferay.portlet.announcements.NoSuchDeliveryException; 116 117 /** 118 * Returns the last announcements delivery in the ordered set where userId = ?. 119 * 120 * @param userId the user ID 121 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 122 * @return the last matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 123 */ 124 public AnnouncementsDelivery fetchByUserId_Last(long userId, 125 com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsDelivery> orderByComparator); 126 127 /** 128 * Returns the announcements deliveries before and after the current announcements delivery in the ordered set where userId = ?. 129 * 130 * @param deliveryId the primary key of the current announcements delivery 131 * @param userId the user ID 132 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 133 * @return the previous, current, and next announcements delivery 134 * @throws NoSuchDeliveryException if a announcements delivery with the primary key could not be found 135 */ 136 public AnnouncementsDelivery[] findByUserId_PrevAndNext(long deliveryId, 137 long userId, 138 com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsDelivery> orderByComparator) 139 throws com.liferay.portlet.announcements.NoSuchDeliveryException; 140 141 /** 142 * Removes all the announcements deliveries where userId = ? from the database. 143 * 144 * @param userId the user ID 145 */ 146 public void removeByUserId(long userId); 147 148 /** 149 * Returns the number of announcements deliveries where userId = ?. 150 * 151 * @param userId the user ID 152 * @return the number of matching announcements deliveries 153 */ 154 public int countByUserId(long userId); 155 156 /** 157 * Returns the announcements delivery where userId = ? and type = ? or throws a {@link NoSuchDeliveryException} if it could not be found. 158 * 159 * @param userId the user ID 160 * @param type the type 161 * @return the matching announcements delivery 162 * @throws NoSuchDeliveryException if a matching announcements delivery could not be found 163 */ 164 public AnnouncementsDelivery findByU_T(long userId, java.lang.String type) 165 throws com.liferay.portlet.announcements.NoSuchDeliveryException; 166 167 /** 168 * Returns the announcements delivery where userId = ? and type = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 169 * 170 * @param userId the user ID 171 * @param type the type 172 * @return the matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 173 */ 174 public AnnouncementsDelivery fetchByU_T(long userId, java.lang.String type); 175 176 /** 177 * Returns the announcements delivery where userId = ? and type = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 178 * 179 * @param userId the user ID 180 * @param type the type 181 * @param retrieveFromCache whether to use the finder cache 182 * @return the matching announcements delivery, or <code>null</code> if a matching announcements delivery could not be found 183 */ 184 public AnnouncementsDelivery fetchByU_T(long userId, java.lang.String type, 185 boolean retrieveFromCache); 186 187 /** 188 * Removes the announcements delivery where userId = ? and type = ? from the database. 189 * 190 * @param userId the user ID 191 * @param type the type 192 * @return the announcements delivery that was removed 193 */ 194 public AnnouncementsDelivery removeByU_T(long userId, java.lang.String type) 195 throws com.liferay.portlet.announcements.NoSuchDeliveryException; 196 197 /** 198 * Returns the number of announcements deliveries where userId = ? and type = ?. 199 * 200 * @param userId the user ID 201 * @param type the type 202 * @return the number of matching announcements deliveries 203 */ 204 public int countByU_T(long userId, java.lang.String type); 205 206 /** 207 * Caches the announcements delivery in the entity cache if it is enabled. 208 * 209 * @param announcementsDelivery the announcements delivery 210 */ 211 public void cacheResult(AnnouncementsDelivery announcementsDelivery); 212 213 /** 214 * Caches the announcements deliveries in the entity cache if it is enabled. 215 * 216 * @param announcementsDeliveries the announcements deliveries 217 */ 218 public void cacheResult( 219 java.util.List<AnnouncementsDelivery> announcementsDeliveries); 220 221 /** 222 * Creates a new announcements delivery with the primary key. Does not add the announcements delivery to the database. 223 * 224 * @param deliveryId the primary key for the new announcements delivery 225 * @return the new announcements delivery 226 */ 227 public AnnouncementsDelivery create(long deliveryId); 228 229 /** 230 * Removes the announcements delivery with the primary key from the database. Also notifies the appropriate model listeners. 231 * 232 * @param deliveryId the primary key of the announcements delivery 233 * @return the announcements delivery that was removed 234 * @throws NoSuchDeliveryException if a announcements delivery with the primary key could not be found 235 */ 236 public AnnouncementsDelivery remove(long deliveryId) 237 throws com.liferay.portlet.announcements.NoSuchDeliveryException; 238 239 public AnnouncementsDelivery updateImpl( 240 AnnouncementsDelivery announcementsDelivery); 241 242 /** 243 * Returns the announcements delivery with the primary key or throws a {@link NoSuchDeliveryException} if it could not be found. 244 * 245 * @param deliveryId the primary key of the announcements delivery 246 * @return the announcements delivery 247 * @throws NoSuchDeliveryException if a announcements delivery with the primary key could not be found 248 */ 249 public AnnouncementsDelivery findByPrimaryKey(long deliveryId) 250 throws com.liferay.portlet.announcements.NoSuchDeliveryException; 251 252 /** 253 * Returns the announcements delivery with the primary key or returns <code>null</code> if it could not be found. 254 * 255 * @param deliveryId the primary key of the announcements delivery 256 * @return the announcements delivery, or <code>null</code> if a announcements delivery with the primary key could not be found 257 */ 258 public AnnouncementsDelivery fetchByPrimaryKey(long deliveryId); 259 260 @Override 261 public java.util.Map<java.io.Serializable, AnnouncementsDelivery> fetchByPrimaryKeys( 262 java.util.Set<java.io.Serializable> primaryKeys); 263 264 /** 265 * Returns all the announcements deliveries. 266 * 267 * @return the announcements deliveries 268 */ 269 public java.util.List<AnnouncementsDelivery> findAll(); 270 271 /** 272 * Returns a range of all the announcements deliveries. 273 * 274 * <p> 275 * 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 AnnouncementsDeliveryModelImpl}. 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. 276 * </p> 277 * 278 * @param start the lower bound of the range of announcements deliveries 279 * @param end the upper bound of the range of announcements deliveries (not inclusive) 280 * @return the range of announcements deliveries 281 */ 282 public java.util.List<AnnouncementsDelivery> findAll(int start, int end); 283 284 /** 285 * Returns an ordered range of all the announcements deliveries. 286 * 287 * <p> 288 * 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 AnnouncementsDeliveryModelImpl}. 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. 289 * </p> 290 * 291 * @param start the lower bound of the range of announcements deliveries 292 * @param end the upper bound of the range of announcements deliveries (not inclusive) 293 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 294 * @return the ordered range of announcements deliveries 295 */ 296 public java.util.List<AnnouncementsDelivery> findAll(int start, int end, 297 com.liferay.portal.kernel.util.OrderByComparator<AnnouncementsDelivery> orderByComparator); 298 299 /** 300 * Removes all the announcements deliveries from the database. 301 */ 302 public void removeAll(); 303 304 /** 305 * Returns the number of announcements deliveries. 306 * 307 * @return the number of announcements deliveries 308 */ 309 public int countAll(); 310 }