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