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.announcements.service.persistence; 016 017 import com.liferay.portal.service.persistence.BasePersistence; 018 019 import com.liferay.portlet.announcements.model.AnnouncementsFlag; 020 021 /** 022 * The persistence interface for the announcements flag 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 AnnouncementsFlagPersistenceImpl 030 * @see AnnouncementsFlagUtil 031 * @generated 032 */ 033 public interface AnnouncementsFlagPersistence extends BasePersistence<AnnouncementsFlag> { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * Never modify or reference this interface directly. Always use {@link AnnouncementsFlagUtil} to access the announcements flag persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 038 */ 039 040 /** 041 * Caches the announcements flag in the entity cache if it is enabled. 042 * 043 * @param announcementsFlag the announcements flag 044 */ 045 public void cacheResult( 046 com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag); 047 048 /** 049 * Caches the announcements flags in the entity cache if it is enabled. 050 * 051 * @param announcementsFlags the announcements flags 052 */ 053 public void cacheResult( 054 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> announcementsFlags); 055 056 /** 057 * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database. 058 * 059 * @param flagId the primary key for the new announcements flag 060 * @return the new announcements flag 061 */ 062 public com.liferay.portlet.announcements.model.AnnouncementsFlag create( 063 long flagId); 064 065 /** 066 * Removes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners. 067 * 068 * @param flagId the primary key of the announcements flag 069 * @return the announcements flag that was removed 070 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found 071 * @throws SystemException if a system exception occurred 072 */ 073 public com.liferay.portlet.announcements.model.AnnouncementsFlag remove( 074 long flagId) 075 throws com.liferay.portal.kernel.exception.SystemException, 076 com.liferay.portlet.announcements.NoSuchFlagException; 077 078 public com.liferay.portlet.announcements.model.AnnouncementsFlag updateImpl( 079 com.liferay.portlet.announcements.model.AnnouncementsFlag announcementsFlag, 080 boolean merge) 081 throws com.liferay.portal.kernel.exception.SystemException; 082 083 /** 084 * Returns the announcements flag with the primary key or throws a {@link com.liferay.portlet.announcements.NoSuchFlagException} if it could not be found. 085 * 086 * @param flagId the primary key of the announcements flag 087 * @return the announcements flag 088 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found 089 * @throws SystemException if a system exception occurred 090 */ 091 public com.liferay.portlet.announcements.model.AnnouncementsFlag findByPrimaryKey( 092 long flagId) 093 throws com.liferay.portal.kernel.exception.SystemException, 094 com.liferay.portlet.announcements.NoSuchFlagException; 095 096 /** 097 * Returns the announcements flag with the primary key or returns <code>null</code> if it could not be found. 098 * 099 * @param flagId the primary key of the announcements flag 100 * @return the announcements flag, or <code>null</code> if a announcements flag with the primary key could not be found 101 * @throws SystemException if a system exception occurred 102 */ 103 public com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByPrimaryKey( 104 long flagId) throws com.liferay.portal.kernel.exception.SystemException; 105 106 /** 107 * Returns all the announcements flags where entryId = ?. 108 * 109 * @param entryId the entry ID 110 * @return the matching announcements flags 111 * @throws SystemException if a system exception occurred 112 */ 113 public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId( 114 long entryId) 115 throws com.liferay.portal.kernel.exception.SystemException; 116 117 /** 118 * Returns a range of all the announcements flags where entryId = ?. 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 entryId the entry ID 125 * @param start the lower bound of the range of announcements flags 126 * @param end the upper bound of the range of announcements flags (not inclusive) 127 * @return the range of matching announcements flags 128 * @throws SystemException if a system exception occurred 129 */ 130 public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId( 131 long entryId, int start, int end) 132 throws com.liferay.portal.kernel.exception.SystemException; 133 134 /** 135 * Returns an ordered range of all the announcements flags where entryId = ?. 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 entryId the entry ID 142 * @param start the lower bound of the range of announcements flags 143 * @param end the upper bound of the range of announcements flags (not inclusive) 144 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 145 * @return the ordered range of matching announcements flags 146 * @throws SystemException if a system exception occurred 147 */ 148 public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findByEntryId( 149 long entryId, 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 announcements flag in the ordered set where entryId = ?. 155 * 156 * <p> 157 * 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. 158 * </p> 159 * 160 * @param entryId the entry ID 161 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 162 * @return the first matching announcements flag 163 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found 164 * @throws SystemException if a system exception occurred 165 */ 166 public com.liferay.portlet.announcements.model.AnnouncementsFlag findByEntryId_First( 167 long entryId, 168 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 169 throws com.liferay.portal.kernel.exception.SystemException, 170 com.liferay.portlet.announcements.NoSuchFlagException; 171 172 /** 173 * Returns the last announcements flag in the ordered set where entryId = ?. 174 * 175 * <p> 176 * 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. 177 * </p> 178 * 179 * @param entryId the entry ID 180 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 181 * @return the last matching announcements flag 182 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found 183 * @throws SystemException if a system exception occurred 184 */ 185 public com.liferay.portlet.announcements.model.AnnouncementsFlag findByEntryId_Last( 186 long entryId, 187 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 188 throws com.liferay.portal.kernel.exception.SystemException, 189 com.liferay.portlet.announcements.NoSuchFlagException; 190 191 /** 192 * Returns the announcements flags before and after the current announcements flag in the ordered set where entryId = ?. 193 * 194 * <p> 195 * 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. 196 * </p> 197 * 198 * @param flagId the primary key of the current announcements flag 199 * @param entryId the entry ID 200 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 201 * @return the previous, current, and next announcements flag 202 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a announcements flag with the primary key could not be found 203 * @throws SystemException if a system exception occurred 204 */ 205 public com.liferay.portlet.announcements.model.AnnouncementsFlag[] findByEntryId_PrevAndNext( 206 long flagId, long entryId, 207 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 208 throws com.liferay.portal.kernel.exception.SystemException, 209 com.liferay.portlet.announcements.NoSuchFlagException; 210 211 /** 212 * Returns the announcements flag where userId = ? and entryId = ? and value = ? or throws a {@link com.liferay.portlet.announcements.NoSuchFlagException} if it could not be found. 213 * 214 * @param userId the user ID 215 * @param entryId the entry ID 216 * @param value the value 217 * @return the matching announcements flag 218 * @throws com.liferay.portlet.announcements.NoSuchFlagException if a matching announcements flag could not be found 219 * @throws SystemException if a system exception occurred 220 */ 221 public com.liferay.portlet.announcements.model.AnnouncementsFlag findByU_E_V( 222 long userId, long entryId, int value) 223 throws com.liferay.portal.kernel.exception.SystemException, 224 com.liferay.portlet.announcements.NoSuchFlagException; 225 226 /** 227 * Returns the announcements flag where userId = ? and entryId = ? and value = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 228 * 229 * @param userId the user ID 230 * @param entryId the entry ID 231 * @param value the value 232 * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found 233 * @throws SystemException if a system exception occurred 234 */ 235 public com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V( 236 long userId, long entryId, int value) 237 throws com.liferay.portal.kernel.exception.SystemException; 238 239 /** 240 * Returns the announcements flag where userId = ? and entryId = ? and value = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 241 * 242 * @param userId the user ID 243 * @param entryId the entry ID 244 * @param value the value 245 * @param retrieveFromCache whether to use the finder cache 246 * @return the matching announcements flag, or <code>null</code> if a matching announcements flag could not be found 247 * @throws SystemException if a system exception occurred 248 */ 249 public com.liferay.portlet.announcements.model.AnnouncementsFlag fetchByU_E_V( 250 long userId, long entryId, int value, boolean retrieveFromCache) 251 throws com.liferay.portal.kernel.exception.SystemException; 252 253 /** 254 * Returns all the announcements flags. 255 * 256 * @return the announcements flags 257 * @throws SystemException if a system exception occurred 258 */ 259 public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll() 260 throws com.liferay.portal.kernel.exception.SystemException; 261 262 /** 263 * Returns a range of all the announcements flags. 264 * 265 * <p> 266 * 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. 267 * </p> 268 * 269 * @param start the lower bound of the range of announcements flags 270 * @param end the upper bound of the range of announcements flags (not inclusive) 271 * @return the range of announcements flags 272 * @throws SystemException if a system exception occurred 273 */ 274 public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll( 275 int start, int end) 276 throws com.liferay.portal.kernel.exception.SystemException; 277 278 /** 279 * Returns an ordered range of all the announcements flags. 280 * 281 * <p> 282 * 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. 283 * </p> 284 * 285 * @param start the lower bound of the range of announcements flags 286 * @param end the upper bound of the range of announcements flags (not inclusive) 287 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 288 * @return the ordered range of announcements flags 289 * @throws SystemException if a system exception occurred 290 */ 291 public java.util.List<com.liferay.portlet.announcements.model.AnnouncementsFlag> findAll( 292 int start, int end, 293 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 294 throws com.liferay.portal.kernel.exception.SystemException; 295 296 /** 297 * Removes all the announcements flags where entryId = ? from the database. 298 * 299 * @param entryId the entry ID 300 * @throws SystemException if a system exception occurred 301 */ 302 public void removeByEntryId(long entryId) 303 throws com.liferay.portal.kernel.exception.SystemException; 304 305 /** 306 * Removes the announcements flag where userId = ? and entryId = ? and value = ? from the database. 307 * 308 * @param userId the user ID 309 * @param entryId the entry ID 310 * @param value the value 311 * @throws SystemException if a system exception occurred 312 */ 313 public void removeByU_E_V(long userId, long entryId, int value) 314 throws com.liferay.portal.kernel.exception.SystemException, 315 com.liferay.portlet.announcements.NoSuchFlagException; 316 317 /** 318 * Removes all the announcements flags from the database. 319 * 320 * @throws SystemException if a system exception occurred 321 */ 322 public void removeAll() 323 throws com.liferay.portal.kernel.exception.SystemException; 324 325 /** 326 * Returns the number of announcements flags where entryId = ?. 327 * 328 * @param entryId the entry ID 329 * @return the number of matching announcements flags 330 * @throws SystemException if a system exception occurred 331 */ 332 public int countByEntryId(long entryId) 333 throws com.liferay.portal.kernel.exception.SystemException; 334 335 /** 336 * Returns the number of announcements flags where userId = ? and entryId = ? and value = ?. 337 * 338 * @param userId the user ID 339 * @param entryId the entry ID 340 * @param value the value 341 * @return the number of matching announcements flags 342 * @throws SystemException if a system exception occurred 343 */ 344 public int countByU_E_V(long userId, long entryId, int value) 345 throws com.liferay.portal.kernel.exception.SystemException; 346 347 /** 348 * Returns the number of announcements flags. 349 * 350 * @return the number of announcements flags 351 * @throws SystemException if a system exception occurred 352 */ 353 public int countAll() 354 throws com.liferay.portal.kernel.exception.SystemException; 355 }