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