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.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.model.ResourcePermission; 022 import com.liferay.portal.service.ServiceContext; 023 024 import java.util.List; 025 026 /** 027 * The persistence utility for the resource permission service. 028 * 029 * <p> 030 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class. 031 * </p> 032 * 033 * @author Brian Wing Shun Chan 034 * @see ResourcePermissionPersistence 035 * @see ResourcePermissionPersistenceImpl 036 * @generated 037 */ 038 public class ResourcePermissionUtil { 039 /** 040 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 041 */ 042 public static void clearCache() { 043 getPersistence().clearCache(); 044 } 045 046 /** 047 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 048 */ 049 public static void clearCache(ResourcePermission resourcePermission) { 050 getPersistence().clearCache(resourcePermission); 051 } 052 053 /** 054 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 055 */ 056 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 057 throws SystemException { 058 return getPersistence().countWithDynamicQuery(dynamicQuery); 059 } 060 061 /** 062 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 063 */ 064 public static List<ResourcePermission> findWithDynamicQuery( 065 DynamicQuery dynamicQuery) throws SystemException { 066 return getPersistence().findWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 071 */ 072 public static List<ResourcePermission> findWithDynamicQuery( 073 DynamicQuery dynamicQuery, int start, int end) 074 throws SystemException { 075 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 076 } 077 078 /** 079 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 080 */ 081 public static List<ResourcePermission> findWithDynamicQuery( 082 DynamicQuery dynamicQuery, int start, int end, 083 OrderByComparator orderByComparator) throws SystemException { 084 return getPersistence() 085 .findWithDynamicQuery(dynamicQuery, start, end, 086 orderByComparator); 087 } 088 089 /** 090 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 091 */ 092 public static ResourcePermission remove( 093 ResourcePermission resourcePermission) throws SystemException { 094 return getPersistence().remove(resourcePermission); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 099 */ 100 public static ResourcePermission update( 101 ResourcePermission resourcePermission, boolean merge) 102 throws SystemException { 103 return getPersistence().update(resourcePermission, merge); 104 } 105 106 /** 107 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 108 */ 109 public static ResourcePermission update( 110 ResourcePermission resourcePermission, boolean merge, 111 ServiceContext serviceContext) throws SystemException { 112 return getPersistence().update(resourcePermission, merge, serviceContext); 113 } 114 115 /** 116 * Caches the resource permission in the entity cache if it is enabled. 117 * 118 * @param resourcePermission the resource permission to cache 119 */ 120 public static void cacheResult( 121 com.liferay.portal.model.ResourcePermission resourcePermission) { 122 getPersistence().cacheResult(resourcePermission); 123 } 124 125 /** 126 * Caches the resource permissions in the entity cache if it is enabled. 127 * 128 * @param resourcePermissions the resource permissions to cache 129 */ 130 public static void cacheResult( 131 java.util.List<com.liferay.portal.model.ResourcePermission> resourcePermissions) { 132 getPersistence().cacheResult(resourcePermissions); 133 } 134 135 /** 136 * Creates a new resource permission with the primary key. 137 * 138 * @param resourcePermissionId the primary key for the new resource permission 139 * @return the new resource permission 140 */ 141 public static com.liferay.portal.model.ResourcePermission create( 142 long resourcePermissionId) { 143 return getPersistence().create(resourcePermissionId); 144 } 145 146 /** 147 * Removes the resource permission with the primary key from the database. Also notifies the appropriate model listeners. 148 * 149 * @param resourcePermissionId the primary key of the resource permission to remove 150 * @return the resource permission that was removed 151 * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource 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.ResourcePermission remove( 155 long resourcePermissionId) 156 throws com.liferay.portal.NoSuchResourcePermissionException, 157 com.liferay.portal.kernel.exception.SystemException { 158 return getPersistence().remove(resourcePermissionId); 159 } 160 161 public static com.liferay.portal.model.ResourcePermission updateImpl( 162 com.liferay.portal.model.ResourcePermission resourcePermission, 163 boolean merge) 164 throws com.liferay.portal.kernel.exception.SystemException { 165 return getPersistence().updateImpl(resourcePermission, merge); 166 } 167 168 /** 169 * Finds the resource permission with the primary key or throws a {@link com.liferay.portal.NoSuchResourcePermissionException} if it could not be found. 170 * 171 * @param resourcePermissionId the primary key of the resource permission to find 172 * @return the resource permission 173 * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found 174 * @throws SystemException if a system exception occurred 175 */ 176 public static com.liferay.portal.model.ResourcePermission findByPrimaryKey( 177 long resourcePermissionId) 178 throws com.liferay.portal.NoSuchResourcePermissionException, 179 com.liferay.portal.kernel.exception.SystemException { 180 return getPersistence().findByPrimaryKey(resourcePermissionId); 181 } 182 183 /** 184 * Finds the resource permission with the primary key or returns <code>null</code> if it could not be found. 185 * 186 * @param resourcePermissionId the primary key of the resource permission to find 187 * @return the resource permission, or <code>null</code> if a resource permission with the primary key could not be found 188 * @throws SystemException if a system exception occurred 189 */ 190 public static com.liferay.portal.model.ResourcePermission fetchByPrimaryKey( 191 long resourcePermissionId) 192 throws com.liferay.portal.kernel.exception.SystemException { 193 return getPersistence().fetchByPrimaryKey(resourcePermissionId); 194 } 195 196 /** 197 * Finds all the resource permissions where roleId = ?. 198 * 199 * @param roleId the role id to search with 200 * @return the matching resource permissions 201 * @throws SystemException if a system exception occurred 202 */ 203 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId( 204 long roleId) throws com.liferay.portal.kernel.exception.SystemException { 205 return getPersistence().findByRoleId(roleId); 206 } 207 208 /** 209 * Finds a range of all the resource permissions where roleId = ?. 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 roleId the role id to search with 216 * @param start the lower bound of the range of resource permissions to return 217 * @param end the upper bound of the range of resource permissions to return (not inclusive) 218 * @return the range of matching resource permissions 219 * @throws SystemException if a system exception occurred 220 */ 221 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId( 222 long roleId, int start, int end) 223 throws com.liferay.portal.kernel.exception.SystemException { 224 return getPersistence().findByRoleId(roleId, start, end); 225 } 226 227 /** 228 * Finds an ordered range of all the resource permissions where roleId = ?. 229 * 230 * <p> 231 * 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. 232 * </p> 233 * 234 * @param roleId the role id to search with 235 * @param start the lower bound of the range of resource permissions to return 236 * @param end the upper bound of the range of resource permissions to return (not inclusive) 237 * @param orderByComparator the comparator to order the results by 238 * @return the ordered range of matching resource permissions 239 * @throws SystemException if a system exception occurred 240 */ 241 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId( 242 long roleId, int start, int end, 243 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 244 throws com.liferay.portal.kernel.exception.SystemException { 245 return getPersistence() 246 .findByRoleId(roleId, start, end, orderByComparator); 247 } 248 249 /** 250 * Finds the first resource permission in the ordered set where roleId = ?. 251 * 252 * <p> 253 * 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. 254 * </p> 255 * 256 * @param roleId the role id to search with 257 * @param orderByComparator the comparator to order the set by 258 * @return the first matching resource permission 259 * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found 260 * @throws SystemException if a system exception occurred 261 */ 262 public static com.liferay.portal.model.ResourcePermission findByRoleId_First( 263 long roleId, 264 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 265 throws com.liferay.portal.NoSuchResourcePermissionException, 266 com.liferay.portal.kernel.exception.SystemException { 267 return getPersistence().findByRoleId_First(roleId, orderByComparator); 268 } 269 270 /** 271 * Finds the last resource permission in the ordered set where roleId = ?. 272 * 273 * <p> 274 * 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. 275 * </p> 276 * 277 * @param roleId the role id to search with 278 * @param orderByComparator the comparator to order the set by 279 * @return the last matching resource permission 280 * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found 281 * @throws SystemException if a system exception occurred 282 */ 283 public static com.liferay.portal.model.ResourcePermission findByRoleId_Last( 284 long roleId, 285 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 286 throws com.liferay.portal.NoSuchResourcePermissionException, 287 com.liferay.portal.kernel.exception.SystemException { 288 return getPersistence().findByRoleId_Last(roleId, orderByComparator); 289 } 290 291 /** 292 * Finds the resource permissions before and after the current resource permission in the ordered set where roleId = ?. 293 * 294 * <p> 295 * 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. 296 * </p> 297 * 298 * @param resourcePermissionId the primary key of the current resource permission 299 * @param roleId the role id to search with 300 * @param orderByComparator the comparator to order the set by 301 * @return the previous, current, and next resource permission 302 * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found 303 * @throws SystemException if a system exception occurred 304 */ 305 public static com.liferay.portal.model.ResourcePermission[] findByRoleId_PrevAndNext( 306 long resourcePermissionId, long roleId, 307 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 308 throws com.liferay.portal.NoSuchResourcePermissionException, 309 com.liferay.portal.kernel.exception.SystemException { 310 return getPersistence() 311 .findByRoleId_PrevAndNext(resourcePermissionId, roleId, 312 orderByComparator); 313 } 314 315 /** 316 * Finds all the resource permissions where roleId = ? and scope = ?. 317 * 318 * @param roleId the role id to search with 319 * @param scope the scope to search with 320 * @return the matching resource permissions 321 * @throws SystemException if a system exception occurred 322 */ 323 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S( 324 long roleId, int scope) 325 throws com.liferay.portal.kernel.exception.SystemException { 326 return getPersistence().findByR_S(roleId, scope); 327 } 328 329 /** 330 * Finds a range of all the resource permissions where roleId = ? and scope = ?. 331 * 332 * <p> 333 * 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. 334 * </p> 335 * 336 * @param roleId the role id to search with 337 * @param scope the scope to search with 338 * @param start the lower bound of the range of resource permissions to return 339 * @param end the upper bound of the range of resource permissions to return (not inclusive) 340 * @return the range of matching resource permissions 341 * @throws SystemException if a system exception occurred 342 */ 343 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S( 344 long roleId, int scope, int start, int end) 345 throws com.liferay.portal.kernel.exception.SystemException { 346 return getPersistence().findByR_S(roleId, scope, start, end); 347 } 348 349 /** 350 * Finds an ordered range of all the resource permissions where roleId = ? and scope = ?. 351 * 352 * <p> 353 * 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. 354 * </p> 355 * 356 * @param roleId the role id to search with 357 * @param scope the scope to search with 358 * @param start the lower bound of the range of resource permissions to return 359 * @param end the upper bound of the range of resource permissions to return (not inclusive) 360 * @param orderByComparator the comparator to order the results by 361 * @return the ordered range of matching resource permissions 362 * @throws SystemException if a system exception occurred 363 */ 364 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S( 365 long roleId, int scope, int start, int end, 366 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 367 throws com.liferay.portal.kernel.exception.SystemException { 368 return getPersistence() 369 .findByR_S(roleId, scope, start, end, orderByComparator); 370 } 371 372 /** 373 * Finds the first resource permission in the ordered set where roleId = ? and scope = ?. 374 * 375 * <p> 376 * 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. 377 * </p> 378 * 379 * @param roleId the role id to search with 380 * @param scope the scope to search with 381 * @param orderByComparator the comparator to order the set by 382 * @return the first matching resource permission 383 * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found 384 * @throws SystemException if a system exception occurred 385 */ 386 public static com.liferay.portal.model.ResourcePermission findByR_S_First( 387 long roleId, int scope, 388 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 389 throws com.liferay.portal.NoSuchResourcePermissionException, 390 com.liferay.portal.kernel.exception.SystemException { 391 return getPersistence().findByR_S_First(roleId, scope, orderByComparator); 392 } 393 394 /** 395 * Finds the last resource permission in the ordered set where roleId = ? and scope = ?. 396 * 397 * <p> 398 * 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. 399 * </p> 400 * 401 * @param roleId the role id to search with 402 * @param scope the scope to search with 403 * @param orderByComparator the comparator to order the set by 404 * @return the last matching resource permission 405 * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found 406 * @throws SystemException if a system exception occurred 407 */ 408 public static com.liferay.portal.model.ResourcePermission findByR_S_Last( 409 long roleId, int scope, 410 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 411 throws com.liferay.portal.NoSuchResourcePermissionException, 412 com.liferay.portal.kernel.exception.SystemException { 413 return getPersistence().findByR_S_Last(roleId, scope, orderByComparator); 414 } 415 416 /** 417 * Finds the resource permissions before and after the current resource permission in the ordered set where roleId = ? and scope = ?. 418 * 419 * <p> 420 * 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. 421 * </p> 422 * 423 * @param resourcePermissionId the primary key of the current resource permission 424 * @param roleId the role id to search with 425 * @param scope the scope to search with 426 * @param orderByComparator the comparator to order the set by 427 * @return the previous, current, and next resource permission 428 * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found 429 * @throws SystemException if a system exception occurred 430 */ 431 public static com.liferay.portal.model.ResourcePermission[] findByR_S_PrevAndNext( 432 long resourcePermissionId, long roleId, int scope, 433 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 434 throws com.liferay.portal.NoSuchResourcePermissionException, 435 com.liferay.portal.kernel.exception.SystemException { 436 return getPersistence() 437 .findByR_S_PrevAndNext(resourcePermissionId, roleId, scope, 438 orderByComparator); 439 } 440 441 /** 442 * Finds all the resource permissions where companyId = ? and name = ? and scope = ?. 443 * 444 * @param companyId the company id to search with 445 * @param name the name to search with 446 * @param scope the scope to search with 447 * @return the matching resource permissions 448 * @throws SystemException if a system exception occurred 449 */ 450 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S( 451 long companyId, java.lang.String name, int scope) 452 throws com.liferay.portal.kernel.exception.SystemException { 453 return getPersistence().findByC_N_S(companyId, name, scope); 454 } 455 456 /** 457 * Finds a range of all the resource permissions where companyId = ? and name = ? and scope = ?. 458 * 459 * <p> 460 * 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. 461 * </p> 462 * 463 * @param companyId the company id to search with 464 * @param name the name to search with 465 * @param scope the scope to search with 466 * @param start the lower bound of the range of resource permissions to return 467 * @param end the upper bound of the range of resource permissions to return (not inclusive) 468 * @return the range of matching resource permissions 469 * @throws SystemException if a system exception occurred 470 */ 471 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S( 472 long companyId, java.lang.String name, int scope, int start, int end) 473 throws com.liferay.portal.kernel.exception.SystemException { 474 return getPersistence().findByC_N_S(companyId, name, scope, start, end); 475 } 476 477 /** 478 * Finds an ordered range of all the resource permissions where companyId = ? and name = ? and scope = ?. 479 * 480 * <p> 481 * 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. 482 * </p> 483 * 484 * @param companyId the company id to search with 485 * @param name the name to search with 486 * @param scope the scope to search with 487 * @param start the lower bound of the range of resource permissions to return 488 * @param end the upper bound of the range of resource permissions to return (not inclusive) 489 * @param orderByComparator the comparator to order the results by 490 * @return the ordered range of matching resource permissions 491 * @throws SystemException if a system exception occurred 492 */ 493 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S( 494 long companyId, java.lang.String name, int scope, int start, int end, 495 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 496 throws com.liferay.portal.kernel.exception.SystemException { 497 return getPersistence() 498 .findByC_N_S(companyId, name, scope, start, end, 499 orderByComparator); 500 } 501 502 /** 503 * Finds the first resource permission in the ordered set where companyId = ? and name = ? and scope = ?. 504 * 505 * <p> 506 * 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. 507 * </p> 508 * 509 * @param companyId the company id to search with 510 * @param name the name to search with 511 * @param scope the scope to search with 512 * @param orderByComparator the comparator to order the set by 513 * @return the first matching resource permission 514 * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found 515 * @throws SystemException if a system exception occurred 516 */ 517 public static com.liferay.portal.model.ResourcePermission findByC_N_S_First( 518 long companyId, java.lang.String name, int scope, 519 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 520 throws com.liferay.portal.NoSuchResourcePermissionException, 521 com.liferay.portal.kernel.exception.SystemException { 522 return getPersistence() 523 .findByC_N_S_First(companyId, name, scope, orderByComparator); 524 } 525 526 /** 527 * Finds the last resource permission in the ordered set where companyId = ? and name = ? and scope = ?. 528 * 529 * <p> 530 * 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. 531 * </p> 532 * 533 * @param companyId the company id to search with 534 * @param name the name to search with 535 * @param scope the scope to search with 536 * @param orderByComparator the comparator to order the set by 537 * @return the last matching resource permission 538 * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found 539 * @throws SystemException if a system exception occurred 540 */ 541 public static com.liferay.portal.model.ResourcePermission findByC_N_S_Last( 542 long companyId, java.lang.String name, int scope, 543 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 544 throws com.liferay.portal.NoSuchResourcePermissionException, 545 com.liferay.portal.kernel.exception.SystemException { 546 return getPersistence() 547 .findByC_N_S_Last(companyId, name, scope, orderByComparator); 548 } 549 550 /** 551 * Finds the resource permissions before and after the current resource permission in the ordered set where companyId = ? and name = ? and scope = ?. 552 * 553 * <p> 554 * 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. 555 * </p> 556 * 557 * @param resourcePermissionId the primary key of the current resource permission 558 * @param companyId the company id to search with 559 * @param name the name to search with 560 * @param scope the scope to search with 561 * @param orderByComparator the comparator to order the set by 562 * @return the previous, current, and next resource permission 563 * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found 564 * @throws SystemException if a system exception occurred 565 */ 566 public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_PrevAndNext( 567 long resourcePermissionId, long companyId, java.lang.String name, 568 int scope, 569 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 570 throws com.liferay.portal.NoSuchResourcePermissionException, 571 com.liferay.portal.kernel.exception.SystemException { 572 return getPersistence() 573 .findByC_N_S_PrevAndNext(resourcePermissionId, companyId, 574 name, scope, orderByComparator); 575 } 576 577 /** 578 * Finds all the resource permissions where companyId = ? and name = ? and scope = ? and primKey = ?. 579 * 580 * @param companyId the company id to search with 581 * @param name the name to search with 582 * @param scope the scope to search with 583 * @param primKey the prim key to search with 584 * @return the matching resource permissions 585 * @throws SystemException if a system exception occurred 586 */ 587 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P( 588 long companyId, java.lang.String name, int scope, 589 java.lang.String primKey) 590 throws com.liferay.portal.kernel.exception.SystemException { 591 return getPersistence().findByC_N_S_P(companyId, name, scope, primKey); 592 } 593 594 /** 595 * Finds a range of all the resource permissions where companyId = ? and name = ? and scope = ? and primKey = ?. 596 * 597 * <p> 598 * 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. 599 * </p> 600 * 601 * @param companyId the company id to search with 602 * @param name the name to search with 603 * @param scope the scope to search with 604 * @param primKey the prim key to search with 605 * @param start the lower bound of the range of resource permissions to return 606 * @param end the upper bound of the range of resource permissions to return (not inclusive) 607 * @return the range of matching resource permissions 608 * @throws SystemException if a system exception occurred 609 */ 610 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P( 611 long companyId, java.lang.String name, int scope, 612 java.lang.String primKey, int start, int end) 613 throws com.liferay.portal.kernel.exception.SystemException { 614 return getPersistence() 615 .findByC_N_S_P(companyId, name, scope, primKey, start, end); 616 } 617 618 /** 619 * Finds an ordered range of all the resource permissions where companyId = ? and name = ? and scope = ? and primKey = ?. 620 * 621 * <p> 622 * 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. 623 * </p> 624 * 625 * @param companyId the company id to search with 626 * @param name the name to search with 627 * @param scope the scope to search with 628 * @param primKey the prim key to search with 629 * @param start the lower bound of the range of resource permissions to return 630 * @param end the upper bound of the range of resource permissions to return (not inclusive) 631 * @param orderByComparator the comparator to order the results by 632 * @return the ordered range of matching resource permissions 633 * @throws SystemException if a system exception occurred 634 */ 635 public static java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P( 636 long companyId, java.lang.String name, int scope, 637 java.lang.String primKey, int start, int end, 638 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 639 throws com.liferay.portal.kernel.exception.SystemException { 640 return getPersistence() 641 .findByC_N_S_P(companyId, name, scope, primKey, start, end, 642 orderByComparator); 643 } 644 645 /** 646 * Finds the first resource permission in the ordered set where companyId = ? and name = ? and scope = ? and primKey = ?. 647 * 648 * <p> 649 * 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. 650 * </p> 651 * 652 * @param companyId the company id to search with 653 * @param name the name to search with 654 * @param scope the scope to search with 655 * @param primKey the prim key to search with 656 * @param orderByComparator the comparator to order the set by 657 * @return the first matching resource permission 658 * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found 659 * @throws SystemException if a system exception occurred 660 */ 661 public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_First( 662 long companyId, java.lang.String name, int scope, 663 java.lang.String primKey, 664 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 665 throws com.liferay.portal.NoSuchResourcePermissionException, 666 com.liferay.portal.kernel.exception.SystemException { 667 return getPersistence() 668 .findByC_N_S_P_First(companyId, name, scope, primKey, 669 orderByComparator); 670 } 671 672 /** 673 * Finds the last resource permission in the ordered set where companyId = ? and name = ? and scope = ? and primKey = ?. 674 * 675 * <p> 676 * 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. 677 * </p> 678 * 679 * @param companyId the company id to search with 680 * @param name the name to search with 681 * @param scope the scope to search with 682 * @param primKey the prim key to search with 683 * @param orderByComparator the comparator to order the set by 684 * @return the last matching resource permission 685 * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found 686 * @throws SystemException if a system exception occurred 687 */ 688 public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_Last( 689 long companyId, java.lang.String name, int scope, 690 java.lang.String primKey, 691 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 692 throws com.liferay.portal.NoSuchResourcePermissionException, 693 com.liferay.portal.kernel.exception.SystemException { 694 return getPersistence() 695 .findByC_N_S_P_Last(companyId, name, scope, primKey, 696 orderByComparator); 697 } 698 699 /** 700 * Finds the resource permissions before and after the current resource permission in the ordered set where companyId = ? and name = ? and scope = ? and primKey = ?. 701 * 702 * <p> 703 * 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. 704 * </p> 705 * 706 * @param resourcePermissionId the primary key of the current resource permission 707 * @param companyId the company id to search with 708 * @param name the name to search with 709 * @param scope the scope to search with 710 * @param primKey the prim key to search with 711 * @param orderByComparator the comparator to order the set by 712 * @return the previous, current, and next resource permission 713 * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found 714 * @throws SystemException if a system exception occurred 715 */ 716 public static com.liferay.portal.model.ResourcePermission[] findByC_N_S_P_PrevAndNext( 717 long resourcePermissionId, long companyId, java.lang.String name, 718 int scope, java.lang.String primKey, 719 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 720 throws com.liferay.portal.NoSuchResourcePermissionException, 721 com.liferay.portal.kernel.exception.SystemException { 722 return getPersistence() 723 .findByC_N_S_P_PrevAndNext(resourcePermissionId, companyId, 724 name, scope, primKey, orderByComparator); 725 } 726 727 /** 728 * Finds the resource permission where companyId = ? and name = ? and scope = ? and primKey = ? and roleId = ? or throws a {@link com.liferay.portal.NoSuchResourcePermissionException} if it could not be found. 729 * 730 * @param companyId the company id to search with 731 * @param name the name to search with 732 * @param scope the scope to search with 733 * @param primKey the prim key to search with 734 * @param roleId the role id to search with 735 * @return the matching resource permission 736 * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found 737 * @throws SystemException if a system exception occurred 738 */ 739 public static com.liferay.portal.model.ResourcePermission findByC_N_S_P_R( 740 long companyId, java.lang.String name, int scope, 741 java.lang.String primKey, long roleId) 742 throws com.liferay.portal.NoSuchResourcePermissionException, 743 com.liferay.portal.kernel.exception.SystemException { 744 return getPersistence() 745 .findByC_N_S_P_R(companyId, name, scope, primKey, roleId); 746 } 747 748 /** 749 * Finds the resource permission where companyId = ? and name = ? and scope = ? and primKey = ? and roleId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 750 * 751 * @param companyId the company id to search with 752 * @param name the name to search with 753 * @param scope the scope to search with 754 * @param primKey the prim key to search with 755 * @param roleId the role id to search with 756 * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found 757 * @throws SystemException if a system exception occurred 758 */ 759 public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R( 760 long companyId, java.lang.String name, int scope, 761 java.lang.String primKey, long roleId) 762 throws com.liferay.portal.kernel.exception.SystemException { 763 return getPersistence() 764 .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId); 765 } 766 767 /** 768 * Finds the resource permission where companyId = ? and name = ? and scope = ? and primKey = ? and roleId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 769 * 770 * @param companyId the company id to search with 771 * @param name the name to search with 772 * @param scope the scope to search with 773 * @param primKey the prim key to search with 774 * @param roleId the role id to search with 775 * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found 776 * @throws SystemException if a system exception occurred 777 */ 778 public static com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R( 779 long companyId, java.lang.String name, int scope, 780 java.lang.String primKey, long roleId, boolean retrieveFromCache) 781 throws com.liferay.portal.kernel.exception.SystemException { 782 return getPersistence() 783 .fetchByC_N_S_P_R(companyId, name, scope, primKey, roleId, 784 retrieveFromCache); 785 } 786 787 /** 788 * Finds all the resource permissions. 789 * 790 * @return the resource permissions 791 * @throws SystemException if a system exception occurred 792 */ 793 public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll() 794 throws com.liferay.portal.kernel.exception.SystemException { 795 return getPersistence().findAll(); 796 } 797 798 /** 799 * Finds a range of all the resource permissions. 800 * 801 * <p> 802 * 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. 803 * </p> 804 * 805 * @param start the lower bound of the range of resource permissions to return 806 * @param end the upper bound of the range of resource permissions to return (not inclusive) 807 * @return the range of resource permissions 808 * @throws SystemException if a system exception occurred 809 */ 810 public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll( 811 int start, int end) 812 throws com.liferay.portal.kernel.exception.SystemException { 813 return getPersistence().findAll(start, end); 814 } 815 816 /** 817 * Finds an ordered range of all the resource permissions. 818 * 819 * <p> 820 * 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. 821 * </p> 822 * 823 * @param start the lower bound of the range of resource permissions to return 824 * @param end the upper bound of the range of resource permissions to return (not inclusive) 825 * @param orderByComparator the comparator to order the results by 826 * @return the ordered range of resource permissions 827 * @throws SystemException if a system exception occurred 828 */ 829 public static java.util.List<com.liferay.portal.model.ResourcePermission> findAll( 830 int start, int end, 831 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 832 throws com.liferay.portal.kernel.exception.SystemException { 833 return getPersistence().findAll(start, end, orderByComparator); 834 } 835 836 /** 837 * Removes all the resource permissions where roleId = ? from the database. 838 * 839 * @param roleId the role id to search with 840 * @throws SystemException if a system exception occurred 841 */ 842 public static void removeByRoleId(long roleId) 843 throws com.liferay.portal.kernel.exception.SystemException { 844 getPersistence().removeByRoleId(roleId); 845 } 846 847 /** 848 * Removes all the resource permissions where roleId = ? and scope = ? from the database. 849 * 850 * @param roleId the role id to search with 851 * @param scope the scope to search with 852 * @throws SystemException if a system exception occurred 853 */ 854 public static void removeByR_S(long roleId, int scope) 855 throws com.liferay.portal.kernel.exception.SystemException { 856 getPersistence().removeByR_S(roleId, scope); 857 } 858 859 /** 860 * Removes all the resource permissions where companyId = ? and name = ? and scope = ? from the database. 861 * 862 * @param companyId the company id to search with 863 * @param name the name to search with 864 * @param scope the scope to search with 865 * @throws SystemException if a system exception occurred 866 */ 867 public static void removeByC_N_S(long companyId, java.lang.String name, 868 int scope) throws com.liferay.portal.kernel.exception.SystemException { 869 getPersistence().removeByC_N_S(companyId, name, scope); 870 } 871 872 /** 873 * Removes all the resource permissions where companyId = ? and name = ? and scope = ? and primKey = ? from the database. 874 * 875 * @param companyId the company id to search with 876 * @param name the name to search with 877 * @param scope the scope to search with 878 * @param primKey the prim key to search with 879 * @throws SystemException if a system exception occurred 880 */ 881 public static void removeByC_N_S_P(long companyId, java.lang.String name, 882 int scope, java.lang.String primKey) 883 throws com.liferay.portal.kernel.exception.SystemException { 884 getPersistence().removeByC_N_S_P(companyId, name, scope, primKey); 885 } 886 887 /** 888 * Removes the resource permission where companyId = ? and name = ? and scope = ? and primKey = ? and roleId = ? from the database. 889 * 890 * @param companyId the company id to search with 891 * @param name the name to search with 892 * @param scope the scope to search with 893 * @param primKey the prim key to search with 894 * @param roleId the role id to search with 895 * @throws SystemException if a system exception occurred 896 */ 897 public static void removeByC_N_S_P_R(long companyId, java.lang.String name, 898 int scope, java.lang.String primKey, long roleId) 899 throws com.liferay.portal.NoSuchResourcePermissionException, 900 com.liferay.portal.kernel.exception.SystemException { 901 getPersistence() 902 .removeByC_N_S_P_R(companyId, name, scope, primKey, roleId); 903 } 904 905 /** 906 * Removes all the resource permissions from the database. 907 * 908 * @throws SystemException if a system exception occurred 909 */ 910 public static void removeAll() 911 throws com.liferay.portal.kernel.exception.SystemException { 912 getPersistence().removeAll(); 913 } 914 915 /** 916 * Counts all the resource permissions where roleId = ?. 917 * 918 * @param roleId the role id to search with 919 * @return the number of matching resource permissions 920 * @throws SystemException if a system exception occurred 921 */ 922 public static int countByRoleId(long roleId) 923 throws com.liferay.portal.kernel.exception.SystemException { 924 return getPersistence().countByRoleId(roleId); 925 } 926 927 /** 928 * Counts all the resource permissions where roleId = ? and scope = ?. 929 * 930 * @param roleId the role id to search with 931 * @param scope the scope to search with 932 * @return the number of matching resource permissions 933 * @throws SystemException if a system exception occurred 934 */ 935 public static int countByR_S(long roleId, int scope) 936 throws com.liferay.portal.kernel.exception.SystemException { 937 return getPersistence().countByR_S(roleId, scope); 938 } 939 940 /** 941 * Counts all the resource permissions where companyId = ? and name = ? and scope = ?. 942 * 943 * @param companyId the company id to search with 944 * @param name the name to search with 945 * @param scope the scope to search with 946 * @return the number of matching resource permissions 947 * @throws SystemException if a system exception occurred 948 */ 949 public static int countByC_N_S(long companyId, java.lang.String name, 950 int scope) throws com.liferay.portal.kernel.exception.SystemException { 951 return getPersistence().countByC_N_S(companyId, name, scope); 952 } 953 954 /** 955 * Counts all the resource permissions where companyId = ? and name = ? and scope = ? and primKey = ?. 956 * 957 * @param companyId the company id to search with 958 * @param name the name to search with 959 * @param scope the scope to search with 960 * @param primKey the prim key to search with 961 * @return the number of matching resource permissions 962 * @throws SystemException if a system exception occurred 963 */ 964 public static int countByC_N_S_P(long companyId, java.lang.String name, 965 int scope, java.lang.String primKey) 966 throws com.liferay.portal.kernel.exception.SystemException { 967 return getPersistence().countByC_N_S_P(companyId, name, scope, primKey); 968 } 969 970 /** 971 * Counts all the resource permissions where companyId = ? and name = ? and scope = ? and primKey = ? and roleId = ?. 972 * 973 * @param companyId the company id to search with 974 * @param name the name to search with 975 * @param scope the scope to search with 976 * @param primKey the prim key to search with 977 * @param roleId the role id to search with 978 * @return the number of matching resource permissions 979 * @throws SystemException if a system exception occurred 980 */ 981 public static int countByC_N_S_P_R(long companyId, java.lang.String name, 982 int scope, java.lang.String primKey, long roleId) 983 throws com.liferay.portal.kernel.exception.SystemException { 984 return getPersistence() 985 .countByC_N_S_P_R(companyId, name, scope, primKey, roleId); 986 } 987 988 /** 989 * Counts all the resource permissions. 990 * 991 * @return the number of resource permissions 992 * @throws SystemException if a system exception occurred 993 */ 994 public static int countAll() 995 throws com.liferay.portal.kernel.exception.SystemException { 996 return getPersistence().countAll(); 997 } 998 999 public static ResourcePermissionPersistence getPersistence() { 1000 if (_persistence == null) { 1001 _persistence = (ResourcePermissionPersistence)PortalBeanLocatorUtil.locate(ResourcePermissionPersistence.class.getName()); 1002 } 1003 1004 return _persistence; 1005 } 1006 1007 public void setPersistence(ResourcePermissionPersistence persistence) { 1008 _persistence = persistence; 1009 } 1010 1011 private static ResourcePermissionPersistence _persistence; 1012 }