001 /** 002 * Copyright (c) 2000-2010 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.messageboards.service.persistence; 016 017 import com.liferay.portal.service.persistence.BasePersistence; 018 019 import com.liferay.portlet.messageboards.model.MBDiscussion; 020 021 /** 022 * The persistence interface for the message boards discussion service. 023 * 024 * <p> 025 * Never modify this interface directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this interface. 026 * </p> 027 * 028 * @author Brian Wing Shun Chan 029 * @see MBDiscussionPersistenceImpl 030 * @see MBDiscussionUtil 031 * @generated 032 */ 033 public interface MBDiscussionPersistence extends BasePersistence<MBDiscussion> { 034 /** 035 * Caches the message boards discussion in the entity cache if it is enabled. 036 * 037 * @param mbDiscussion the message boards discussion to cache 038 */ 039 public void cacheResult( 040 com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion); 041 042 /** 043 * Caches the message boards discussions in the entity cache if it is enabled. 044 * 045 * @param mbDiscussions the message boards discussions to cache 046 */ 047 public void cacheResult( 048 java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> mbDiscussions); 049 050 /** 051 * Creates a new message boards discussion with the primary key. 052 * 053 * @param discussionId the primary key for the new message boards discussion 054 * @return the new message boards discussion 055 */ 056 public com.liferay.portlet.messageboards.model.MBDiscussion create( 057 long discussionId); 058 059 /** 060 * Removes the message boards discussion with the primary key from the database. Also notifies the appropriate model listeners. 061 * 062 * @param discussionId the primary key of the message boards discussion to remove 063 * @return the message boards discussion that was removed 064 * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found 065 * @throws SystemException if a system exception occurred 066 */ 067 public com.liferay.portlet.messageboards.model.MBDiscussion remove( 068 long discussionId) 069 throws com.liferay.portal.kernel.exception.SystemException, 070 com.liferay.portlet.messageboards.NoSuchDiscussionException; 071 072 public com.liferay.portlet.messageboards.model.MBDiscussion updateImpl( 073 com.liferay.portlet.messageboards.model.MBDiscussion mbDiscussion, 074 boolean merge) 075 throws com.liferay.portal.kernel.exception.SystemException; 076 077 /** 078 * Finds the message boards discussion with the primary key or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found. 079 * 080 * @param discussionId the primary key of the message boards discussion to find 081 * @return the message boards discussion 082 * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found 083 * @throws SystemException if a system exception occurred 084 */ 085 public com.liferay.portlet.messageboards.model.MBDiscussion findByPrimaryKey( 086 long discussionId) 087 throws com.liferay.portal.kernel.exception.SystemException, 088 com.liferay.portlet.messageboards.NoSuchDiscussionException; 089 090 /** 091 * Finds the message boards discussion with the primary key or returns <code>null</code> if it could not be found. 092 * 093 * @param discussionId the primary key of the message boards discussion to find 094 * @return the message boards discussion, or <code>null</code> if a message boards discussion with the primary key could not be found 095 * @throws SystemException if a system exception occurred 096 */ 097 public com.liferay.portlet.messageboards.model.MBDiscussion fetchByPrimaryKey( 098 long discussionId) 099 throws com.liferay.portal.kernel.exception.SystemException; 100 101 /** 102 * Finds all the message boards discussions where classNameId = ?. 103 * 104 * @param classNameId the class name id to search with 105 * @return the matching message boards discussions 106 * @throws SystemException if a system exception occurred 107 */ 108 public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId( 109 long classNameId) 110 throws com.liferay.portal.kernel.exception.SystemException; 111 112 /** 113 * Finds a range of all the message boards discussions where classNameId = ?. 114 * 115 * <p> 116 * 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. 117 * </p> 118 * 119 * @param classNameId the class name id to search with 120 * @param start the lower bound of the range of message boards discussions to return 121 * @param end the upper bound of the range of message boards discussions to return (not inclusive) 122 * @return the range of matching message boards discussions 123 * @throws SystemException if a system exception occurred 124 */ 125 public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId( 126 long classNameId, int start, int end) 127 throws com.liferay.portal.kernel.exception.SystemException; 128 129 /** 130 * Finds an ordered range of all the message boards discussions where classNameId = ?. 131 * 132 * <p> 133 * 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. 134 * </p> 135 * 136 * @param classNameId the class name id to search with 137 * @param start the lower bound of the range of message boards discussions to return 138 * @param end the upper bound of the range of message boards discussions to return (not inclusive) 139 * @param orderByComparator the comparator to order the results by 140 * @return the ordered range of matching message boards discussions 141 * @throws SystemException if a system exception occurred 142 */ 143 public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findByClassNameId( 144 long classNameId, int start, int end, 145 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 146 throws com.liferay.portal.kernel.exception.SystemException; 147 148 /** 149 * Finds the first message boards discussion in the ordered set where classNameId = ?. 150 * 151 * <p> 152 * 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. 153 * </p> 154 * 155 * @param classNameId the class name id to search with 156 * @param orderByComparator the comparator to order the set by 157 * @return the first matching message boards discussion 158 * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found 159 * @throws SystemException if a system exception occurred 160 */ 161 public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_First( 162 long classNameId, 163 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 164 throws com.liferay.portal.kernel.exception.SystemException, 165 com.liferay.portlet.messageboards.NoSuchDiscussionException; 166 167 /** 168 * Finds the last message boards discussion in the ordered set where classNameId = ?. 169 * 170 * <p> 171 * 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. 172 * </p> 173 * 174 * @param classNameId the class name id to search with 175 * @param orderByComparator the comparator to order the set by 176 * @return the last matching message boards discussion 177 * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found 178 * @throws SystemException if a system exception occurred 179 */ 180 public com.liferay.portlet.messageboards.model.MBDiscussion findByClassNameId_Last( 181 long classNameId, 182 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 183 throws com.liferay.portal.kernel.exception.SystemException, 184 com.liferay.portlet.messageboards.NoSuchDiscussionException; 185 186 /** 187 * Finds the message boards discussions before and after the current message boards discussion in the ordered set where classNameId = ?. 188 * 189 * <p> 190 * 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. 191 * </p> 192 * 193 * @param discussionId the primary key of the current message boards discussion 194 * @param classNameId the class name id to search with 195 * @param orderByComparator the comparator to order the set by 196 * @return the previous, current, and next message boards discussion 197 * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a message boards discussion with the primary key could not be found 198 * @throws SystemException if a system exception occurred 199 */ 200 public com.liferay.portlet.messageboards.model.MBDiscussion[] findByClassNameId_PrevAndNext( 201 long discussionId, long classNameId, 202 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 203 throws com.liferay.portal.kernel.exception.SystemException, 204 com.liferay.portlet.messageboards.NoSuchDiscussionException; 205 206 /** 207 * Finds the message boards discussion where threadId = ? or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found. 208 * 209 * @param threadId the thread id to search with 210 * @return the matching message boards discussion 211 * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found 212 * @throws SystemException if a system exception occurred 213 */ 214 public com.liferay.portlet.messageboards.model.MBDiscussion findByThreadId( 215 long threadId) 216 throws com.liferay.portal.kernel.exception.SystemException, 217 com.liferay.portlet.messageboards.NoSuchDiscussionException; 218 219 /** 220 * Finds the message boards discussion where threadId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 221 * 222 * @param threadId the thread id to search with 223 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 224 * @throws SystemException if a system exception occurred 225 */ 226 public com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId( 227 long threadId) 228 throws com.liferay.portal.kernel.exception.SystemException; 229 230 /** 231 * Finds the message boards discussion where threadId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 232 * 233 * @param threadId the thread id to search with 234 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 235 * @throws SystemException if a system exception occurred 236 */ 237 public com.liferay.portlet.messageboards.model.MBDiscussion fetchByThreadId( 238 long threadId, boolean retrieveFromCache) 239 throws com.liferay.portal.kernel.exception.SystemException; 240 241 /** 242 * Finds the message boards discussion where classNameId = ? and classPK = ? or throws a {@link com.liferay.portlet.messageboards.NoSuchDiscussionException} if it could not be found. 243 * 244 * @param classNameId the class name id to search with 245 * @param classPK the class p k to search with 246 * @return the matching message boards discussion 247 * @throws com.liferay.portlet.messageboards.NoSuchDiscussionException if a matching message boards discussion could not be found 248 * @throws SystemException if a system exception occurred 249 */ 250 public com.liferay.portlet.messageboards.model.MBDiscussion findByC_C( 251 long classNameId, long classPK) 252 throws com.liferay.portal.kernel.exception.SystemException, 253 com.liferay.portlet.messageboards.NoSuchDiscussionException; 254 255 /** 256 * Finds the message boards discussion where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 257 * 258 * @param classNameId the class name id to search with 259 * @param classPK the class p k to search with 260 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 261 * @throws SystemException if a system exception occurred 262 */ 263 public com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C( 264 long classNameId, long classPK) 265 throws com.liferay.portal.kernel.exception.SystemException; 266 267 /** 268 * Finds the message boards discussion where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 269 * 270 * @param classNameId the class name id to search with 271 * @param classPK the class p k to search with 272 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 273 * @throws SystemException if a system exception occurred 274 */ 275 public com.liferay.portlet.messageboards.model.MBDiscussion fetchByC_C( 276 long classNameId, long classPK, boolean retrieveFromCache) 277 throws com.liferay.portal.kernel.exception.SystemException; 278 279 /** 280 * Finds all the message boards discussions. 281 * 282 * @return the message boards discussions 283 * @throws SystemException if a system exception occurred 284 */ 285 public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll() 286 throws com.liferay.portal.kernel.exception.SystemException; 287 288 /** 289 * Finds a range of all the message boards discussions. 290 * 291 * <p> 292 * 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. 293 * </p> 294 * 295 * @param start the lower bound of the range of message boards discussions to return 296 * @param end the upper bound of the range of message boards discussions to return (not inclusive) 297 * @return the range of message boards discussions 298 * @throws SystemException if a system exception occurred 299 */ 300 public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll( 301 int start, int end) 302 throws com.liferay.portal.kernel.exception.SystemException; 303 304 /** 305 * Finds an ordered range of all the message boards discussions. 306 * 307 * <p> 308 * 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. 309 * </p> 310 * 311 * @param start the lower bound of the range of message boards discussions to return 312 * @param end the upper bound of the range of message boards discussions to return (not inclusive) 313 * @param orderByComparator the comparator to order the results by 314 * @return the ordered range of message boards discussions 315 * @throws SystemException if a system exception occurred 316 */ 317 public java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> findAll( 318 int start, int end, 319 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 320 throws com.liferay.portal.kernel.exception.SystemException; 321 322 /** 323 * Removes all the message boards discussions where classNameId = ? from the database. 324 * 325 * @param classNameId the class name id to search with 326 * @throws SystemException if a system exception occurred 327 */ 328 public void removeByClassNameId(long classNameId) 329 throws com.liferay.portal.kernel.exception.SystemException; 330 331 /** 332 * Removes the message boards discussion where threadId = ? from the database. 333 * 334 * @param threadId the thread id to search with 335 * @throws SystemException if a system exception occurred 336 */ 337 public void removeByThreadId(long threadId) 338 throws com.liferay.portal.kernel.exception.SystemException, 339 com.liferay.portlet.messageboards.NoSuchDiscussionException; 340 341 /** 342 * Removes the message boards discussion where classNameId = ? and classPK = ? from the database. 343 * 344 * @param classNameId the class name id to search with 345 * @param classPK the class p k to search with 346 * @throws SystemException if a system exception occurred 347 */ 348 public void removeByC_C(long classNameId, long classPK) 349 throws com.liferay.portal.kernel.exception.SystemException, 350 com.liferay.portlet.messageboards.NoSuchDiscussionException; 351 352 /** 353 * Removes all the message boards discussions from the database. 354 * 355 * @throws SystemException if a system exception occurred 356 */ 357 public void removeAll() 358 throws com.liferay.portal.kernel.exception.SystemException; 359 360 /** 361 * Counts all the message boards discussions where classNameId = ?. 362 * 363 * @param classNameId the class name id to search with 364 * @return the number of matching message boards discussions 365 * @throws SystemException if a system exception occurred 366 */ 367 public int countByClassNameId(long classNameId) 368 throws com.liferay.portal.kernel.exception.SystemException; 369 370 /** 371 * Counts all the message boards discussions where threadId = ?. 372 * 373 * @param threadId the thread id to search with 374 * @return the number of matching message boards discussions 375 * @throws SystemException if a system exception occurred 376 */ 377 public int countByThreadId(long threadId) 378 throws com.liferay.portal.kernel.exception.SystemException; 379 380 /** 381 * Counts all the message boards discussions where classNameId = ? and classPK = ?. 382 * 383 * @param classNameId the class name id to search with 384 * @param classPK the class p k to search with 385 * @return the number of matching message boards discussions 386 * @throws SystemException if a system exception occurred 387 */ 388 public int countByC_C(long classNameId, long classPK) 389 throws com.liferay.portal.kernel.exception.SystemException; 390 391 /** 392 * Counts all the message boards discussions. 393 * 394 * @return the number of message boards discussions 395 * @throws SystemException if a system exception occurred 396 */ 397 public int countAll() 398 throws com.liferay.portal.kernel.exception.SystemException; 399 }