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.messageboards.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.util.OrderByComparator; 022 import com.liferay.portal.kernel.util.ReferenceRegistry; 023 import com.liferay.portal.service.ServiceContext; 024 025 import com.liferay.portlet.messageboards.model.MBDiscussion; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the message boards discussion service. This utility wraps {@link com.liferay.portlet.messageboards.service.persistence.impl.MBDiscussionPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 031 * 032 * <p> 033 * Caching information and settings can be found in <code>portal.properties</code> 034 * </p> 035 * 036 * @author Brian Wing Shun Chan 037 * @see MBDiscussionPersistence 038 * @see com.liferay.portlet.messageboards.service.persistence.impl.MBDiscussionPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class MBDiscussionUtil { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 047 */ 048 049 /** 050 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 051 */ 052 public static void clearCache() { 053 getPersistence().clearCache(); 054 } 055 056 /** 057 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 058 */ 059 public static void clearCache(MBDiscussion mbDiscussion) { 060 getPersistence().clearCache(mbDiscussion); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 067 return getPersistence().countWithDynamicQuery(dynamicQuery); 068 } 069 070 /** 071 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 072 */ 073 public static List<MBDiscussion> findWithDynamicQuery( 074 DynamicQuery dynamicQuery) { 075 return getPersistence().findWithDynamicQuery(dynamicQuery); 076 } 077 078 /** 079 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 080 */ 081 public static List<MBDiscussion> findWithDynamicQuery( 082 DynamicQuery dynamicQuery, int start, int end) { 083 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 084 } 085 086 /** 087 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 088 */ 089 public static List<MBDiscussion> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator<MBDiscussion> orderByComparator) { 092 return getPersistence() 093 .findWithDynamicQuery(dynamicQuery, start, end, 094 orderByComparator); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 099 */ 100 public static MBDiscussion update(MBDiscussion mbDiscussion) { 101 return getPersistence().update(mbDiscussion); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 106 */ 107 public static MBDiscussion update(MBDiscussion mbDiscussion, 108 ServiceContext serviceContext) { 109 return getPersistence().update(mbDiscussion, serviceContext); 110 } 111 112 /** 113 * Returns all the message boards discussions where uuid = ?. 114 * 115 * @param uuid the uuid 116 * @return the matching message boards discussions 117 */ 118 public static List<MBDiscussion> findByUuid(java.lang.String uuid) { 119 return getPersistence().findByUuid(uuid); 120 } 121 122 /** 123 * Returns a range of all the message boards discussions where uuid = ?. 124 * 125 * <p> 126 * 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 MBDiscussionModelImpl}. 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. 127 * </p> 128 * 129 * @param uuid the uuid 130 * @param start the lower bound of the range of message boards discussions 131 * @param end the upper bound of the range of message boards discussions (not inclusive) 132 * @return the range of matching message boards discussions 133 */ 134 public static List<MBDiscussion> findByUuid(java.lang.String uuid, 135 int start, int end) { 136 return getPersistence().findByUuid(uuid, start, end); 137 } 138 139 /** 140 * Returns an ordered range of all the message boards discussions where uuid = ?. 141 * 142 * <p> 143 * 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 MBDiscussionModelImpl}. 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. 144 * </p> 145 * 146 * @param uuid the uuid 147 * @param start the lower bound of the range of message boards discussions 148 * @param end the upper bound of the range of message boards discussions (not inclusive) 149 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 150 * @return the ordered range of matching message boards discussions 151 */ 152 public static List<MBDiscussion> findByUuid(java.lang.String uuid, 153 int start, int end, OrderByComparator<MBDiscussion> orderByComparator) { 154 return getPersistence().findByUuid(uuid, start, end, orderByComparator); 155 } 156 157 /** 158 * Returns the first message boards discussion in the ordered set where uuid = ?. 159 * 160 * @param uuid the uuid 161 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 162 * @return the first matching message boards discussion 163 * @throws NoSuchDiscussionException if a matching message boards discussion could not be found 164 */ 165 public static MBDiscussion findByUuid_First(java.lang.String uuid, 166 OrderByComparator<MBDiscussion> orderByComparator) 167 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 168 return getPersistence().findByUuid_First(uuid, orderByComparator); 169 } 170 171 /** 172 * Returns the first message boards discussion in the ordered set where uuid = ?. 173 * 174 * @param uuid the uuid 175 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 176 * @return the first matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 177 */ 178 public static MBDiscussion fetchByUuid_First(java.lang.String uuid, 179 OrderByComparator<MBDiscussion> orderByComparator) { 180 return getPersistence().fetchByUuid_First(uuid, orderByComparator); 181 } 182 183 /** 184 * Returns the last message boards discussion in the ordered set where uuid = ?. 185 * 186 * @param uuid the uuid 187 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 188 * @return the last matching message boards discussion 189 * @throws NoSuchDiscussionException if a matching message boards discussion could not be found 190 */ 191 public static MBDiscussion findByUuid_Last(java.lang.String uuid, 192 OrderByComparator<MBDiscussion> orderByComparator) 193 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 194 return getPersistence().findByUuid_Last(uuid, orderByComparator); 195 } 196 197 /** 198 * Returns the last message boards discussion in the ordered set where uuid = ?. 199 * 200 * @param uuid the uuid 201 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 202 * @return the last matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 203 */ 204 public static MBDiscussion fetchByUuid_Last(java.lang.String uuid, 205 OrderByComparator<MBDiscussion> orderByComparator) { 206 return getPersistence().fetchByUuid_Last(uuid, orderByComparator); 207 } 208 209 /** 210 * Returns the message boards discussions before and after the current message boards discussion in the ordered set where uuid = ?. 211 * 212 * @param discussionId the primary key of the current message boards discussion 213 * @param uuid the uuid 214 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 215 * @return the previous, current, and next message boards discussion 216 * @throws NoSuchDiscussionException if a message boards discussion with the primary key could not be found 217 */ 218 public static MBDiscussion[] findByUuid_PrevAndNext(long discussionId, 219 java.lang.String uuid, OrderByComparator<MBDiscussion> orderByComparator) 220 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 221 return getPersistence() 222 .findByUuid_PrevAndNext(discussionId, uuid, orderByComparator); 223 } 224 225 /** 226 * Removes all the message boards discussions where uuid = ? from the database. 227 * 228 * @param uuid the uuid 229 */ 230 public static void removeByUuid(java.lang.String uuid) { 231 getPersistence().removeByUuid(uuid); 232 } 233 234 /** 235 * Returns the number of message boards discussions where uuid = ?. 236 * 237 * @param uuid the uuid 238 * @return the number of matching message boards discussions 239 */ 240 public static int countByUuid(java.lang.String uuid) { 241 return getPersistence().countByUuid(uuid); 242 } 243 244 /** 245 * Returns the message boards discussion where uuid = ? and groupId = ? or throws a {@link NoSuchDiscussionException} if it could not be found. 246 * 247 * @param uuid the uuid 248 * @param groupId the group ID 249 * @return the matching message boards discussion 250 * @throws NoSuchDiscussionException if a matching message boards discussion could not be found 251 */ 252 public static MBDiscussion findByUUID_G(java.lang.String uuid, long groupId) 253 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 254 return getPersistence().findByUUID_G(uuid, groupId); 255 } 256 257 /** 258 * Returns the message boards discussion where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 259 * 260 * @param uuid the uuid 261 * @param groupId the group ID 262 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 263 */ 264 public static MBDiscussion fetchByUUID_G(java.lang.String uuid, long groupId) { 265 return getPersistence().fetchByUUID_G(uuid, groupId); 266 } 267 268 /** 269 * Returns the message boards discussion where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 270 * 271 * @param uuid the uuid 272 * @param groupId the group ID 273 * @param retrieveFromCache whether to use the finder cache 274 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 275 */ 276 public static MBDiscussion fetchByUUID_G(java.lang.String uuid, 277 long groupId, boolean retrieveFromCache) { 278 return getPersistence().fetchByUUID_G(uuid, groupId, retrieveFromCache); 279 } 280 281 /** 282 * Removes the message boards discussion where uuid = ? and groupId = ? from the database. 283 * 284 * @param uuid the uuid 285 * @param groupId the group ID 286 * @return the message boards discussion that was removed 287 */ 288 public static MBDiscussion removeByUUID_G(java.lang.String uuid, 289 long groupId) 290 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 291 return getPersistence().removeByUUID_G(uuid, groupId); 292 } 293 294 /** 295 * Returns the number of message boards discussions where uuid = ? and groupId = ?. 296 * 297 * @param uuid the uuid 298 * @param groupId the group ID 299 * @return the number of matching message boards discussions 300 */ 301 public static int countByUUID_G(java.lang.String uuid, long groupId) { 302 return getPersistence().countByUUID_G(uuid, groupId); 303 } 304 305 /** 306 * Returns all the message boards discussions where uuid = ? and companyId = ?. 307 * 308 * @param uuid the uuid 309 * @param companyId the company ID 310 * @return the matching message boards discussions 311 */ 312 public static List<MBDiscussion> findByUuid_C(java.lang.String uuid, 313 long companyId) { 314 return getPersistence().findByUuid_C(uuid, companyId); 315 } 316 317 /** 318 * Returns a range of all the message boards discussions where uuid = ? and companyId = ?. 319 * 320 * <p> 321 * 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 MBDiscussionModelImpl}. 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. 322 * </p> 323 * 324 * @param uuid the uuid 325 * @param companyId the company ID 326 * @param start the lower bound of the range of message boards discussions 327 * @param end the upper bound of the range of message boards discussions (not inclusive) 328 * @return the range of matching message boards discussions 329 */ 330 public static List<MBDiscussion> findByUuid_C(java.lang.String uuid, 331 long companyId, int start, int end) { 332 return getPersistence().findByUuid_C(uuid, companyId, start, end); 333 } 334 335 /** 336 * Returns an ordered range of all the message boards discussions where uuid = ? and companyId = ?. 337 * 338 * <p> 339 * 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 MBDiscussionModelImpl}. 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. 340 * </p> 341 * 342 * @param uuid the uuid 343 * @param companyId the company ID 344 * @param start the lower bound of the range of message boards discussions 345 * @param end the upper bound of the range of message boards discussions (not inclusive) 346 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 347 * @return the ordered range of matching message boards discussions 348 */ 349 public static List<MBDiscussion> findByUuid_C(java.lang.String uuid, 350 long companyId, int start, int end, 351 OrderByComparator<MBDiscussion> orderByComparator) { 352 return getPersistence() 353 .findByUuid_C(uuid, companyId, start, end, orderByComparator); 354 } 355 356 /** 357 * Returns the first message boards discussion in the ordered set where uuid = ? and companyId = ?. 358 * 359 * @param uuid the uuid 360 * @param companyId the company ID 361 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 362 * @return the first matching message boards discussion 363 * @throws NoSuchDiscussionException if a matching message boards discussion could not be found 364 */ 365 public static MBDiscussion findByUuid_C_First(java.lang.String uuid, 366 long companyId, OrderByComparator<MBDiscussion> orderByComparator) 367 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 368 return getPersistence() 369 .findByUuid_C_First(uuid, companyId, orderByComparator); 370 } 371 372 /** 373 * Returns the first message boards discussion in the ordered set where uuid = ? and companyId = ?. 374 * 375 * @param uuid the uuid 376 * @param companyId the company ID 377 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 378 * @return the first matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 379 */ 380 public static MBDiscussion fetchByUuid_C_First(java.lang.String uuid, 381 long companyId, OrderByComparator<MBDiscussion> orderByComparator) { 382 return getPersistence() 383 .fetchByUuid_C_First(uuid, companyId, orderByComparator); 384 } 385 386 /** 387 * Returns the last message boards discussion in the ordered set where uuid = ? and companyId = ?. 388 * 389 * @param uuid the uuid 390 * @param companyId the company ID 391 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 392 * @return the last matching message boards discussion 393 * @throws NoSuchDiscussionException if a matching message boards discussion could not be found 394 */ 395 public static MBDiscussion findByUuid_C_Last(java.lang.String uuid, 396 long companyId, OrderByComparator<MBDiscussion> orderByComparator) 397 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 398 return getPersistence() 399 .findByUuid_C_Last(uuid, companyId, orderByComparator); 400 } 401 402 /** 403 * Returns the last message boards discussion in the ordered set where uuid = ? and companyId = ?. 404 * 405 * @param uuid the uuid 406 * @param companyId the company ID 407 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 408 * @return the last matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 409 */ 410 public static MBDiscussion fetchByUuid_C_Last(java.lang.String uuid, 411 long companyId, OrderByComparator<MBDiscussion> orderByComparator) { 412 return getPersistence() 413 .fetchByUuid_C_Last(uuid, companyId, orderByComparator); 414 } 415 416 /** 417 * Returns the message boards discussions before and after the current message boards discussion in the ordered set where uuid = ? and companyId = ?. 418 * 419 * @param discussionId the primary key of the current message boards discussion 420 * @param uuid the uuid 421 * @param companyId the company ID 422 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 423 * @return the previous, current, and next message boards discussion 424 * @throws NoSuchDiscussionException if a message boards discussion with the primary key could not be found 425 */ 426 public static MBDiscussion[] findByUuid_C_PrevAndNext(long discussionId, 427 java.lang.String uuid, long companyId, 428 OrderByComparator<MBDiscussion> orderByComparator) 429 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 430 return getPersistence() 431 .findByUuid_C_PrevAndNext(discussionId, uuid, companyId, 432 orderByComparator); 433 } 434 435 /** 436 * Removes all the message boards discussions where uuid = ? and companyId = ? from the database. 437 * 438 * @param uuid the uuid 439 * @param companyId the company ID 440 */ 441 public static void removeByUuid_C(java.lang.String uuid, long companyId) { 442 getPersistence().removeByUuid_C(uuid, companyId); 443 } 444 445 /** 446 * Returns the number of message boards discussions where uuid = ? and companyId = ?. 447 * 448 * @param uuid the uuid 449 * @param companyId the company ID 450 * @return the number of matching message boards discussions 451 */ 452 public static int countByUuid_C(java.lang.String uuid, long companyId) { 453 return getPersistence().countByUuid_C(uuid, companyId); 454 } 455 456 /** 457 * Returns all the message boards discussions where classNameId = ?. 458 * 459 * @param classNameId the class name ID 460 * @return the matching message boards discussions 461 */ 462 public static List<MBDiscussion> findByClassNameId(long classNameId) { 463 return getPersistence().findByClassNameId(classNameId); 464 } 465 466 /** 467 * Returns a range of all the message boards discussions where classNameId = ?. 468 * 469 * <p> 470 * 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 MBDiscussionModelImpl}. 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. 471 * </p> 472 * 473 * @param classNameId the class name ID 474 * @param start the lower bound of the range of message boards discussions 475 * @param end the upper bound of the range of message boards discussions (not inclusive) 476 * @return the range of matching message boards discussions 477 */ 478 public static List<MBDiscussion> findByClassNameId(long classNameId, 479 int start, int end) { 480 return getPersistence().findByClassNameId(classNameId, start, end); 481 } 482 483 /** 484 * Returns an ordered range of all the message boards discussions where classNameId = ?. 485 * 486 * <p> 487 * 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 MBDiscussionModelImpl}. 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. 488 * </p> 489 * 490 * @param classNameId the class name ID 491 * @param start the lower bound of the range of message boards discussions 492 * @param end the upper bound of the range of message boards discussions (not inclusive) 493 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 494 * @return the ordered range of matching message boards discussions 495 */ 496 public static List<MBDiscussion> findByClassNameId(long classNameId, 497 int start, int end, OrderByComparator<MBDiscussion> orderByComparator) { 498 return getPersistence() 499 .findByClassNameId(classNameId, start, end, orderByComparator); 500 } 501 502 /** 503 * Returns the first message boards discussion in the ordered set where classNameId = ?. 504 * 505 * @param classNameId the class name ID 506 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 507 * @return the first matching message boards discussion 508 * @throws NoSuchDiscussionException if a matching message boards discussion could not be found 509 */ 510 public static MBDiscussion findByClassNameId_First(long classNameId, 511 OrderByComparator<MBDiscussion> orderByComparator) 512 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 513 return getPersistence() 514 .findByClassNameId_First(classNameId, orderByComparator); 515 } 516 517 /** 518 * Returns the first message boards discussion in the ordered set where classNameId = ?. 519 * 520 * @param classNameId the class name ID 521 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 522 * @return the first matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 523 */ 524 public static MBDiscussion fetchByClassNameId_First(long classNameId, 525 OrderByComparator<MBDiscussion> orderByComparator) { 526 return getPersistence() 527 .fetchByClassNameId_First(classNameId, orderByComparator); 528 } 529 530 /** 531 * Returns the last message boards discussion in the ordered set where classNameId = ?. 532 * 533 * @param classNameId the class name ID 534 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 535 * @return the last matching message boards discussion 536 * @throws NoSuchDiscussionException if a matching message boards discussion could not be found 537 */ 538 public static MBDiscussion findByClassNameId_Last(long classNameId, 539 OrderByComparator<MBDiscussion> orderByComparator) 540 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 541 return getPersistence() 542 .findByClassNameId_Last(classNameId, orderByComparator); 543 } 544 545 /** 546 * Returns the last message boards discussion in the ordered set where classNameId = ?. 547 * 548 * @param classNameId the class name ID 549 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 550 * @return the last matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 551 */ 552 public static MBDiscussion fetchByClassNameId_Last(long classNameId, 553 OrderByComparator<MBDiscussion> orderByComparator) { 554 return getPersistence() 555 .fetchByClassNameId_Last(classNameId, orderByComparator); 556 } 557 558 /** 559 * Returns the message boards discussions before and after the current message boards discussion in the ordered set where classNameId = ?. 560 * 561 * @param discussionId the primary key of the current message boards discussion 562 * @param classNameId the class name ID 563 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 564 * @return the previous, current, and next message boards discussion 565 * @throws NoSuchDiscussionException if a message boards discussion with the primary key could not be found 566 */ 567 public static MBDiscussion[] findByClassNameId_PrevAndNext( 568 long discussionId, long classNameId, 569 OrderByComparator<MBDiscussion> orderByComparator) 570 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 571 return getPersistence() 572 .findByClassNameId_PrevAndNext(discussionId, classNameId, 573 orderByComparator); 574 } 575 576 /** 577 * Removes all the message boards discussions where classNameId = ? from the database. 578 * 579 * @param classNameId the class name ID 580 */ 581 public static void removeByClassNameId(long classNameId) { 582 getPersistence().removeByClassNameId(classNameId); 583 } 584 585 /** 586 * Returns the number of message boards discussions where classNameId = ?. 587 * 588 * @param classNameId the class name ID 589 * @return the number of matching message boards discussions 590 */ 591 public static int countByClassNameId(long classNameId) { 592 return getPersistence().countByClassNameId(classNameId); 593 } 594 595 /** 596 * Returns the message boards discussion where threadId = ? or throws a {@link NoSuchDiscussionException} if it could not be found. 597 * 598 * @param threadId the thread ID 599 * @return the matching message boards discussion 600 * @throws NoSuchDiscussionException if a matching message boards discussion could not be found 601 */ 602 public static MBDiscussion findByThreadId(long threadId) 603 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 604 return getPersistence().findByThreadId(threadId); 605 } 606 607 /** 608 * Returns the message boards discussion where threadId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 609 * 610 * @param threadId the thread ID 611 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 612 */ 613 public static MBDiscussion fetchByThreadId(long threadId) { 614 return getPersistence().fetchByThreadId(threadId); 615 } 616 617 /** 618 * Returns the message boards discussion where threadId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 619 * 620 * @param threadId the thread ID 621 * @param retrieveFromCache whether to use the finder cache 622 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 623 */ 624 public static MBDiscussion fetchByThreadId(long threadId, 625 boolean retrieveFromCache) { 626 return getPersistence().fetchByThreadId(threadId, retrieveFromCache); 627 } 628 629 /** 630 * Removes the message boards discussion where threadId = ? from the database. 631 * 632 * @param threadId the thread ID 633 * @return the message boards discussion that was removed 634 */ 635 public static MBDiscussion removeByThreadId(long threadId) 636 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 637 return getPersistence().removeByThreadId(threadId); 638 } 639 640 /** 641 * Returns the number of message boards discussions where threadId = ?. 642 * 643 * @param threadId the thread ID 644 * @return the number of matching message boards discussions 645 */ 646 public static int countByThreadId(long threadId) { 647 return getPersistence().countByThreadId(threadId); 648 } 649 650 /** 651 * Returns the message boards discussion where classNameId = ? and classPK = ? or throws a {@link NoSuchDiscussionException} if it could not be found. 652 * 653 * @param classNameId the class name ID 654 * @param classPK the class p k 655 * @return the matching message boards discussion 656 * @throws NoSuchDiscussionException if a matching message boards discussion could not be found 657 */ 658 public static MBDiscussion findByC_C(long classNameId, long classPK) 659 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 660 return getPersistence().findByC_C(classNameId, classPK); 661 } 662 663 /** 664 * Returns the message boards discussion where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 665 * 666 * @param classNameId the class name ID 667 * @param classPK the class p k 668 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 669 */ 670 public static MBDiscussion fetchByC_C(long classNameId, long classPK) { 671 return getPersistence().fetchByC_C(classNameId, classPK); 672 } 673 674 /** 675 * 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. 676 * 677 * @param classNameId the class name ID 678 * @param classPK the class p k 679 * @param retrieveFromCache whether to use the finder cache 680 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 681 */ 682 public static MBDiscussion fetchByC_C(long classNameId, long classPK, 683 boolean retrieveFromCache) { 684 return getPersistence() 685 .fetchByC_C(classNameId, classPK, retrieveFromCache); 686 } 687 688 /** 689 * Removes the message boards discussion where classNameId = ? and classPK = ? from the database. 690 * 691 * @param classNameId the class name ID 692 * @param classPK the class p k 693 * @return the message boards discussion that was removed 694 */ 695 public static MBDiscussion removeByC_C(long classNameId, long classPK) 696 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 697 return getPersistence().removeByC_C(classNameId, classPK); 698 } 699 700 /** 701 * Returns the number of message boards discussions where classNameId = ? and classPK = ?. 702 * 703 * @param classNameId the class name ID 704 * @param classPK the class p k 705 * @return the number of matching message boards discussions 706 */ 707 public static int countByC_C(long classNameId, long classPK) { 708 return getPersistence().countByC_C(classNameId, classPK); 709 } 710 711 /** 712 * Caches the message boards discussion in the entity cache if it is enabled. 713 * 714 * @param mbDiscussion the message boards discussion 715 */ 716 public static void cacheResult(MBDiscussion mbDiscussion) { 717 getPersistence().cacheResult(mbDiscussion); 718 } 719 720 /** 721 * Caches the message boards discussions in the entity cache if it is enabled. 722 * 723 * @param mbDiscussions the message boards discussions 724 */ 725 public static void cacheResult(List<MBDiscussion> mbDiscussions) { 726 getPersistence().cacheResult(mbDiscussions); 727 } 728 729 /** 730 * Creates a new message boards discussion with the primary key. Does not add the message boards discussion to the database. 731 * 732 * @param discussionId the primary key for the new message boards discussion 733 * @return the new message boards discussion 734 */ 735 public static MBDiscussion create(long discussionId) { 736 return getPersistence().create(discussionId); 737 } 738 739 /** 740 * Removes the message boards discussion with the primary key from the database. Also notifies the appropriate model listeners. 741 * 742 * @param discussionId the primary key of the message boards discussion 743 * @return the message boards discussion that was removed 744 * @throws NoSuchDiscussionException if a message boards discussion with the primary key could not be found 745 */ 746 public static MBDiscussion remove(long discussionId) 747 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 748 return getPersistence().remove(discussionId); 749 } 750 751 public static MBDiscussion updateImpl(MBDiscussion mbDiscussion) { 752 return getPersistence().updateImpl(mbDiscussion); 753 } 754 755 /** 756 * Returns the message boards discussion with the primary key or throws a {@link NoSuchDiscussionException} if it could not be found. 757 * 758 * @param discussionId the primary key of the message boards discussion 759 * @return the message boards discussion 760 * @throws NoSuchDiscussionException if a message boards discussion with the primary key could not be found 761 */ 762 public static MBDiscussion findByPrimaryKey(long discussionId) 763 throws com.liferay.portlet.messageboards.NoSuchDiscussionException { 764 return getPersistence().findByPrimaryKey(discussionId); 765 } 766 767 /** 768 * Returns the message boards discussion with the primary key or returns <code>null</code> if it could not be found. 769 * 770 * @param discussionId the primary key of the message boards discussion 771 * @return the message boards discussion, or <code>null</code> if a message boards discussion with the primary key could not be found 772 */ 773 public static MBDiscussion fetchByPrimaryKey(long discussionId) { 774 return getPersistence().fetchByPrimaryKey(discussionId); 775 } 776 777 public static java.util.Map<java.io.Serializable, MBDiscussion> fetchByPrimaryKeys( 778 java.util.Set<java.io.Serializable> primaryKeys) { 779 return getPersistence().fetchByPrimaryKeys(primaryKeys); 780 } 781 782 /** 783 * Returns all the message boards discussions. 784 * 785 * @return the message boards discussions 786 */ 787 public static List<MBDiscussion> findAll() { 788 return getPersistence().findAll(); 789 } 790 791 /** 792 * Returns a range of all the message boards discussions. 793 * 794 * <p> 795 * 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 MBDiscussionModelImpl}. 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. 796 * </p> 797 * 798 * @param start the lower bound of the range of message boards discussions 799 * @param end the upper bound of the range of message boards discussions (not inclusive) 800 * @return the range of message boards discussions 801 */ 802 public static List<MBDiscussion> findAll(int start, int end) { 803 return getPersistence().findAll(start, end); 804 } 805 806 /** 807 * Returns an ordered range of all the message boards discussions. 808 * 809 * <p> 810 * 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 MBDiscussionModelImpl}. 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. 811 * </p> 812 * 813 * @param start the lower bound of the range of message boards discussions 814 * @param end the upper bound of the range of message boards discussions (not inclusive) 815 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 816 * @return the ordered range of message boards discussions 817 */ 818 public static List<MBDiscussion> findAll(int start, int end, 819 OrderByComparator<MBDiscussion> orderByComparator) { 820 return getPersistence().findAll(start, end, orderByComparator); 821 } 822 823 /** 824 * Removes all the message boards discussions from the database. 825 */ 826 public static void removeAll() { 827 getPersistence().removeAll(); 828 } 829 830 /** 831 * Returns the number of message boards discussions. 832 * 833 * @return the number of message boards discussions 834 */ 835 public static int countAll() { 836 return getPersistence().countAll(); 837 } 838 839 public static MBDiscussionPersistence getPersistence() { 840 if (_persistence == null) { 841 _persistence = (MBDiscussionPersistence)PortalBeanLocatorUtil.locate(MBDiscussionPersistence.class.getName()); 842 843 ReferenceRegistry.registerReference(MBDiscussionUtil.class, 844 "_persistence"); 845 } 846 847 return _persistence; 848 } 849 850 /** 851 * @deprecated As of 6.2.0 852 */ 853 @Deprecated 854 public void setPersistence(MBDiscussionPersistence persistence) { 855 } 856 857 private static MBDiscussionPersistence _persistence; 858 }