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