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.Permission; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the permission service. This utility wraps {@link PermissionPersistenceImpl} 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 PermissionPersistence 036 * @see PermissionPersistenceImpl 037 * @generated 038 */ 039 public class PermissionUtil { 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(Permission permission) { 057 getPersistence().clearCache(permission); 058 } 059 060 /** 061 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 062 */ 063 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 064 throws SystemException { 065 return getPersistence().countWithDynamicQuery(dynamicQuery); 066 } 067 068 /** 069 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 070 */ 071 public static List<Permission> findWithDynamicQuery( 072 DynamicQuery dynamicQuery) throws SystemException { 073 return getPersistence().findWithDynamicQuery(dynamicQuery); 074 } 075 076 /** 077 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 078 */ 079 public static List<Permission> findWithDynamicQuery( 080 DynamicQuery dynamicQuery, int start, int end) 081 throws SystemException { 082 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 083 } 084 085 /** 086 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 087 */ 088 public static List<Permission> findWithDynamicQuery( 089 DynamicQuery dynamicQuery, int start, int end, 090 OrderByComparator orderByComparator) throws SystemException { 091 return getPersistence() 092 .findWithDynamicQuery(dynamicQuery, start, end, 093 orderByComparator); 094 } 095 096 /** 097 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 098 */ 099 public static Permission remove(Permission permission) 100 throws SystemException { 101 return getPersistence().remove(permission); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 106 */ 107 public static Permission update(Permission permission, boolean merge) 108 throws SystemException { 109 return getPersistence().update(permission, merge); 110 } 111 112 /** 113 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 114 */ 115 public static Permission update(Permission permission, boolean merge, 116 ServiceContext serviceContext) throws SystemException { 117 return getPersistence().update(permission, merge, serviceContext); 118 } 119 120 /** 121 * Caches the permission in the entity cache if it is enabled. 122 * 123 * @param permission the permission to cache 124 */ 125 public static void cacheResult( 126 com.liferay.portal.model.Permission permission) { 127 getPersistence().cacheResult(permission); 128 } 129 130 /** 131 * Caches the permissions in the entity cache if it is enabled. 132 * 133 * @param permissions the permissions to cache 134 */ 135 public static void cacheResult( 136 java.util.List<com.liferay.portal.model.Permission> permissions) { 137 getPersistence().cacheResult(permissions); 138 } 139 140 /** 141 * Creates a new permission with the primary key. Does not add the permission to the database. 142 * 143 * @param permissionId the primary key for the new permission 144 * @return the new permission 145 */ 146 public static com.liferay.portal.model.Permission create(long permissionId) { 147 return getPersistence().create(permissionId); 148 } 149 150 /** 151 * Removes the permission with the primary key from the database. Also notifies the appropriate model listeners. 152 * 153 * @param permissionId the primary key of the permission to remove 154 * @return the permission that was removed 155 * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found 156 * @throws SystemException if a system exception occurred 157 */ 158 public static com.liferay.portal.model.Permission remove(long permissionId) 159 throws com.liferay.portal.NoSuchPermissionException, 160 com.liferay.portal.kernel.exception.SystemException { 161 return getPersistence().remove(permissionId); 162 } 163 164 public static com.liferay.portal.model.Permission updateImpl( 165 com.liferay.portal.model.Permission permission, boolean merge) 166 throws com.liferay.portal.kernel.exception.SystemException { 167 return getPersistence().updateImpl(permission, merge); 168 } 169 170 /** 171 * Finds the permission with the primary key or throws a {@link com.liferay.portal.NoSuchPermissionException} if it could not be found. 172 * 173 * @param permissionId the primary key of the permission to find 174 * @return the permission 175 * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found 176 * @throws SystemException if a system exception occurred 177 */ 178 public static com.liferay.portal.model.Permission findByPrimaryKey( 179 long permissionId) 180 throws com.liferay.portal.NoSuchPermissionException, 181 com.liferay.portal.kernel.exception.SystemException { 182 return getPersistence().findByPrimaryKey(permissionId); 183 } 184 185 /** 186 * Finds the permission with the primary key or returns <code>null</code> if it could not be found. 187 * 188 * @param permissionId the primary key of the permission to find 189 * @return the permission, or <code>null</code> if a permission with the primary key could not be found 190 * @throws SystemException if a system exception occurred 191 */ 192 public static com.liferay.portal.model.Permission fetchByPrimaryKey( 193 long permissionId) 194 throws com.liferay.portal.kernel.exception.SystemException { 195 return getPersistence().fetchByPrimaryKey(permissionId); 196 } 197 198 /** 199 * Finds all the permissions where resourceId = ?. 200 * 201 * @param resourceId the resource ID to search with 202 * @return the matching permissions 203 * @throws SystemException if a system exception occurred 204 */ 205 public static java.util.List<com.liferay.portal.model.Permission> findByResourceId( 206 long resourceId) 207 throws com.liferay.portal.kernel.exception.SystemException { 208 return getPersistence().findByResourceId(resourceId); 209 } 210 211 /** 212 * Finds a range of all the permissions where resourceId = ?. 213 * 214 * <p> 215 * 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. 216 * </p> 217 * 218 * @param resourceId the resource ID to search with 219 * @param start the lower bound of the range of permissions to return 220 * @param end the upper bound of the range of permissions to return (not inclusive) 221 * @return the range of matching permissions 222 * @throws SystemException if a system exception occurred 223 */ 224 public static java.util.List<com.liferay.portal.model.Permission> findByResourceId( 225 long resourceId, int start, int end) 226 throws com.liferay.portal.kernel.exception.SystemException { 227 return getPersistence().findByResourceId(resourceId, start, end); 228 } 229 230 /** 231 * Finds an ordered range of all the permissions where resourceId = ?. 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 resourceId the resource ID to search with 238 * @param start the lower bound of the range of permissions to return 239 * @param end the upper bound of the range of permissions to return (not inclusive) 240 * @param orderByComparator the comparator to order the results by 241 * @return the ordered range of matching permissions 242 * @throws SystemException if a system exception occurred 243 */ 244 public static java.util.List<com.liferay.portal.model.Permission> findByResourceId( 245 long resourceId, int start, int end, 246 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 247 throws com.liferay.portal.kernel.exception.SystemException { 248 return getPersistence() 249 .findByResourceId(resourceId, start, end, orderByComparator); 250 } 251 252 /** 253 * Finds the first permission in the ordered set where resourceId = ?. 254 * 255 * <p> 256 * 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. 257 * </p> 258 * 259 * @param resourceId the resource ID to search with 260 * @param orderByComparator the comparator to order the set by 261 * @return the first matching permission 262 * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found 263 * @throws SystemException if a system exception occurred 264 */ 265 public static com.liferay.portal.model.Permission findByResourceId_First( 266 long resourceId, 267 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 268 throws com.liferay.portal.NoSuchPermissionException, 269 com.liferay.portal.kernel.exception.SystemException { 270 return getPersistence() 271 .findByResourceId_First(resourceId, orderByComparator); 272 } 273 274 /** 275 * Finds the last permission in the ordered set where resourceId = ?. 276 * 277 * <p> 278 * 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. 279 * </p> 280 * 281 * @param resourceId the resource ID to search with 282 * @param orderByComparator the comparator to order the set by 283 * @return the last matching permission 284 * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found 285 * @throws SystemException if a system exception occurred 286 */ 287 public static com.liferay.portal.model.Permission findByResourceId_Last( 288 long resourceId, 289 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 290 throws com.liferay.portal.NoSuchPermissionException, 291 com.liferay.portal.kernel.exception.SystemException { 292 return getPersistence() 293 .findByResourceId_Last(resourceId, orderByComparator); 294 } 295 296 /** 297 * Finds the permissions before and after the current permission in the ordered set where resourceId = ?. 298 * 299 * <p> 300 * 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. 301 * </p> 302 * 303 * @param permissionId the primary key of the current permission 304 * @param resourceId the resource ID to search with 305 * @param orderByComparator the comparator to order the set by 306 * @return the previous, current, and next permission 307 * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found 308 * @throws SystemException if a system exception occurred 309 */ 310 public static com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext( 311 long permissionId, long resourceId, 312 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 313 throws com.liferay.portal.NoSuchPermissionException, 314 com.liferay.portal.kernel.exception.SystemException { 315 return getPersistence() 316 .findByResourceId_PrevAndNext(permissionId, resourceId, 317 orderByComparator); 318 } 319 320 /** 321 * Finds the permission where actionId = ? and resourceId = ? or throws a {@link com.liferay.portal.NoSuchPermissionException} if it could not be found. 322 * 323 * @param actionId the action ID to search with 324 * @param resourceId the resource ID to search with 325 * @return the matching permission 326 * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found 327 * @throws SystemException if a system exception occurred 328 */ 329 public static com.liferay.portal.model.Permission findByA_R( 330 java.lang.String actionId, long resourceId) 331 throws com.liferay.portal.NoSuchPermissionException, 332 com.liferay.portal.kernel.exception.SystemException { 333 return getPersistence().findByA_R(actionId, resourceId); 334 } 335 336 /** 337 * Finds the permission where actionId = ? and resourceId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 338 * 339 * @param actionId the action ID to search with 340 * @param resourceId the resource ID to search with 341 * @return the matching permission, or <code>null</code> if a matching permission could not be found 342 * @throws SystemException if a system exception occurred 343 */ 344 public static com.liferay.portal.model.Permission fetchByA_R( 345 java.lang.String actionId, long resourceId) 346 throws com.liferay.portal.kernel.exception.SystemException { 347 return getPersistence().fetchByA_R(actionId, resourceId); 348 } 349 350 /** 351 * Finds the permission where actionId = ? and resourceId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 352 * 353 * @param actionId the action ID to search with 354 * @param resourceId the resource ID to search with 355 * @return the matching permission, or <code>null</code> if a matching permission could not be found 356 * @throws SystemException if a system exception occurred 357 */ 358 public static com.liferay.portal.model.Permission fetchByA_R( 359 java.lang.String actionId, long resourceId, boolean retrieveFromCache) 360 throws com.liferay.portal.kernel.exception.SystemException { 361 return getPersistence() 362 .fetchByA_R(actionId, resourceId, retrieveFromCache); 363 } 364 365 /** 366 * Finds all the permissions. 367 * 368 * @return the permissions 369 * @throws SystemException if a system exception occurred 370 */ 371 public static java.util.List<com.liferay.portal.model.Permission> findAll() 372 throws com.liferay.portal.kernel.exception.SystemException { 373 return getPersistence().findAll(); 374 } 375 376 /** 377 * Finds a range of all the permissions. 378 * 379 * <p> 380 * 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. 381 * </p> 382 * 383 * @param start the lower bound of the range of permissions to return 384 * @param end the upper bound of the range of permissions to return (not inclusive) 385 * @return the range of permissions 386 * @throws SystemException if a system exception occurred 387 */ 388 public static java.util.List<com.liferay.portal.model.Permission> findAll( 389 int start, int end) 390 throws com.liferay.portal.kernel.exception.SystemException { 391 return getPersistence().findAll(start, end); 392 } 393 394 /** 395 * Finds an ordered range of all the permissions. 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 start the lower bound of the range of permissions to return 402 * @param end the upper bound of the range of permissions to return (not inclusive) 403 * @param orderByComparator the comparator to order the results by 404 * @return the ordered range of permissions 405 * @throws SystemException if a system exception occurred 406 */ 407 public static java.util.List<com.liferay.portal.model.Permission> findAll( 408 int start, int end, 409 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 410 throws com.liferay.portal.kernel.exception.SystemException { 411 return getPersistence().findAll(start, end, orderByComparator); 412 } 413 414 /** 415 * Removes all the permissions where resourceId = ? from the database. 416 * 417 * @param resourceId the resource ID to search with 418 * @throws SystemException if a system exception occurred 419 */ 420 public static void removeByResourceId(long resourceId) 421 throws com.liferay.portal.kernel.exception.SystemException { 422 getPersistence().removeByResourceId(resourceId); 423 } 424 425 /** 426 * Removes the permission where actionId = ? and resourceId = ? from the database. 427 * 428 * @param actionId the action ID to search with 429 * @param resourceId the resource ID to search with 430 * @throws SystemException if a system exception occurred 431 */ 432 public static void removeByA_R(java.lang.String actionId, long resourceId) 433 throws com.liferay.portal.NoSuchPermissionException, 434 com.liferay.portal.kernel.exception.SystemException { 435 getPersistence().removeByA_R(actionId, resourceId); 436 } 437 438 /** 439 * Removes all the permissions from the database. 440 * 441 * @throws SystemException if a system exception occurred 442 */ 443 public static void removeAll() 444 throws com.liferay.portal.kernel.exception.SystemException { 445 getPersistence().removeAll(); 446 } 447 448 /** 449 * Counts all the permissions where resourceId = ?. 450 * 451 * @param resourceId the resource ID to search with 452 * @return the number of matching permissions 453 * @throws SystemException if a system exception occurred 454 */ 455 public static int countByResourceId(long resourceId) 456 throws com.liferay.portal.kernel.exception.SystemException { 457 return getPersistence().countByResourceId(resourceId); 458 } 459 460 /** 461 * Counts all the permissions where actionId = ? and resourceId = ?. 462 * 463 * @param actionId the action ID to search with 464 * @param resourceId the resource ID to search with 465 * @return the number of matching permissions 466 * @throws SystemException if a system exception occurred 467 */ 468 public static int countByA_R(java.lang.String actionId, long resourceId) 469 throws com.liferay.portal.kernel.exception.SystemException { 470 return getPersistence().countByA_R(actionId, resourceId); 471 } 472 473 /** 474 * Counts all the permissions. 475 * 476 * @return the number of permissions 477 * @throws SystemException if a system exception occurred 478 */ 479 public static int countAll() 480 throws com.liferay.portal.kernel.exception.SystemException { 481 return getPersistence().countAll(); 482 } 483 484 /** 485 * Gets all the groups associated with the permission. 486 * 487 * @param pk the primary key of the permission to get the associated groups for 488 * @return the groups associated with the permission 489 * @throws SystemException if a system exception occurred 490 */ 491 public static java.util.List<com.liferay.portal.model.Group> getGroups( 492 long pk) throws com.liferay.portal.kernel.exception.SystemException { 493 return getPersistence().getGroups(pk); 494 } 495 496 /** 497 * Gets a range of all the groups associated with the permission. 498 * 499 * <p> 500 * 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. 501 * </p> 502 * 503 * @param pk the primary key of the permission to get the associated groups for 504 * @param start the lower bound of the range of permissions to return 505 * @param end the upper bound of the range of permissions to return (not inclusive) 506 * @return the range of groups associated with the permission 507 * @throws SystemException if a system exception occurred 508 */ 509 public static java.util.List<com.liferay.portal.model.Group> getGroups( 510 long pk, int start, int end) 511 throws com.liferay.portal.kernel.exception.SystemException { 512 return getPersistence().getGroups(pk, start, end); 513 } 514 515 /** 516 * Gets an ordered range of all the groups associated with the permission. 517 * 518 * <p> 519 * 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. 520 * </p> 521 * 522 * @param pk the primary key of the permission to get the associated groups for 523 * @param start the lower bound of the range of permissions to return 524 * @param end the upper bound of the range of permissions to return (not inclusive) 525 * @param orderByComparator the comparator to order the results by 526 * @return the ordered range of groups associated with the permission 527 * @throws SystemException if a system exception occurred 528 */ 529 public static java.util.List<com.liferay.portal.model.Group> getGroups( 530 long pk, int start, int end, 531 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 532 throws com.liferay.portal.kernel.exception.SystemException { 533 return getPersistence().getGroups(pk, start, end, orderByComparator); 534 } 535 536 /** 537 * Gets the number of groups associated with the permission. 538 * 539 * @param pk the primary key of the permission to get the number of associated groups for 540 * @return the number of groups associated with the permission 541 * @throws SystemException if a system exception occurred 542 */ 543 public static int getGroupsSize(long pk) 544 throws com.liferay.portal.kernel.exception.SystemException { 545 return getPersistence().getGroupsSize(pk); 546 } 547 548 /** 549 * Determines if the group is associated with the permission. 550 * 551 * @param pk the primary key of the permission 552 * @param groupPK the primary key of the group 553 * @return <code>true</code> if the group is associated with the permission; <code>false</code> otherwise 554 * @throws SystemException if a system exception occurred 555 */ 556 public static boolean containsGroup(long pk, long groupPK) 557 throws com.liferay.portal.kernel.exception.SystemException { 558 return getPersistence().containsGroup(pk, groupPK); 559 } 560 561 /** 562 * Determines if the permission has any groups associated with it. 563 * 564 * @param pk the primary key of the permission to check for associations with groups 565 * @return <code>true</code> if the permission has any groups associated with it; <code>false</code> otherwise 566 * @throws SystemException if a system exception occurred 567 */ 568 public static boolean containsGroups(long pk) 569 throws com.liferay.portal.kernel.exception.SystemException { 570 return getPersistence().containsGroups(pk); 571 } 572 573 /** 574 * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 575 * 576 * @param pk the primary key of the permission 577 * @param groupPK the primary key of the group 578 * @throws SystemException if a system exception occurred 579 */ 580 public static void addGroup(long pk, long groupPK) 581 throws com.liferay.portal.kernel.exception.SystemException { 582 getPersistence().addGroup(pk, groupPK); 583 } 584 585 /** 586 * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 587 * 588 * @param pk the primary key of the permission 589 * @param group the group 590 * @throws SystemException if a system exception occurred 591 */ 592 public static void addGroup(long pk, com.liferay.portal.model.Group group) 593 throws com.liferay.portal.kernel.exception.SystemException { 594 getPersistence().addGroup(pk, group); 595 } 596 597 /** 598 * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 599 * 600 * @param pk the primary key of the permission 601 * @param groupPKs the primary keys of the groups 602 * @throws SystemException if a system exception occurred 603 */ 604 public static void addGroups(long pk, long[] groupPKs) 605 throws com.liferay.portal.kernel.exception.SystemException { 606 getPersistence().addGroups(pk, groupPKs); 607 } 608 609 /** 610 * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 611 * 612 * @param pk the primary key of the permission 613 * @param groups the groups 614 * @throws SystemException if a system exception occurred 615 */ 616 public static void addGroups(long pk, 617 java.util.List<com.liferay.portal.model.Group> groups) 618 throws com.liferay.portal.kernel.exception.SystemException { 619 getPersistence().addGroups(pk, groups); 620 } 621 622 /** 623 * Clears all associations between the permission and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 624 * 625 * @param pk the primary key of the permission to clear the associated groups from 626 * @throws SystemException if a system exception occurred 627 */ 628 public static void clearGroups(long pk) 629 throws com.liferay.portal.kernel.exception.SystemException { 630 getPersistence().clearGroups(pk); 631 } 632 633 /** 634 * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 635 * 636 * @param pk the primary key of the permission 637 * @param groupPK the primary key of the group 638 * @throws SystemException if a system exception occurred 639 */ 640 public static void removeGroup(long pk, long groupPK) 641 throws com.liferay.portal.kernel.exception.SystemException { 642 getPersistence().removeGroup(pk, groupPK); 643 } 644 645 /** 646 * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 647 * 648 * @param pk the primary key of the permission 649 * @param group the group 650 * @throws SystemException if a system exception occurred 651 */ 652 public static void removeGroup(long pk, com.liferay.portal.model.Group group) 653 throws com.liferay.portal.kernel.exception.SystemException { 654 getPersistence().removeGroup(pk, group); 655 } 656 657 /** 658 * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 659 * 660 * @param pk the primary key of the permission 661 * @param groupPKs the primary keys of the groups 662 * @throws SystemException if a system exception occurred 663 */ 664 public static void removeGroups(long pk, long[] groupPKs) 665 throws com.liferay.portal.kernel.exception.SystemException { 666 getPersistence().removeGroups(pk, groupPKs); 667 } 668 669 /** 670 * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 671 * 672 * @param pk the primary key of the permission 673 * @param groups the groups 674 * @throws SystemException if a system exception occurred 675 */ 676 public static void removeGroups(long pk, 677 java.util.List<com.liferay.portal.model.Group> groups) 678 throws com.liferay.portal.kernel.exception.SystemException { 679 getPersistence().removeGroups(pk, groups); 680 } 681 682 /** 683 * Sets the groups associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 684 * 685 * @param pk the primary key of the permission to set the associations for 686 * @param groupPKs the primary keys of the groups to be associated with the permission 687 * @throws SystemException if a system exception occurred 688 */ 689 public static void setGroups(long pk, long[] groupPKs) 690 throws com.liferay.portal.kernel.exception.SystemException { 691 getPersistence().setGroups(pk, groupPKs); 692 } 693 694 /** 695 * Sets the groups associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 696 * 697 * @param pk the primary key of the permission to set the associations for 698 * @param groups the groups to be associated with the permission 699 * @throws SystemException if a system exception occurred 700 */ 701 public static void setGroups(long pk, 702 java.util.List<com.liferay.portal.model.Group> groups) 703 throws com.liferay.portal.kernel.exception.SystemException { 704 getPersistence().setGroups(pk, groups); 705 } 706 707 /** 708 * Gets all the roles associated with the permission. 709 * 710 * @param pk the primary key of the permission to get the associated roles for 711 * @return the roles associated with the permission 712 * @throws SystemException if a system exception occurred 713 */ 714 public static java.util.List<com.liferay.portal.model.Role> getRoles( 715 long pk) throws com.liferay.portal.kernel.exception.SystemException { 716 return getPersistence().getRoles(pk); 717 } 718 719 /** 720 * Gets a range of all the roles associated with the permission. 721 * 722 * <p> 723 * 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. 724 * </p> 725 * 726 * @param pk the primary key of the permission to get the associated roles for 727 * @param start the lower bound of the range of permissions to return 728 * @param end the upper bound of the range of permissions to return (not inclusive) 729 * @return the range of roles associated with the permission 730 * @throws SystemException if a system exception occurred 731 */ 732 public static java.util.List<com.liferay.portal.model.Role> getRoles( 733 long pk, int start, int end) 734 throws com.liferay.portal.kernel.exception.SystemException { 735 return getPersistence().getRoles(pk, start, end); 736 } 737 738 /** 739 * Gets an ordered range of all the roles associated with the permission. 740 * 741 * <p> 742 * 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. 743 * </p> 744 * 745 * @param pk the primary key of the permission to get the associated roles for 746 * @param start the lower bound of the range of permissions to return 747 * @param end the upper bound of the range of permissions to return (not inclusive) 748 * @param orderByComparator the comparator to order the results by 749 * @return the ordered range of roles associated with the permission 750 * @throws SystemException if a system exception occurred 751 */ 752 public static java.util.List<com.liferay.portal.model.Role> getRoles( 753 long pk, int start, int end, 754 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 755 throws com.liferay.portal.kernel.exception.SystemException { 756 return getPersistence().getRoles(pk, start, end, orderByComparator); 757 } 758 759 /** 760 * Gets the number of roles associated with the permission. 761 * 762 * @param pk the primary key of the permission to get the number of associated roles for 763 * @return the number of roles associated with the permission 764 * @throws SystemException if a system exception occurred 765 */ 766 public static int getRolesSize(long pk) 767 throws com.liferay.portal.kernel.exception.SystemException { 768 return getPersistence().getRolesSize(pk); 769 } 770 771 /** 772 * Determines if the role is associated with the permission. 773 * 774 * @param pk the primary key of the permission 775 * @param rolePK the primary key of the role 776 * @return <code>true</code> if the role is associated with the permission; <code>false</code> otherwise 777 * @throws SystemException if a system exception occurred 778 */ 779 public static boolean containsRole(long pk, long rolePK) 780 throws com.liferay.portal.kernel.exception.SystemException { 781 return getPersistence().containsRole(pk, rolePK); 782 } 783 784 /** 785 * Determines if the permission has any roles associated with it. 786 * 787 * @param pk the primary key of the permission to check for associations with roles 788 * @return <code>true</code> if the permission has any roles associated with it; <code>false</code> otherwise 789 * @throws SystemException if a system exception occurred 790 */ 791 public static boolean containsRoles(long pk) 792 throws com.liferay.portal.kernel.exception.SystemException { 793 return getPersistence().containsRoles(pk); 794 } 795 796 /** 797 * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 798 * 799 * @param pk the primary key of the permission 800 * @param rolePK the primary key of the role 801 * @throws SystemException if a system exception occurred 802 */ 803 public static void addRole(long pk, long rolePK) 804 throws com.liferay.portal.kernel.exception.SystemException { 805 getPersistence().addRole(pk, rolePK); 806 } 807 808 /** 809 * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 810 * 811 * @param pk the primary key of the permission 812 * @param role the role 813 * @throws SystemException if a system exception occurred 814 */ 815 public static void addRole(long pk, com.liferay.portal.model.Role role) 816 throws com.liferay.portal.kernel.exception.SystemException { 817 getPersistence().addRole(pk, role); 818 } 819 820 /** 821 * Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 822 * 823 * @param pk the primary key of the permission 824 * @param rolePKs the primary keys of the roles 825 * @throws SystemException if a system exception occurred 826 */ 827 public static void addRoles(long pk, long[] rolePKs) 828 throws com.liferay.portal.kernel.exception.SystemException { 829 getPersistence().addRoles(pk, rolePKs); 830 } 831 832 /** 833 * Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 834 * 835 * @param pk the primary key of the permission 836 * @param roles the roles 837 * @throws SystemException if a system exception occurred 838 */ 839 public static void addRoles(long pk, 840 java.util.List<com.liferay.portal.model.Role> roles) 841 throws com.liferay.portal.kernel.exception.SystemException { 842 getPersistence().addRoles(pk, roles); 843 } 844 845 /** 846 * Clears all associations between the permission and its roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 847 * 848 * @param pk the primary key of the permission to clear the associated roles from 849 * @throws SystemException if a system exception occurred 850 */ 851 public static void clearRoles(long pk) 852 throws com.liferay.portal.kernel.exception.SystemException { 853 getPersistence().clearRoles(pk); 854 } 855 856 /** 857 * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 858 * 859 * @param pk the primary key of the permission 860 * @param rolePK the primary key of the role 861 * @throws SystemException if a system exception occurred 862 */ 863 public static void removeRole(long pk, long rolePK) 864 throws com.liferay.portal.kernel.exception.SystemException { 865 getPersistence().removeRole(pk, rolePK); 866 } 867 868 /** 869 * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 870 * 871 * @param pk the primary key of the permission 872 * @param role the role 873 * @throws SystemException if a system exception occurred 874 */ 875 public static void removeRole(long pk, com.liferay.portal.model.Role role) 876 throws com.liferay.portal.kernel.exception.SystemException { 877 getPersistence().removeRole(pk, role); 878 } 879 880 /** 881 * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 882 * 883 * @param pk the primary key of the permission 884 * @param rolePKs the primary keys of the roles 885 * @throws SystemException if a system exception occurred 886 */ 887 public static void removeRoles(long pk, long[] rolePKs) 888 throws com.liferay.portal.kernel.exception.SystemException { 889 getPersistence().removeRoles(pk, rolePKs); 890 } 891 892 /** 893 * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 894 * 895 * @param pk the primary key of the permission 896 * @param roles the roles 897 * @throws SystemException if a system exception occurred 898 */ 899 public static void removeRoles(long pk, 900 java.util.List<com.liferay.portal.model.Role> roles) 901 throws com.liferay.portal.kernel.exception.SystemException { 902 getPersistence().removeRoles(pk, roles); 903 } 904 905 /** 906 * Sets the roles associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 907 * 908 * @param pk the primary key of the permission to set the associations for 909 * @param rolePKs the primary keys of the roles to be associated with the permission 910 * @throws SystemException if a system exception occurred 911 */ 912 public static void setRoles(long pk, long[] rolePKs) 913 throws com.liferay.portal.kernel.exception.SystemException { 914 getPersistence().setRoles(pk, rolePKs); 915 } 916 917 /** 918 * Sets the roles associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 919 * 920 * @param pk the primary key of the permission to set the associations for 921 * @param roles the roles to be associated with the permission 922 * @throws SystemException if a system exception occurred 923 */ 924 public static void setRoles(long pk, 925 java.util.List<com.liferay.portal.model.Role> roles) 926 throws com.liferay.portal.kernel.exception.SystemException { 927 getPersistence().setRoles(pk, roles); 928 } 929 930 /** 931 * Gets all the users associated with the permission. 932 * 933 * @param pk the primary key of the permission to get the associated users for 934 * @return the users associated with the permission 935 * @throws SystemException if a system exception occurred 936 */ 937 public static java.util.List<com.liferay.portal.model.User> getUsers( 938 long pk) throws com.liferay.portal.kernel.exception.SystemException { 939 return getPersistence().getUsers(pk); 940 } 941 942 /** 943 * Gets a range of all the users associated with the permission. 944 * 945 * <p> 946 * 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. 947 * </p> 948 * 949 * @param pk the primary key of the permission to get the associated users for 950 * @param start the lower bound of the range of permissions to return 951 * @param end the upper bound of the range of permissions to return (not inclusive) 952 * @return the range of users associated with the permission 953 * @throws SystemException if a system exception occurred 954 */ 955 public static java.util.List<com.liferay.portal.model.User> getUsers( 956 long pk, int start, int end) 957 throws com.liferay.portal.kernel.exception.SystemException { 958 return getPersistence().getUsers(pk, start, end); 959 } 960 961 /** 962 * Gets an ordered range of all the users associated with the permission. 963 * 964 * <p> 965 * 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. 966 * </p> 967 * 968 * @param pk the primary key of the permission to get the associated users for 969 * @param start the lower bound of the range of permissions to return 970 * @param end the upper bound of the range of permissions to return (not inclusive) 971 * @param orderByComparator the comparator to order the results by 972 * @return the ordered range of users associated with the permission 973 * @throws SystemException if a system exception occurred 974 */ 975 public static java.util.List<com.liferay.portal.model.User> getUsers( 976 long pk, int start, int end, 977 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 978 throws com.liferay.portal.kernel.exception.SystemException { 979 return getPersistence().getUsers(pk, start, end, orderByComparator); 980 } 981 982 /** 983 * Gets the number of users associated with the permission. 984 * 985 * @param pk the primary key of the permission to get the number of associated users for 986 * @return the number of users associated with the permission 987 * @throws SystemException if a system exception occurred 988 */ 989 public static int getUsersSize(long pk) 990 throws com.liferay.portal.kernel.exception.SystemException { 991 return getPersistence().getUsersSize(pk); 992 } 993 994 /** 995 * Determines if the user is associated with the permission. 996 * 997 * @param pk the primary key of the permission 998 * @param userPK the primary key of the user 999 * @return <code>true</code> if the user is associated with the permission; <code>false</code> otherwise 1000 * @throws SystemException if a system exception occurred 1001 */ 1002 public static boolean containsUser(long pk, long userPK) 1003 throws com.liferay.portal.kernel.exception.SystemException { 1004 return getPersistence().containsUser(pk, userPK); 1005 } 1006 1007 /** 1008 * Determines if the permission has any users associated with it. 1009 * 1010 * @param pk the primary key of the permission to check for associations with users 1011 * @return <code>true</code> if the permission has any users associated with it; <code>false</code> otherwise 1012 * @throws SystemException if a system exception occurred 1013 */ 1014 public static boolean containsUsers(long pk) 1015 throws com.liferay.portal.kernel.exception.SystemException { 1016 return getPersistence().containsUsers(pk); 1017 } 1018 1019 /** 1020 * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1021 * 1022 * @param pk the primary key of the permission 1023 * @param userPK the primary key of the user 1024 * @throws SystemException if a system exception occurred 1025 */ 1026 public static void addUser(long pk, long userPK) 1027 throws com.liferay.portal.kernel.exception.SystemException { 1028 getPersistence().addUser(pk, userPK); 1029 } 1030 1031 /** 1032 * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1033 * 1034 * @param pk the primary key of the permission 1035 * @param user the user 1036 * @throws SystemException if a system exception occurred 1037 */ 1038 public static void addUser(long pk, com.liferay.portal.model.User user) 1039 throws com.liferay.portal.kernel.exception.SystemException { 1040 getPersistence().addUser(pk, user); 1041 } 1042 1043 /** 1044 * Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1045 * 1046 * @param pk the primary key of the permission 1047 * @param userPKs the primary keys of the users 1048 * @throws SystemException if a system exception occurred 1049 */ 1050 public static void addUsers(long pk, long[] userPKs) 1051 throws com.liferay.portal.kernel.exception.SystemException { 1052 getPersistence().addUsers(pk, userPKs); 1053 } 1054 1055 /** 1056 * Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1057 * 1058 * @param pk the primary key of the permission 1059 * @param users the users 1060 * @throws SystemException if a system exception occurred 1061 */ 1062 public static void addUsers(long pk, 1063 java.util.List<com.liferay.portal.model.User> users) 1064 throws com.liferay.portal.kernel.exception.SystemException { 1065 getPersistence().addUsers(pk, users); 1066 } 1067 1068 /** 1069 * Clears all associations between the permission and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1070 * 1071 * @param pk the primary key of the permission to clear the associated users from 1072 * @throws SystemException if a system exception occurred 1073 */ 1074 public static void clearUsers(long pk) 1075 throws com.liferay.portal.kernel.exception.SystemException { 1076 getPersistence().clearUsers(pk); 1077 } 1078 1079 /** 1080 * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1081 * 1082 * @param pk the primary key of the permission 1083 * @param userPK the primary key of the user 1084 * @throws SystemException if a system exception occurred 1085 */ 1086 public static void removeUser(long pk, long userPK) 1087 throws com.liferay.portal.kernel.exception.SystemException { 1088 getPersistence().removeUser(pk, userPK); 1089 } 1090 1091 /** 1092 * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1093 * 1094 * @param pk the primary key of the permission 1095 * @param user the user 1096 * @throws SystemException if a system exception occurred 1097 */ 1098 public static void removeUser(long pk, com.liferay.portal.model.User user) 1099 throws com.liferay.portal.kernel.exception.SystemException { 1100 getPersistence().removeUser(pk, user); 1101 } 1102 1103 /** 1104 * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1105 * 1106 * @param pk the primary key of the permission 1107 * @param userPKs the primary keys of the users 1108 * @throws SystemException if a system exception occurred 1109 */ 1110 public static void removeUsers(long pk, long[] userPKs) 1111 throws com.liferay.portal.kernel.exception.SystemException { 1112 getPersistence().removeUsers(pk, userPKs); 1113 } 1114 1115 /** 1116 * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1117 * 1118 * @param pk the primary key of the permission 1119 * @param users the users 1120 * @throws SystemException if a system exception occurred 1121 */ 1122 public static void removeUsers(long pk, 1123 java.util.List<com.liferay.portal.model.User> users) 1124 throws com.liferay.portal.kernel.exception.SystemException { 1125 getPersistence().removeUsers(pk, users); 1126 } 1127 1128 /** 1129 * Sets the users associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1130 * 1131 * @param pk the primary key of the permission to set the associations for 1132 * @param userPKs the primary keys of the users to be associated with the permission 1133 * @throws SystemException if a system exception occurred 1134 */ 1135 public static void setUsers(long pk, long[] userPKs) 1136 throws com.liferay.portal.kernel.exception.SystemException { 1137 getPersistence().setUsers(pk, userPKs); 1138 } 1139 1140 /** 1141 * Sets the users associated with the permission, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1142 * 1143 * @param pk the primary key of the permission to set the associations for 1144 * @param users the users to be associated with the permission 1145 * @throws SystemException if a system exception occurred 1146 */ 1147 public static void setUsers(long pk, 1148 java.util.List<com.liferay.portal.model.User> users) 1149 throws com.liferay.portal.kernel.exception.SystemException { 1150 getPersistence().setUsers(pk, users); 1151 } 1152 1153 public static PermissionPersistence getPersistence() { 1154 if (_persistence == null) { 1155 _persistence = (PermissionPersistence)PortalBeanLocatorUtil.locate(PermissionPersistence.class.getName()); 1156 1157 ReferenceRegistry.registerReference(PermissionUtil.class, 1158 "_persistence"); 1159 } 1160 1161 return _persistence; 1162 } 1163 1164 public void setPersistence(PermissionPersistence persistence) { 1165 _persistence = persistence; 1166 1167 ReferenceRegistry.registerReference(PermissionUtil.class, "_persistence"); 1168 } 1169 1170 private static PermissionPersistence _persistence; 1171 }