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.exception.SystemException; 018 import com.liferay.portal.model.Permission; 019 020 /** 021 * The persistence interface for the permission service. 022 * 023 * <p> 024 * Caching information and settings can be found in <code>portal.properties</code> 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see PermissionPersistenceImpl 029 * @see PermissionUtil 030 * @generated 031 */ 032 public interface PermissionPersistence extends BasePersistence<Permission> { 033 /* 034 * NOTE FOR DEVELOPERS: 035 * 036 * Never modify or reference this interface directly. Always use {@link PermissionUtil} to access the permission persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 037 */ 038 039 /** 040 * Caches the permission in the entity cache if it is enabled. 041 * 042 * @param permission the permission to cache 043 */ 044 public void cacheResult(com.liferay.portal.model.Permission permission); 045 046 /** 047 * Caches the permissions in the entity cache if it is enabled. 048 * 049 * @param permissions the permissions to cache 050 */ 051 public void cacheResult( 052 java.util.List<com.liferay.portal.model.Permission> permissions); 053 054 /** 055 * Creates a new permission with the primary key. Does not add the permission to the database. 056 * 057 * @param permissionId the primary key for the new permission 058 * @return the new permission 059 */ 060 public com.liferay.portal.model.Permission create(long permissionId); 061 062 /** 063 * Removes the permission with the primary key from the database. Also notifies the appropriate model listeners. 064 * 065 * @param permissionId the primary key of the permission to remove 066 * @return the permission that was removed 067 * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found 068 * @throws SystemException if a system exception occurred 069 */ 070 public com.liferay.portal.model.Permission remove(long permissionId) 071 throws com.liferay.portal.NoSuchPermissionException, 072 com.liferay.portal.kernel.exception.SystemException; 073 074 public com.liferay.portal.model.Permission updateImpl( 075 com.liferay.portal.model.Permission permission, boolean merge) 076 throws com.liferay.portal.kernel.exception.SystemException; 077 078 /** 079 * Finds the permission with the primary key or throws a {@link com.liferay.portal.NoSuchPermissionException} if it could not be found. 080 * 081 * @param permissionId the primary key of the permission to find 082 * @return the permission 083 * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found 084 * @throws SystemException if a system exception occurred 085 */ 086 public com.liferay.portal.model.Permission findByPrimaryKey( 087 long permissionId) 088 throws com.liferay.portal.NoSuchPermissionException, 089 com.liferay.portal.kernel.exception.SystemException; 090 091 /** 092 * Finds the permission with the primary key or returns <code>null</code> if it could not be found. 093 * 094 * @param permissionId the primary key of the permission to find 095 * @return the permission, or <code>null</code> if a permission with the primary key could not be found 096 * @throws SystemException if a system exception occurred 097 */ 098 public com.liferay.portal.model.Permission fetchByPrimaryKey( 099 long permissionId) 100 throws com.liferay.portal.kernel.exception.SystemException; 101 102 /** 103 * Finds all the permissions where resourceId = ?. 104 * 105 * @param resourceId the resource ID to search with 106 * @return the matching permissions 107 * @throws SystemException if a system exception occurred 108 */ 109 public java.util.List<com.liferay.portal.model.Permission> findByResourceId( 110 long resourceId) 111 throws com.liferay.portal.kernel.exception.SystemException; 112 113 /** 114 * Finds a range of all the permissions where resourceId = ?. 115 * 116 * <p> 117 * 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. 118 * </p> 119 * 120 * @param resourceId the resource ID to search with 121 * @param start the lower bound of the range of permissions to return 122 * @param end the upper bound of the range of permissions to return (not inclusive) 123 * @return the range of matching permissions 124 * @throws SystemException if a system exception occurred 125 */ 126 public java.util.List<com.liferay.portal.model.Permission> findByResourceId( 127 long resourceId, int start, int end) 128 throws com.liferay.portal.kernel.exception.SystemException; 129 130 /** 131 * Finds an ordered range of all the permissions where resourceId = ?. 132 * 133 * <p> 134 * 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. 135 * </p> 136 * 137 * @param resourceId the resource ID to search with 138 * @param start the lower bound of the range of permissions to return 139 * @param end the upper bound of the range of permissions to return (not inclusive) 140 * @param orderByComparator the comparator to order the results by 141 * @return the ordered range of matching permissions 142 * @throws SystemException if a system exception occurred 143 */ 144 public java.util.List<com.liferay.portal.model.Permission> findByResourceId( 145 long resourceId, int start, int end, 146 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 147 throws com.liferay.portal.kernel.exception.SystemException; 148 149 /** 150 * Finds the first permission in the ordered set where resourceId = ?. 151 * 152 * <p> 153 * 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. 154 * </p> 155 * 156 * @param resourceId the resource ID to search with 157 * @param orderByComparator the comparator to order the set by 158 * @return the first matching permission 159 * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found 160 * @throws SystemException if a system exception occurred 161 */ 162 public com.liferay.portal.model.Permission findByResourceId_First( 163 long resourceId, 164 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 165 throws com.liferay.portal.NoSuchPermissionException, 166 com.liferay.portal.kernel.exception.SystemException; 167 168 /** 169 * Finds the last permission in the ordered set where resourceId = ?. 170 * 171 * <p> 172 * 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. 173 * </p> 174 * 175 * @param resourceId the resource ID to search with 176 * @param orderByComparator the comparator to order the set by 177 * @return the last matching permission 178 * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found 179 * @throws SystemException if a system exception occurred 180 */ 181 public com.liferay.portal.model.Permission findByResourceId_Last( 182 long resourceId, 183 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 184 throws com.liferay.portal.NoSuchPermissionException, 185 com.liferay.portal.kernel.exception.SystemException; 186 187 /** 188 * Finds the permissions before and after the current permission in the ordered set where resourceId = ?. 189 * 190 * <p> 191 * 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. 192 * </p> 193 * 194 * @param permissionId the primary key of the current permission 195 * @param resourceId the resource ID to search with 196 * @param orderByComparator the comparator to order the set by 197 * @return the previous, current, and next permission 198 * @throws com.liferay.portal.NoSuchPermissionException if a permission with the primary key could not be found 199 * @throws SystemException if a system exception occurred 200 */ 201 public com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext( 202 long permissionId, long resourceId, 203 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 204 throws com.liferay.portal.NoSuchPermissionException, 205 com.liferay.portal.kernel.exception.SystemException; 206 207 /** 208 * Finds the permission where actionId = ? and resourceId = ? or throws a {@link com.liferay.portal.NoSuchPermissionException} if it could not be found. 209 * 210 * @param actionId the action ID to search with 211 * @param resourceId the resource ID to search with 212 * @return the matching permission 213 * @throws com.liferay.portal.NoSuchPermissionException if a matching permission could not be found 214 * @throws SystemException if a system exception occurred 215 */ 216 public com.liferay.portal.model.Permission findByA_R( 217 java.lang.String actionId, long resourceId) 218 throws com.liferay.portal.NoSuchPermissionException, 219 com.liferay.portal.kernel.exception.SystemException; 220 221 /** 222 * Finds the permission where actionId = ? and resourceId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 223 * 224 * @param actionId the action ID to search with 225 * @param resourceId the resource ID to search with 226 * @return the matching permission, or <code>null</code> if a matching permission could not be found 227 * @throws SystemException if a system exception occurred 228 */ 229 public com.liferay.portal.model.Permission fetchByA_R( 230 java.lang.String actionId, long resourceId) 231 throws com.liferay.portal.kernel.exception.SystemException; 232 233 /** 234 * Finds the permission where actionId = ? and resourceId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 235 * 236 * @param actionId the action ID to search with 237 * @param resourceId the resource ID to search with 238 * @return the matching permission, or <code>null</code> if a matching permission could not be found 239 * @throws SystemException if a system exception occurred 240 */ 241 public com.liferay.portal.model.Permission fetchByA_R( 242 java.lang.String actionId, long resourceId, boolean retrieveFromCache) 243 throws com.liferay.portal.kernel.exception.SystemException; 244 245 /** 246 * Finds all the permissions. 247 * 248 * @return the permissions 249 * @throws SystemException if a system exception occurred 250 */ 251 public java.util.List<com.liferay.portal.model.Permission> findAll() 252 throws com.liferay.portal.kernel.exception.SystemException; 253 254 /** 255 * Finds a range of all the permissions. 256 * 257 * <p> 258 * 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. 259 * </p> 260 * 261 * @param start the lower bound of the range of permissions to return 262 * @param end the upper bound of the range of permissions to return (not inclusive) 263 * @return the range of permissions 264 * @throws SystemException if a system exception occurred 265 */ 266 public java.util.List<com.liferay.portal.model.Permission> findAll( 267 int start, int end) 268 throws com.liferay.portal.kernel.exception.SystemException; 269 270 /** 271 * Finds an ordered range of all the permissions. 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 start the lower bound of the range of permissions to return 278 * @param end the upper bound of the range of permissions to return (not inclusive) 279 * @param orderByComparator the comparator to order the results by 280 * @return the ordered range of permissions 281 * @throws SystemException if a system exception occurred 282 */ 283 public java.util.List<com.liferay.portal.model.Permission> findAll( 284 int start, int end, 285 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 286 throws com.liferay.portal.kernel.exception.SystemException; 287 288 /** 289 * Removes all the permissions where resourceId = ? from the database. 290 * 291 * @param resourceId the resource ID to search with 292 * @throws SystemException if a system exception occurred 293 */ 294 public void removeByResourceId(long resourceId) 295 throws com.liferay.portal.kernel.exception.SystemException; 296 297 /** 298 * Removes the permission where actionId = ? and resourceId = ? from the database. 299 * 300 * @param actionId the action ID to search with 301 * @param resourceId the resource ID to search with 302 * @throws SystemException if a system exception occurred 303 */ 304 public void removeByA_R(java.lang.String actionId, long resourceId) 305 throws com.liferay.portal.NoSuchPermissionException, 306 com.liferay.portal.kernel.exception.SystemException; 307 308 /** 309 * Removes all the permissions from the database. 310 * 311 * @throws SystemException if a system exception occurred 312 */ 313 public void removeAll() 314 throws com.liferay.portal.kernel.exception.SystemException; 315 316 /** 317 * Counts all the permissions where resourceId = ?. 318 * 319 * @param resourceId the resource ID to search with 320 * @return the number of matching permissions 321 * @throws SystemException if a system exception occurred 322 */ 323 public int countByResourceId(long resourceId) 324 throws com.liferay.portal.kernel.exception.SystemException; 325 326 /** 327 * Counts all the permissions where actionId = ? and resourceId = ?. 328 * 329 * @param actionId the action ID to search with 330 * @param resourceId the resource ID to search with 331 * @return the number of matching permissions 332 * @throws SystemException if a system exception occurred 333 */ 334 public int countByA_R(java.lang.String actionId, long resourceId) 335 throws com.liferay.portal.kernel.exception.SystemException; 336 337 /** 338 * Counts all the permissions. 339 * 340 * @return the number of permissions 341 * @throws SystemException if a system exception occurred 342 */ 343 public int countAll() 344 throws com.liferay.portal.kernel.exception.SystemException; 345 346 /** 347 * Gets all the groups associated with the permission. 348 * 349 * @param pk the primary key of the permission to get the associated groups for 350 * @return the groups associated with the permission 351 * @throws SystemException if a system exception occurred 352 */ 353 public java.util.List<com.liferay.portal.model.Group> getGroups(long pk) 354 throws com.liferay.portal.kernel.exception.SystemException; 355 356 /** 357 * Gets a range of all the groups associated with the permission. 358 * 359 * <p> 360 * 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. 361 * </p> 362 * 363 * @param pk the primary key of the permission to get the associated groups for 364 * @param start the lower bound of the range of permissions to return 365 * @param end the upper bound of the range of permissions to return (not inclusive) 366 * @return the range of groups associated with the permission 367 * @throws SystemException if a system exception occurred 368 */ 369 public java.util.List<com.liferay.portal.model.Group> getGroups(long pk, 370 int start, int end) 371 throws com.liferay.portal.kernel.exception.SystemException; 372 373 /** 374 * Gets an ordered range of all the groups associated with the permission. 375 * 376 * <p> 377 * 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. 378 * </p> 379 * 380 * @param pk the primary key of the permission to get the associated groups for 381 * @param start the lower bound of the range of permissions to return 382 * @param end the upper bound of the range of permissions to return (not inclusive) 383 * @param orderByComparator the comparator to order the results by 384 * @return the ordered range of groups associated with the permission 385 * @throws SystemException if a system exception occurred 386 */ 387 public java.util.List<com.liferay.portal.model.Group> getGroups(long pk, 388 int start, int end, 389 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 390 throws com.liferay.portal.kernel.exception.SystemException; 391 392 /** 393 * Gets the number of groups associated with the permission. 394 * 395 * @param pk the primary key of the permission to get the number of associated groups for 396 * @return the number of groups associated with the permission 397 * @throws SystemException if a system exception occurred 398 */ 399 public int getGroupsSize(long pk) 400 throws com.liferay.portal.kernel.exception.SystemException; 401 402 /** 403 * Determines if the group is associated with the permission. 404 * 405 * @param pk the primary key of the permission 406 * @param groupPK the primary key of the group 407 * @return <code>true</code> if the group is associated with the permission; <code>false</code> otherwise 408 * @throws SystemException if a system exception occurred 409 */ 410 public boolean containsGroup(long pk, long groupPK) 411 throws com.liferay.portal.kernel.exception.SystemException; 412 413 /** 414 * Determines if the permission has any groups associated with it. 415 * 416 * @param pk the primary key of the permission to check for associations with groups 417 * @return <code>true</code> if the permission has any groups associated with it; <code>false</code> otherwise 418 * @throws SystemException if a system exception occurred 419 */ 420 public boolean containsGroups(long pk) 421 throws com.liferay.portal.kernel.exception.SystemException; 422 423 /** 424 * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 425 * 426 * @param pk the primary key of the permission 427 * @param groupPK the primary key of the group 428 * @throws SystemException if a system exception occurred 429 */ 430 public void addGroup(long pk, long groupPK) 431 throws com.liferay.portal.kernel.exception.SystemException; 432 433 /** 434 * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 435 * 436 * @param pk the primary key of the permission 437 * @param group the group 438 * @throws SystemException if a system exception occurred 439 */ 440 public void addGroup(long pk, com.liferay.portal.model.Group group) 441 throws com.liferay.portal.kernel.exception.SystemException; 442 443 /** 444 * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 445 * 446 * @param pk the primary key of the permission 447 * @param groupPKs the primary keys of the groups 448 * @throws SystemException if a system exception occurred 449 */ 450 public void addGroups(long pk, long[] groupPKs) 451 throws com.liferay.portal.kernel.exception.SystemException; 452 453 /** 454 * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 455 * 456 * @param pk the primary key of the permission 457 * @param groups the groups 458 * @throws SystemException if a system exception occurred 459 */ 460 public void addGroups(long pk, 461 java.util.List<com.liferay.portal.model.Group> groups) 462 throws com.liferay.portal.kernel.exception.SystemException; 463 464 /** 465 * Clears all associations between the permission and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 466 * 467 * @param pk the primary key of the permission to clear the associated groups from 468 * @throws SystemException if a system exception occurred 469 */ 470 public void clearGroups(long pk) 471 throws com.liferay.portal.kernel.exception.SystemException; 472 473 /** 474 * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 475 * 476 * @param pk the primary key of the permission 477 * @param groupPK the primary key of the group 478 * @throws SystemException if a system exception occurred 479 */ 480 public void removeGroup(long pk, long groupPK) 481 throws com.liferay.portal.kernel.exception.SystemException; 482 483 /** 484 * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 485 * 486 * @param pk the primary key of the permission 487 * @param group the group 488 * @throws SystemException if a system exception occurred 489 */ 490 public void removeGroup(long pk, com.liferay.portal.model.Group group) 491 throws com.liferay.portal.kernel.exception.SystemException; 492 493 /** 494 * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 495 * 496 * @param pk the primary key of the permission 497 * @param groupPKs the primary keys of the groups 498 * @throws SystemException if a system exception occurred 499 */ 500 public void removeGroups(long pk, long[] groupPKs) 501 throws com.liferay.portal.kernel.exception.SystemException; 502 503 /** 504 * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 505 * 506 * @param pk the primary key of the permission 507 * @param groups the groups 508 * @throws SystemException if a system exception occurred 509 */ 510 public void removeGroups(long pk, 511 java.util.List<com.liferay.portal.model.Group> groups) 512 throws com.liferay.portal.kernel.exception.SystemException; 513 514 /** 515 * 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. 516 * 517 * @param pk the primary key of the permission to set the associations for 518 * @param groupPKs the primary keys of the groups to be associated with the permission 519 * @throws SystemException if a system exception occurred 520 */ 521 public void setGroups(long pk, long[] groupPKs) 522 throws com.liferay.portal.kernel.exception.SystemException; 523 524 /** 525 * 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. 526 * 527 * @param pk the primary key of the permission to set the associations for 528 * @param groups the groups to be associated with the permission 529 * @throws SystemException if a system exception occurred 530 */ 531 public void setGroups(long pk, 532 java.util.List<com.liferay.portal.model.Group> groups) 533 throws com.liferay.portal.kernel.exception.SystemException; 534 535 /** 536 * Gets all the roles associated with the permission. 537 * 538 * @param pk the primary key of the permission to get the associated roles for 539 * @return the roles associated with the permission 540 * @throws SystemException if a system exception occurred 541 */ 542 public java.util.List<com.liferay.portal.model.Role> getRoles(long pk) 543 throws com.liferay.portal.kernel.exception.SystemException; 544 545 /** 546 * Gets a range of all the roles associated with the permission. 547 * 548 * <p> 549 * 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. 550 * </p> 551 * 552 * @param pk the primary key of the permission to get the associated roles for 553 * @param start the lower bound of the range of permissions to return 554 * @param end the upper bound of the range of permissions to return (not inclusive) 555 * @return the range of roles associated with the permission 556 * @throws SystemException if a system exception occurred 557 */ 558 public java.util.List<com.liferay.portal.model.Role> getRoles(long pk, 559 int start, int end) 560 throws com.liferay.portal.kernel.exception.SystemException; 561 562 /** 563 * Gets an ordered range of all the roles associated with the permission. 564 * 565 * <p> 566 * 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. 567 * </p> 568 * 569 * @param pk the primary key of the permission to get the associated roles for 570 * @param start the lower bound of the range of permissions to return 571 * @param end the upper bound of the range of permissions to return (not inclusive) 572 * @param orderByComparator the comparator to order the results by 573 * @return the ordered range of roles associated with the permission 574 * @throws SystemException if a system exception occurred 575 */ 576 public java.util.List<com.liferay.portal.model.Role> getRoles(long pk, 577 int start, int end, 578 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 579 throws com.liferay.portal.kernel.exception.SystemException; 580 581 /** 582 * Gets the number of roles associated with the permission. 583 * 584 * @param pk the primary key of the permission to get the number of associated roles for 585 * @return the number of roles associated with the permission 586 * @throws SystemException if a system exception occurred 587 */ 588 public int getRolesSize(long pk) 589 throws com.liferay.portal.kernel.exception.SystemException; 590 591 /** 592 * Determines if the role is associated with the permission. 593 * 594 * @param pk the primary key of the permission 595 * @param rolePK the primary key of the role 596 * @return <code>true</code> if the role is associated with the permission; <code>false</code> otherwise 597 * @throws SystemException if a system exception occurred 598 */ 599 public boolean containsRole(long pk, long rolePK) 600 throws com.liferay.portal.kernel.exception.SystemException; 601 602 /** 603 * Determines if the permission has any roles associated with it. 604 * 605 * @param pk the primary key of the permission to check for associations with roles 606 * @return <code>true</code> if the permission has any roles associated with it; <code>false</code> otherwise 607 * @throws SystemException if a system exception occurred 608 */ 609 public boolean containsRoles(long pk) 610 throws com.liferay.portal.kernel.exception.SystemException; 611 612 /** 613 * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 614 * 615 * @param pk the primary key of the permission 616 * @param rolePK the primary key of the role 617 * @throws SystemException if a system exception occurred 618 */ 619 public void addRole(long pk, long rolePK) 620 throws com.liferay.portal.kernel.exception.SystemException; 621 622 /** 623 * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 624 * 625 * @param pk the primary key of the permission 626 * @param role the role 627 * @throws SystemException if a system exception occurred 628 */ 629 public void addRole(long pk, com.liferay.portal.model.Role role) 630 throws com.liferay.portal.kernel.exception.SystemException; 631 632 /** 633 * Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 634 * 635 * @param pk the primary key of the permission 636 * @param rolePKs the primary keys of the roles 637 * @throws SystemException if a system exception occurred 638 */ 639 public void addRoles(long pk, long[] rolePKs) 640 throws com.liferay.portal.kernel.exception.SystemException; 641 642 /** 643 * Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 644 * 645 * @param pk the primary key of the permission 646 * @param roles the roles 647 * @throws SystemException if a system exception occurred 648 */ 649 public void addRoles(long pk, 650 java.util.List<com.liferay.portal.model.Role> roles) 651 throws com.liferay.portal.kernel.exception.SystemException; 652 653 /** 654 * Clears all associations between the permission and its roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 655 * 656 * @param pk the primary key of the permission to clear the associated roles from 657 * @throws SystemException if a system exception occurred 658 */ 659 public void clearRoles(long pk) 660 throws com.liferay.portal.kernel.exception.SystemException; 661 662 /** 663 * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 664 * 665 * @param pk the primary key of the permission 666 * @param rolePK the primary key of the role 667 * @throws SystemException if a system exception occurred 668 */ 669 public void removeRole(long pk, long rolePK) 670 throws com.liferay.portal.kernel.exception.SystemException; 671 672 /** 673 * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 674 * 675 * @param pk the primary key of the permission 676 * @param role the role 677 * @throws SystemException if a system exception occurred 678 */ 679 public void removeRole(long pk, com.liferay.portal.model.Role role) 680 throws com.liferay.portal.kernel.exception.SystemException; 681 682 /** 683 * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 684 * 685 * @param pk the primary key of the permission 686 * @param rolePKs the primary keys of the roles 687 * @throws SystemException if a system exception occurred 688 */ 689 public void removeRoles(long pk, long[] rolePKs) 690 throws com.liferay.portal.kernel.exception.SystemException; 691 692 /** 693 * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 694 * 695 * @param pk the primary key of the permission 696 * @param roles the roles 697 * @throws SystemException if a system exception occurred 698 */ 699 public void removeRoles(long pk, 700 java.util.List<com.liferay.portal.model.Role> roles) 701 throws com.liferay.portal.kernel.exception.SystemException; 702 703 /** 704 * 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. 705 * 706 * @param pk the primary key of the permission to set the associations for 707 * @param rolePKs the primary keys of the roles to be associated with the permission 708 * @throws SystemException if a system exception occurred 709 */ 710 public void setRoles(long pk, long[] rolePKs) 711 throws com.liferay.portal.kernel.exception.SystemException; 712 713 /** 714 * 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. 715 * 716 * @param pk the primary key of the permission to set the associations for 717 * @param roles the roles to be associated with the permission 718 * @throws SystemException if a system exception occurred 719 */ 720 public void setRoles(long pk, 721 java.util.List<com.liferay.portal.model.Role> roles) 722 throws com.liferay.portal.kernel.exception.SystemException; 723 724 /** 725 * Gets all the users associated with the permission. 726 * 727 * @param pk the primary key of the permission to get the associated users for 728 * @return the users associated with the permission 729 * @throws SystemException if a system exception occurred 730 */ 731 public java.util.List<com.liferay.portal.model.User> getUsers(long pk) 732 throws com.liferay.portal.kernel.exception.SystemException; 733 734 /** 735 * Gets a range of all the users associated with the permission. 736 * 737 * <p> 738 * 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. 739 * </p> 740 * 741 * @param pk the primary key of the permission to get the associated users for 742 * @param start the lower bound of the range of permissions to return 743 * @param end the upper bound of the range of permissions to return (not inclusive) 744 * @return the range of users associated with the permission 745 * @throws SystemException if a system exception occurred 746 */ 747 public java.util.List<com.liferay.portal.model.User> getUsers(long pk, 748 int start, int end) 749 throws com.liferay.portal.kernel.exception.SystemException; 750 751 /** 752 * Gets an ordered range of all the users associated with the permission. 753 * 754 * <p> 755 * 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. 756 * </p> 757 * 758 * @param pk the primary key of the permission to get the associated users for 759 * @param start the lower bound of the range of permissions to return 760 * @param end the upper bound of the range of permissions to return (not inclusive) 761 * @param orderByComparator the comparator to order the results by 762 * @return the ordered range of users associated with the permission 763 * @throws SystemException if a system exception occurred 764 */ 765 public java.util.List<com.liferay.portal.model.User> getUsers(long pk, 766 int start, int end, 767 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 768 throws com.liferay.portal.kernel.exception.SystemException; 769 770 /** 771 * Gets the number of users associated with the permission. 772 * 773 * @param pk the primary key of the permission to get the number of associated users for 774 * @return the number of users associated with the permission 775 * @throws SystemException if a system exception occurred 776 */ 777 public int getUsersSize(long pk) 778 throws com.liferay.portal.kernel.exception.SystemException; 779 780 /** 781 * Determines if the user is associated with the permission. 782 * 783 * @param pk the primary key of the permission 784 * @param userPK the primary key of the user 785 * @return <code>true</code> if the user is associated with the permission; <code>false</code> otherwise 786 * @throws SystemException if a system exception occurred 787 */ 788 public boolean containsUser(long pk, long userPK) 789 throws com.liferay.portal.kernel.exception.SystemException; 790 791 /** 792 * Determines if the permission has any users associated with it. 793 * 794 * @param pk the primary key of the permission to check for associations with users 795 * @return <code>true</code> if the permission has any users associated with it; <code>false</code> otherwise 796 * @throws SystemException if a system exception occurred 797 */ 798 public boolean containsUsers(long pk) 799 throws com.liferay.portal.kernel.exception.SystemException; 800 801 /** 802 * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 803 * 804 * @param pk the primary key of the permission 805 * @param userPK the primary key of the user 806 * @throws SystemException if a system exception occurred 807 */ 808 public void addUser(long pk, long userPK) 809 throws com.liferay.portal.kernel.exception.SystemException; 810 811 /** 812 * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 813 * 814 * @param pk the primary key of the permission 815 * @param user the user 816 * @throws SystemException if a system exception occurred 817 */ 818 public void addUser(long pk, com.liferay.portal.model.User user) 819 throws com.liferay.portal.kernel.exception.SystemException; 820 821 /** 822 * Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 823 * 824 * @param pk the primary key of the permission 825 * @param userPKs the primary keys of the users 826 * @throws SystemException if a system exception occurred 827 */ 828 public void addUsers(long pk, long[] userPKs) 829 throws com.liferay.portal.kernel.exception.SystemException; 830 831 /** 832 * Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 833 * 834 * @param pk the primary key of the permission 835 * @param users the users 836 * @throws SystemException if a system exception occurred 837 */ 838 public void addUsers(long pk, 839 java.util.List<com.liferay.portal.model.User> users) 840 throws com.liferay.portal.kernel.exception.SystemException; 841 842 /** 843 * Clears all associations between the permission and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 844 * 845 * @param pk the primary key of the permission to clear the associated users from 846 * @throws SystemException if a system exception occurred 847 */ 848 public void clearUsers(long pk) 849 throws com.liferay.portal.kernel.exception.SystemException; 850 851 /** 852 * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 853 * 854 * @param pk the primary key of the permission 855 * @param userPK the primary key of the user 856 * @throws SystemException if a system exception occurred 857 */ 858 public void removeUser(long pk, long userPK) 859 throws com.liferay.portal.kernel.exception.SystemException; 860 861 /** 862 * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 863 * 864 * @param pk the primary key of the permission 865 * @param user the user 866 * @throws SystemException if a system exception occurred 867 */ 868 public void removeUser(long pk, com.liferay.portal.model.User user) 869 throws com.liferay.portal.kernel.exception.SystemException; 870 871 /** 872 * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 873 * 874 * @param pk the primary key of the permission 875 * @param userPKs the primary keys of the users 876 * @throws SystemException if a system exception occurred 877 */ 878 public void removeUsers(long pk, long[] userPKs) 879 throws com.liferay.portal.kernel.exception.SystemException; 880 881 /** 882 * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 883 * 884 * @param pk the primary key of the permission 885 * @param users the users 886 * @throws SystemException if a system exception occurred 887 */ 888 public void removeUsers(long pk, 889 java.util.List<com.liferay.portal.model.User> users) 890 throws com.liferay.portal.kernel.exception.SystemException; 891 892 /** 893 * 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. 894 * 895 * @param pk the primary key of the permission to set the associations for 896 * @param userPKs the primary keys of the users to be associated with the permission 897 * @throws SystemException if a system exception occurred 898 */ 899 public void setUsers(long pk, long[] userPKs) 900 throws com.liferay.portal.kernel.exception.SystemException; 901 902 /** 903 * 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. 904 * 905 * @param pk the primary key of the permission to set the associations for 906 * @param users the users to be associated with the permission 907 * @throws SystemException if a system exception occurred 908 */ 909 public void setUsers(long pk, 910 java.util.List<com.liferay.portal.model.User> users) 911 throws com.liferay.portal.kernel.exception.SystemException; 912 913 public Permission remove(Permission permission) throws SystemException; 914 }