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.journal.service.persistence; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.service.ServiceContext; 022 023 import com.liferay.portlet.journal.model.JournalArticleResource; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the journal article resource service. This utility wraps {@link JournalArticleResourcePersistenceImpl} 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. 029 * 030 * <p> 031 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 032 * </p> 033 * 034 * <p> 035 * Caching information and settings can be found in <code>portal.properties</code> 036 * </p> 037 * 038 * @author Brian Wing Shun Chan 039 * @see JournalArticleResourcePersistence 040 * @see JournalArticleResourcePersistenceImpl 041 * @generated 042 */ 043 public class JournalArticleResourceUtil { 044 /** 045 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 046 */ 047 public static void clearCache() { 048 getPersistence().clearCache(); 049 } 050 051 /** 052 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 053 */ 054 public static void clearCache(JournalArticleResource journalArticleResource) { 055 getPersistence().clearCache(journalArticleResource); 056 } 057 058 /** 059 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 060 */ 061 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 062 throws SystemException { 063 return getPersistence().countWithDynamicQuery(dynamicQuery); 064 } 065 066 /** 067 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 068 */ 069 public static List<JournalArticleResource> findWithDynamicQuery( 070 DynamicQuery dynamicQuery) throws SystemException { 071 return getPersistence().findWithDynamicQuery(dynamicQuery); 072 } 073 074 /** 075 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 076 */ 077 public static List<JournalArticleResource> findWithDynamicQuery( 078 DynamicQuery dynamicQuery, int start, int end) 079 throws SystemException { 080 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 081 } 082 083 /** 084 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 085 */ 086 public static List<JournalArticleResource> findWithDynamicQuery( 087 DynamicQuery dynamicQuery, int start, int end, 088 OrderByComparator orderByComparator) throws SystemException { 089 return getPersistence() 090 .findWithDynamicQuery(dynamicQuery, start, end, 091 orderByComparator); 092 } 093 094 /** 095 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 096 */ 097 public static JournalArticleResource remove( 098 JournalArticleResource journalArticleResource) 099 throws SystemException { 100 return getPersistence().remove(journalArticleResource); 101 } 102 103 /** 104 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 105 */ 106 public static JournalArticleResource update( 107 JournalArticleResource journalArticleResource, boolean merge) 108 throws SystemException { 109 return getPersistence().update(journalArticleResource, merge); 110 } 111 112 /** 113 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 114 */ 115 public static JournalArticleResource update( 116 JournalArticleResource journalArticleResource, boolean merge, 117 ServiceContext serviceContext) throws SystemException { 118 return getPersistence() 119 .update(journalArticleResource, merge, serviceContext); 120 } 121 122 /** 123 * Caches the journal article resource in the entity cache if it is enabled. 124 * 125 * @param journalArticleResource the journal article resource to cache 126 */ 127 public static void cacheResult( 128 com.liferay.portlet.journal.model.JournalArticleResource journalArticleResource) { 129 getPersistence().cacheResult(journalArticleResource); 130 } 131 132 /** 133 * Caches the journal article resources in the entity cache if it is enabled. 134 * 135 * @param journalArticleResources the journal article resources to cache 136 */ 137 public static void cacheResult( 138 java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> journalArticleResources) { 139 getPersistence().cacheResult(journalArticleResources); 140 } 141 142 /** 143 * Creates a new journal article resource with the primary key. Does not add the journal article resource to the database. 144 * 145 * @param resourcePrimKey the primary key for the new journal article resource 146 * @return the new journal article resource 147 */ 148 public static com.liferay.portlet.journal.model.JournalArticleResource create( 149 long resourcePrimKey) { 150 return getPersistence().create(resourcePrimKey); 151 } 152 153 /** 154 * Removes the journal article resource with the primary key from the database. Also notifies the appropriate model listeners. 155 * 156 * @param resourcePrimKey the primary key of the journal article resource to remove 157 * @return the journal article resource that was removed 158 * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a journal article resource with the primary key could not be found 159 * @throws SystemException if a system exception occurred 160 */ 161 public static com.liferay.portlet.journal.model.JournalArticleResource remove( 162 long resourcePrimKey) 163 throws com.liferay.portal.kernel.exception.SystemException, 164 com.liferay.portlet.journal.NoSuchArticleResourceException { 165 return getPersistence().remove(resourcePrimKey); 166 } 167 168 public static com.liferay.portlet.journal.model.JournalArticleResource updateImpl( 169 com.liferay.portlet.journal.model.JournalArticleResource journalArticleResource, 170 boolean merge) 171 throws com.liferay.portal.kernel.exception.SystemException { 172 return getPersistence().updateImpl(journalArticleResource, merge); 173 } 174 175 /** 176 * Finds the journal article resource with the primary key or throws a {@link com.liferay.portlet.journal.NoSuchArticleResourceException} if it could not be found. 177 * 178 * @param resourcePrimKey the primary key of the journal article resource to find 179 * @return the journal article resource 180 * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a journal article resource with the primary key could not be found 181 * @throws SystemException if a system exception occurred 182 */ 183 public static com.liferay.portlet.journal.model.JournalArticleResource findByPrimaryKey( 184 long resourcePrimKey) 185 throws com.liferay.portal.kernel.exception.SystemException, 186 com.liferay.portlet.journal.NoSuchArticleResourceException { 187 return getPersistence().findByPrimaryKey(resourcePrimKey); 188 } 189 190 /** 191 * Finds the journal article resource with the primary key or returns <code>null</code> if it could not be found. 192 * 193 * @param resourcePrimKey the primary key of the journal article resource to find 194 * @return the journal article resource, or <code>null</code> if a journal article resource with the primary key could not be found 195 * @throws SystemException if a system exception occurred 196 */ 197 public static com.liferay.portlet.journal.model.JournalArticleResource fetchByPrimaryKey( 198 long resourcePrimKey) 199 throws com.liferay.portal.kernel.exception.SystemException { 200 return getPersistence().fetchByPrimaryKey(resourcePrimKey); 201 } 202 203 /** 204 * Finds all the journal article resources where groupId = ?. 205 * 206 * @param groupId the group id to search with 207 * @return the matching journal article resources 208 * @throws SystemException if a system exception occurred 209 */ 210 public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findByGroupId( 211 long groupId) 212 throws com.liferay.portal.kernel.exception.SystemException { 213 return getPersistence().findByGroupId(groupId); 214 } 215 216 /** 217 * Finds a range of all the journal article resources where groupId = ?. 218 * 219 * <p> 220 * 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. 221 * </p> 222 * 223 * @param groupId the group id to search with 224 * @param start the lower bound of the range of journal article resources to return 225 * @param end the upper bound of the range of journal article resources to return (not inclusive) 226 * @return the range of matching journal article resources 227 * @throws SystemException if a system exception occurred 228 */ 229 public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findByGroupId( 230 long groupId, int start, int end) 231 throws com.liferay.portal.kernel.exception.SystemException { 232 return getPersistence().findByGroupId(groupId, start, end); 233 } 234 235 /** 236 * Finds an ordered range of all the journal article resources where groupId = ?. 237 * 238 * <p> 239 * 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. 240 * </p> 241 * 242 * @param groupId the group id to search with 243 * @param start the lower bound of the range of journal article resources to return 244 * @param end the upper bound of the range of journal article resources to return (not inclusive) 245 * @param orderByComparator the comparator to order the results by 246 * @return the ordered range of matching journal article resources 247 * @throws SystemException if a system exception occurred 248 */ 249 public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findByGroupId( 250 long groupId, int start, int end, 251 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 252 throws com.liferay.portal.kernel.exception.SystemException { 253 return getPersistence() 254 .findByGroupId(groupId, start, end, orderByComparator); 255 } 256 257 /** 258 * Finds the first journal article resource in the ordered set where groupId = ?. 259 * 260 * <p> 261 * 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. 262 * </p> 263 * 264 * @param groupId the group id to search with 265 * @param orderByComparator the comparator to order the set by 266 * @return the first matching journal article resource 267 * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a matching journal article resource could not be found 268 * @throws SystemException if a system exception occurred 269 */ 270 public static com.liferay.portlet.journal.model.JournalArticleResource findByGroupId_First( 271 long groupId, 272 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 273 throws com.liferay.portal.kernel.exception.SystemException, 274 com.liferay.portlet.journal.NoSuchArticleResourceException { 275 return getPersistence().findByGroupId_First(groupId, orderByComparator); 276 } 277 278 /** 279 * Finds the last journal article resource in the ordered set where groupId = ?. 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 groupId the group id to search with 286 * @param orderByComparator the comparator to order the set by 287 * @return the last matching journal article resource 288 * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a matching journal article resource could not be found 289 * @throws SystemException if a system exception occurred 290 */ 291 public static com.liferay.portlet.journal.model.JournalArticleResource findByGroupId_Last( 292 long groupId, 293 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 294 throws com.liferay.portal.kernel.exception.SystemException, 295 com.liferay.portlet.journal.NoSuchArticleResourceException { 296 return getPersistence().findByGroupId_Last(groupId, orderByComparator); 297 } 298 299 /** 300 * Finds the journal article resources before and after the current journal article resource in the ordered set where groupId = ?. 301 * 302 * <p> 303 * 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. 304 * </p> 305 * 306 * @param resourcePrimKey the primary key of the current journal article resource 307 * @param groupId the group id to search with 308 * @param orderByComparator the comparator to order the set by 309 * @return the previous, current, and next journal article resource 310 * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a journal article resource with the primary key could not be found 311 * @throws SystemException if a system exception occurred 312 */ 313 public static com.liferay.portlet.journal.model.JournalArticleResource[] findByGroupId_PrevAndNext( 314 long resourcePrimKey, long groupId, 315 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 316 throws com.liferay.portal.kernel.exception.SystemException, 317 com.liferay.portlet.journal.NoSuchArticleResourceException { 318 return getPersistence() 319 .findByGroupId_PrevAndNext(resourcePrimKey, groupId, 320 orderByComparator); 321 } 322 323 /** 324 * Finds the journal article resource where groupId = ? and articleId = ? or throws a {@link com.liferay.portlet.journal.NoSuchArticleResourceException} if it could not be found. 325 * 326 * @param groupId the group id to search with 327 * @param articleId the article id to search with 328 * @return the matching journal article resource 329 * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a matching journal article resource could not be found 330 * @throws SystemException if a system exception occurred 331 */ 332 public static com.liferay.portlet.journal.model.JournalArticleResource findByG_A( 333 long groupId, java.lang.String articleId) 334 throws com.liferay.portal.kernel.exception.SystemException, 335 com.liferay.portlet.journal.NoSuchArticleResourceException { 336 return getPersistence().findByG_A(groupId, articleId); 337 } 338 339 /** 340 * Finds the journal article resource where groupId = ? and articleId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 341 * 342 * @param groupId the group id to search with 343 * @param articleId the article id to search with 344 * @return the matching journal article resource, or <code>null</code> if a matching journal article resource could not be found 345 * @throws SystemException if a system exception occurred 346 */ 347 public static com.liferay.portlet.journal.model.JournalArticleResource fetchByG_A( 348 long groupId, java.lang.String articleId) 349 throws com.liferay.portal.kernel.exception.SystemException { 350 return getPersistence().fetchByG_A(groupId, articleId); 351 } 352 353 /** 354 * Finds the journal article resource where groupId = ? and articleId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 355 * 356 * @param groupId the group id to search with 357 * @param articleId the article id to search with 358 * @return the matching journal article resource, or <code>null</code> if a matching journal article resource could not be found 359 * @throws SystemException if a system exception occurred 360 */ 361 public static com.liferay.portlet.journal.model.JournalArticleResource fetchByG_A( 362 long groupId, java.lang.String articleId, boolean retrieveFromCache) 363 throws com.liferay.portal.kernel.exception.SystemException { 364 return getPersistence().fetchByG_A(groupId, articleId, retrieveFromCache); 365 } 366 367 /** 368 * Finds all the journal article resources. 369 * 370 * @return the journal article resources 371 * @throws SystemException if a system exception occurred 372 */ 373 public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findAll() 374 throws com.liferay.portal.kernel.exception.SystemException { 375 return getPersistence().findAll(); 376 } 377 378 /** 379 * Finds a range of all the journal article resources. 380 * 381 * <p> 382 * 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. 383 * </p> 384 * 385 * @param start the lower bound of the range of journal article resources to return 386 * @param end the upper bound of the range of journal article resources to return (not inclusive) 387 * @return the range of journal article resources 388 * @throws SystemException if a system exception occurred 389 */ 390 public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findAll( 391 int start, int end) 392 throws com.liferay.portal.kernel.exception.SystemException { 393 return getPersistence().findAll(start, end); 394 } 395 396 /** 397 * Finds an ordered range of all the journal article resources. 398 * 399 * <p> 400 * 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. 401 * </p> 402 * 403 * @param start the lower bound of the range of journal article resources to return 404 * @param end the upper bound of the range of journal article resources to return (not inclusive) 405 * @param orderByComparator the comparator to order the results by 406 * @return the ordered range of journal article resources 407 * @throws SystemException if a system exception occurred 408 */ 409 public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findAll( 410 int start, int end, 411 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 412 throws com.liferay.portal.kernel.exception.SystemException { 413 return getPersistence().findAll(start, end, orderByComparator); 414 } 415 416 /** 417 * Removes all the journal article resources where groupId = ? from the database. 418 * 419 * @param groupId the group id to search with 420 * @throws SystemException if a system exception occurred 421 */ 422 public static void removeByGroupId(long groupId) 423 throws com.liferay.portal.kernel.exception.SystemException { 424 getPersistence().removeByGroupId(groupId); 425 } 426 427 /** 428 * Removes the journal article resource where groupId = ? and articleId = ? from the database. 429 * 430 * @param groupId the group id to search with 431 * @param articleId the article id to search with 432 * @throws SystemException if a system exception occurred 433 */ 434 public static void removeByG_A(long groupId, java.lang.String articleId) 435 throws com.liferay.portal.kernel.exception.SystemException, 436 com.liferay.portlet.journal.NoSuchArticleResourceException { 437 getPersistence().removeByG_A(groupId, articleId); 438 } 439 440 /** 441 * Removes all the journal article resources from the database. 442 * 443 * @throws SystemException if a system exception occurred 444 */ 445 public static void removeAll() 446 throws com.liferay.portal.kernel.exception.SystemException { 447 getPersistence().removeAll(); 448 } 449 450 /** 451 * Counts all the journal article resources where groupId = ?. 452 * 453 * @param groupId the group id to search with 454 * @return the number of matching journal article resources 455 * @throws SystemException if a system exception occurred 456 */ 457 public static int countByGroupId(long groupId) 458 throws com.liferay.portal.kernel.exception.SystemException { 459 return getPersistence().countByGroupId(groupId); 460 } 461 462 /** 463 * Counts all the journal article resources where groupId = ? and articleId = ?. 464 * 465 * @param groupId the group id to search with 466 * @param articleId the article id to search with 467 * @return the number of matching journal article resources 468 * @throws SystemException if a system exception occurred 469 */ 470 public static int countByG_A(long groupId, java.lang.String articleId) 471 throws com.liferay.portal.kernel.exception.SystemException { 472 return getPersistence().countByG_A(groupId, articleId); 473 } 474 475 /** 476 * Counts all the journal article resources. 477 * 478 * @return the number of journal article resources 479 * @throws SystemException if a system exception occurred 480 */ 481 public static int countAll() 482 throws com.liferay.portal.kernel.exception.SystemException { 483 return getPersistence().countAll(); 484 } 485 486 public static JournalArticleResourcePersistence getPersistence() { 487 if (_persistence == null) { 488 _persistence = (JournalArticleResourcePersistence)PortalBeanLocatorUtil.locate(JournalArticleResourcePersistence.class.getName()); 489 } 490 491 return _persistence; 492 } 493 494 public void setPersistence(JournalArticleResourcePersistence persistence) { 495 _persistence = persistence; 496 } 497 498 private static JournalArticleResourcePersistence _persistence; 499 }