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