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 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 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 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 * Returns 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 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 * Returns 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 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 * Returns all the permissions where resourceId = ?. 104 * 105 * @param resourceId the resource ID 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 * Returns 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 121 * @param start the lower bound of the range of permissions 122 * @param end the upper bound of the range of permissions (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 * Returns 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 138 * @param start the lower bound of the range of permissions 139 * @param end the upper bound of the range of permissions (not inclusive) 140 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 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 * Returns 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 157 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 176 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 196 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 211 * @param resourceId the resource ID 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 * Returns 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 225 * @param resourceId the resource ID 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 * Returns 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 237 * @param resourceId the resource ID 238 * @param retrieveFromCache whether to use the finder cache 239 * @return the matching permission, or <code>null</code> if a matching permission could not be found 240 * @throws SystemException if a system exception occurred 241 */ 242 public com.liferay.portal.model.Permission fetchByA_R( 243 java.lang.String actionId, long resourceId, boolean retrieveFromCache) 244 throws com.liferay.portal.kernel.exception.SystemException; 245 246 /** 247 * Returns all the permissions. 248 * 249 * @return the permissions 250 * @throws SystemException if a system exception occurred 251 */ 252 public java.util.List<com.liferay.portal.model.Permission> findAll() 253 throws com.liferay.portal.kernel.exception.SystemException; 254 255 /** 256 * Returns a range of all the permissions. 257 * 258 * <p> 259 * 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. 260 * </p> 261 * 262 * @param start the lower bound of the range of permissions 263 * @param end the upper bound of the range of permissions (not inclusive) 264 * @return the range of permissions 265 * @throws SystemException if a system exception occurred 266 */ 267 public java.util.List<com.liferay.portal.model.Permission> findAll( 268 int start, int end) 269 throws com.liferay.portal.kernel.exception.SystemException; 270 271 /** 272 * Returns an ordered range of all the permissions. 273 * 274 * <p> 275 * 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. 276 * </p> 277 * 278 * @param start the lower bound of the range of permissions 279 * @param end the upper bound of the range of permissions (not inclusive) 280 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 281 * @return the ordered range of permissions 282 * @throws SystemException if a system exception occurred 283 */ 284 public java.util.List<com.liferay.portal.model.Permission> findAll( 285 int start, int end, 286 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 287 throws com.liferay.portal.kernel.exception.SystemException; 288 289 /** 290 * Removes all the permissions where resourceId = ? from the database. 291 * 292 * @param resourceId the resource ID 293 * @throws SystemException if a system exception occurred 294 */ 295 public void removeByResourceId(long resourceId) 296 throws com.liferay.portal.kernel.exception.SystemException; 297 298 /** 299 * Removes the permission where actionId = ? and resourceId = ? from the database. 300 * 301 * @param actionId the action ID 302 * @param resourceId the resource ID 303 * @throws SystemException if a system exception occurred 304 */ 305 public void removeByA_R(java.lang.String actionId, long resourceId) 306 throws com.liferay.portal.NoSuchPermissionException, 307 com.liferay.portal.kernel.exception.SystemException; 308 309 /** 310 * Removes all the permissions from the database. 311 * 312 * @throws SystemException if a system exception occurred 313 */ 314 public void removeAll() 315 throws com.liferay.portal.kernel.exception.SystemException; 316 317 /** 318 * Returns the number of permissions where resourceId = ?. 319 * 320 * @param resourceId the resource ID 321 * @return the number of matching permissions 322 * @throws SystemException if a system exception occurred 323 */ 324 public int countByResourceId(long resourceId) 325 throws com.liferay.portal.kernel.exception.SystemException; 326 327 /** 328 * Returns the number of permissions where actionId = ? and resourceId = ?. 329 * 330 * @param actionId the action ID 331 * @param resourceId the resource ID 332 * @return the number of matching permissions 333 * @throws SystemException if a system exception occurred 334 */ 335 public int countByA_R(java.lang.String actionId, long resourceId) 336 throws com.liferay.portal.kernel.exception.SystemException; 337 338 /** 339 * Returns the number of permissions. 340 * 341 * @return the number of permissions 342 * @throws SystemException if a system exception occurred 343 */ 344 public int countAll() 345 throws com.liferay.portal.kernel.exception.SystemException; 346 347 /** 348 * Returns all the groups associated with the permission. 349 * 350 * @param pk the primary key of the permission 351 * @return the groups associated with the permission 352 * @throws SystemException if a system exception occurred 353 */ 354 public java.util.List<com.liferay.portal.model.Group> getGroups(long pk) 355 throws com.liferay.portal.kernel.exception.SystemException; 356 357 /** 358 * Returns a range of all the groups associated with the permission. 359 * 360 * <p> 361 * 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. 362 * </p> 363 * 364 * @param pk the primary key of the permission 365 * @param start the lower bound of the range of permissions 366 * @param end the upper bound of the range of permissions (not inclusive) 367 * @return the range of groups associated with the permission 368 * @throws SystemException if a system exception occurred 369 */ 370 public java.util.List<com.liferay.portal.model.Group> getGroups(long pk, 371 int start, int end) 372 throws com.liferay.portal.kernel.exception.SystemException; 373 374 /** 375 * Returns an ordered range of all the groups associated with the permission. 376 * 377 * <p> 378 * 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. 379 * </p> 380 * 381 * @param pk the primary key of the permission 382 * @param start the lower bound of the range of permissions 383 * @param end the upper bound of the range of permissions (not inclusive) 384 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 385 * @return the ordered range of groups associated with the permission 386 * @throws SystemException if a system exception occurred 387 */ 388 public java.util.List<com.liferay.portal.model.Group> getGroups(long pk, 389 int start, int end, 390 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 391 throws com.liferay.portal.kernel.exception.SystemException; 392 393 /** 394 * Returns the number of groups associated with the permission. 395 * 396 * @param pk the primary key of the permission 397 * @return the number of groups associated with the permission 398 * @throws SystemException if a system exception occurred 399 */ 400 public int getGroupsSize(long pk) 401 throws com.liferay.portal.kernel.exception.SystemException; 402 403 /** 404 * Returns <code>true</code> if the group is associated with the permission. 405 * 406 * @param pk the primary key of the permission 407 * @param groupPK the primary key of the group 408 * @return <code>true</code> if the group is associated with the permission; <code>false</code> otherwise 409 * @throws SystemException if a system exception occurred 410 */ 411 public boolean containsGroup(long pk, long groupPK) 412 throws com.liferay.portal.kernel.exception.SystemException; 413 414 /** 415 * Returns <code>true</code> if the permission has any groups associated with it. 416 * 417 * @param pk the primary key of the permission to check for associations with groups 418 * @return <code>true</code> if the permission has any groups associated with it; <code>false</code> otherwise 419 * @throws SystemException if a system exception occurred 420 */ 421 public boolean containsGroups(long pk) 422 throws com.liferay.portal.kernel.exception.SystemException; 423 424 /** 425 * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 426 * 427 * @param pk the primary key of the permission 428 * @param groupPK the primary key of the group 429 * @throws SystemException if a system exception occurred 430 */ 431 public void addGroup(long pk, long groupPK) 432 throws com.liferay.portal.kernel.exception.SystemException; 433 434 /** 435 * Adds an association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 436 * 437 * @param pk the primary key of the permission 438 * @param group the group 439 * @throws SystemException if a system exception occurred 440 */ 441 public void addGroup(long pk, com.liferay.portal.model.Group group) 442 throws com.liferay.portal.kernel.exception.SystemException; 443 444 /** 445 * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 446 * 447 * @param pk the primary key of the permission 448 * @param groupPKs the primary keys of the groups 449 * @throws SystemException if a system exception occurred 450 */ 451 public void addGroups(long pk, long[] groupPKs) 452 throws com.liferay.portal.kernel.exception.SystemException; 453 454 /** 455 * Adds an association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 456 * 457 * @param pk the primary key of the permission 458 * @param groups the groups 459 * @throws SystemException if a system exception occurred 460 */ 461 public void addGroups(long pk, 462 java.util.List<com.liferay.portal.model.Group> groups) 463 throws com.liferay.portal.kernel.exception.SystemException; 464 465 /** 466 * Clears all associations between the permission and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 467 * 468 * @param pk the primary key of the permission to clear the associated groups from 469 * @throws SystemException if a system exception occurred 470 */ 471 public void clearGroups(long pk) 472 throws com.liferay.portal.kernel.exception.SystemException; 473 474 /** 475 * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 476 * 477 * @param pk the primary key of the permission 478 * @param groupPK the primary key of the group 479 * @throws SystemException if a system exception occurred 480 */ 481 public void removeGroup(long pk, long groupPK) 482 throws com.liferay.portal.kernel.exception.SystemException; 483 484 /** 485 * Removes the association between the permission and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 486 * 487 * @param pk the primary key of the permission 488 * @param group the group 489 * @throws SystemException if a system exception occurred 490 */ 491 public void removeGroup(long pk, com.liferay.portal.model.Group group) 492 throws com.liferay.portal.kernel.exception.SystemException; 493 494 /** 495 * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 496 * 497 * @param pk the primary key of the permission 498 * @param groupPKs the primary keys of the groups 499 * @throws SystemException if a system exception occurred 500 */ 501 public void removeGroups(long pk, long[] groupPKs) 502 throws com.liferay.portal.kernel.exception.SystemException; 503 504 /** 505 * Removes the association between the permission and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 506 * 507 * @param pk the primary key of the permission 508 * @param groups the groups 509 * @throws SystemException if a system exception occurred 510 */ 511 public void removeGroups(long pk, 512 java.util.List<com.liferay.portal.model.Group> groups) 513 throws com.liferay.portal.kernel.exception.SystemException; 514 515 /** 516 * 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. 517 * 518 * @param pk the primary key of the permission 519 * @param groupPKs the primary keys of the groups to be associated with the permission 520 * @throws SystemException if a system exception occurred 521 */ 522 public void setGroups(long pk, long[] groupPKs) 523 throws com.liferay.portal.kernel.exception.SystemException; 524 525 /** 526 * 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. 527 * 528 * @param pk the primary key of the permission 529 * @param groups the groups to be associated with the permission 530 * @throws SystemException if a system exception occurred 531 */ 532 public void setGroups(long pk, 533 java.util.List<com.liferay.portal.model.Group> groups) 534 throws com.liferay.portal.kernel.exception.SystemException; 535 536 /** 537 * Returns all the roles associated with the permission. 538 * 539 * @param pk the primary key of the permission 540 * @return the roles associated with the permission 541 * @throws SystemException if a system exception occurred 542 */ 543 public java.util.List<com.liferay.portal.model.Role> getRoles(long pk) 544 throws com.liferay.portal.kernel.exception.SystemException; 545 546 /** 547 * Returns a range of all the roles associated with the permission. 548 * 549 * <p> 550 * 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. 551 * </p> 552 * 553 * @param pk the primary key of the permission 554 * @param start the lower bound of the range of permissions 555 * @param end the upper bound of the range of permissions (not inclusive) 556 * @return the range of roles associated with the permission 557 * @throws SystemException if a system exception occurred 558 */ 559 public java.util.List<com.liferay.portal.model.Role> getRoles(long pk, 560 int start, int end) 561 throws com.liferay.portal.kernel.exception.SystemException; 562 563 /** 564 * Returns an ordered range of all the roles associated with the permission. 565 * 566 * <p> 567 * 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. 568 * </p> 569 * 570 * @param pk the primary key of the permission 571 * @param start the lower bound of the range of permissions 572 * @param end the upper bound of the range of permissions (not inclusive) 573 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 574 * @return the ordered range of roles associated with the permission 575 * @throws SystemException if a system exception occurred 576 */ 577 public java.util.List<com.liferay.portal.model.Role> getRoles(long pk, 578 int start, int end, 579 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 580 throws com.liferay.portal.kernel.exception.SystemException; 581 582 /** 583 * Returns the number of roles associated with the permission. 584 * 585 * @param pk the primary key of the permission 586 * @return the number of roles associated with the permission 587 * @throws SystemException if a system exception occurred 588 */ 589 public int getRolesSize(long pk) 590 throws com.liferay.portal.kernel.exception.SystemException; 591 592 /** 593 * Returns <code>true</code> if the role is associated with the permission. 594 * 595 * @param pk the primary key of the permission 596 * @param rolePK the primary key of the role 597 * @return <code>true</code> if the role is associated with the permission; <code>false</code> otherwise 598 * @throws SystemException if a system exception occurred 599 */ 600 public boolean containsRole(long pk, long rolePK) 601 throws com.liferay.portal.kernel.exception.SystemException; 602 603 /** 604 * Returns <code>true</code> if the permission has any roles associated with it. 605 * 606 * @param pk the primary key of the permission to check for associations with roles 607 * @return <code>true</code> if the permission has any roles associated with it; <code>false</code> otherwise 608 * @throws SystemException if a system exception occurred 609 */ 610 public boolean containsRoles(long pk) 611 throws com.liferay.portal.kernel.exception.SystemException; 612 613 /** 614 * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 615 * 616 * @param pk the primary key of the permission 617 * @param rolePK the primary key of the role 618 * @throws SystemException if a system exception occurred 619 */ 620 public void addRole(long pk, long rolePK) 621 throws com.liferay.portal.kernel.exception.SystemException; 622 623 /** 624 * Adds an association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 625 * 626 * @param pk the primary key of the permission 627 * @param role the role 628 * @throws SystemException if a system exception occurred 629 */ 630 public void addRole(long pk, com.liferay.portal.model.Role role) 631 throws com.liferay.portal.kernel.exception.SystemException; 632 633 /** 634 * Adds an association between the permission and the roles. 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 rolePKs the primary keys of the roles 638 * @throws SystemException if a system exception occurred 639 */ 640 public void addRoles(long pk, long[] rolePKs) 641 throws com.liferay.portal.kernel.exception.SystemException; 642 643 /** 644 * Adds an association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 645 * 646 * @param pk the primary key of the permission 647 * @param roles the roles 648 * @throws SystemException if a system exception occurred 649 */ 650 public void addRoles(long pk, 651 java.util.List<com.liferay.portal.model.Role> roles) 652 throws com.liferay.portal.kernel.exception.SystemException; 653 654 /** 655 * Clears all associations between the permission and its roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 656 * 657 * @param pk the primary key of the permission to clear the associated roles from 658 * @throws SystemException if a system exception occurred 659 */ 660 public void clearRoles(long pk) 661 throws com.liferay.portal.kernel.exception.SystemException; 662 663 /** 664 * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 665 * 666 * @param pk the primary key of the permission 667 * @param rolePK the primary key of the role 668 * @throws SystemException if a system exception occurred 669 */ 670 public void removeRole(long pk, long rolePK) 671 throws com.liferay.portal.kernel.exception.SystemException; 672 673 /** 674 * Removes the association between the permission and the role. Also notifies the appropriate model listeners and clears the mapping table finder cache. 675 * 676 * @param pk the primary key of the permission 677 * @param role the role 678 * @throws SystemException if a system exception occurred 679 */ 680 public void removeRole(long pk, com.liferay.portal.model.Role role) 681 throws com.liferay.portal.kernel.exception.SystemException; 682 683 /** 684 * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 685 * 686 * @param pk the primary key of the permission 687 * @param rolePKs the primary keys of the roles 688 * @throws SystemException if a system exception occurred 689 */ 690 public void removeRoles(long pk, long[] rolePKs) 691 throws com.liferay.portal.kernel.exception.SystemException; 692 693 /** 694 * Removes the association between the permission and the roles. Also notifies the appropriate model listeners and clears the mapping table finder cache. 695 * 696 * @param pk the primary key of the permission 697 * @param roles the roles 698 * @throws SystemException if a system exception occurred 699 */ 700 public void removeRoles(long pk, 701 java.util.List<com.liferay.portal.model.Role> roles) 702 throws com.liferay.portal.kernel.exception.SystemException; 703 704 /** 705 * 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. 706 * 707 * @param pk the primary key of the permission 708 * @param rolePKs the primary keys of the roles to be associated with the permission 709 * @throws SystemException if a system exception occurred 710 */ 711 public void setRoles(long pk, long[] rolePKs) 712 throws com.liferay.portal.kernel.exception.SystemException; 713 714 /** 715 * 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. 716 * 717 * @param pk the primary key of the permission 718 * @param roles the roles to be associated with the permission 719 * @throws SystemException if a system exception occurred 720 */ 721 public void setRoles(long pk, 722 java.util.List<com.liferay.portal.model.Role> roles) 723 throws com.liferay.portal.kernel.exception.SystemException; 724 725 /** 726 * Returns all the users associated with the permission. 727 * 728 * @param pk the primary key of the permission 729 * @return the users associated with the permission 730 * @throws SystemException if a system exception occurred 731 */ 732 public java.util.List<com.liferay.portal.model.User> getUsers(long pk) 733 throws com.liferay.portal.kernel.exception.SystemException; 734 735 /** 736 * Returns a range of all the users associated with the permission. 737 * 738 * <p> 739 * 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. 740 * </p> 741 * 742 * @param pk the primary key of the permission 743 * @param start the lower bound of the range of permissions 744 * @param end the upper bound of the range of permissions (not inclusive) 745 * @return the range of users associated with the permission 746 * @throws SystemException if a system exception occurred 747 */ 748 public java.util.List<com.liferay.portal.model.User> getUsers(long pk, 749 int start, int end) 750 throws com.liferay.portal.kernel.exception.SystemException; 751 752 /** 753 * Returns an ordered range of all the users associated with the permission. 754 * 755 * <p> 756 * 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. 757 * </p> 758 * 759 * @param pk the primary key of the permission 760 * @param start the lower bound of the range of permissions 761 * @param end the upper bound of the range of permissions (not inclusive) 762 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 763 * @return the ordered range of users associated with the permission 764 * @throws SystemException if a system exception occurred 765 */ 766 public java.util.List<com.liferay.portal.model.User> getUsers(long pk, 767 int start, int end, 768 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 769 throws com.liferay.portal.kernel.exception.SystemException; 770 771 /** 772 * Returns the number of users associated with the permission. 773 * 774 * @param pk the primary key of the permission 775 * @return the number of users associated with the permission 776 * @throws SystemException if a system exception occurred 777 */ 778 public int getUsersSize(long pk) 779 throws com.liferay.portal.kernel.exception.SystemException; 780 781 /** 782 * Returns <code>true</code> if the user is associated with the permission. 783 * 784 * @param pk the primary key of the permission 785 * @param userPK the primary key of the user 786 * @return <code>true</code> if the user is associated with the permission; <code>false</code> otherwise 787 * @throws SystemException if a system exception occurred 788 */ 789 public boolean containsUser(long pk, long userPK) 790 throws com.liferay.portal.kernel.exception.SystemException; 791 792 /** 793 * Returns <code>true</code> if the permission has any users associated with it. 794 * 795 * @param pk the primary key of the permission to check for associations with users 796 * @return <code>true</code> if the permission has any users associated with it; <code>false</code> otherwise 797 * @throws SystemException if a system exception occurred 798 */ 799 public boolean containsUsers(long pk) 800 throws com.liferay.portal.kernel.exception.SystemException; 801 802 /** 803 * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 804 * 805 * @param pk the primary key of the permission 806 * @param userPK the primary key of the user 807 * @throws SystemException if a system exception occurred 808 */ 809 public void addUser(long pk, long userPK) 810 throws com.liferay.portal.kernel.exception.SystemException; 811 812 /** 813 * Adds an association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 814 * 815 * @param pk the primary key of the permission 816 * @param user the user 817 * @throws SystemException if a system exception occurred 818 */ 819 public void addUser(long pk, com.liferay.portal.model.User user) 820 throws com.liferay.portal.kernel.exception.SystemException; 821 822 /** 823 * Adds an association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 824 * 825 * @param pk the primary key of the permission 826 * @param userPKs the primary keys of the users 827 * @throws SystemException if a system exception occurred 828 */ 829 public void addUsers(long pk, long[] userPKs) 830 throws com.liferay.portal.kernel.exception.SystemException; 831 832 /** 833 * Adds an association between the permission and the users. 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 users the users 837 * @throws SystemException if a system exception occurred 838 */ 839 public void addUsers(long pk, 840 java.util.List<com.liferay.portal.model.User> users) 841 throws com.liferay.portal.kernel.exception.SystemException; 842 843 /** 844 * Clears all associations between the permission and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 845 * 846 * @param pk the primary key of the permission to clear the associated users from 847 * @throws SystemException if a system exception occurred 848 */ 849 public void clearUsers(long pk) 850 throws com.liferay.portal.kernel.exception.SystemException; 851 852 /** 853 * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 854 * 855 * @param pk the primary key of the permission 856 * @param userPK the primary key of the user 857 * @throws SystemException if a system exception occurred 858 */ 859 public void removeUser(long pk, long userPK) 860 throws com.liferay.portal.kernel.exception.SystemException; 861 862 /** 863 * Removes the association between the permission and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 864 * 865 * @param pk the primary key of the permission 866 * @param user the user 867 * @throws SystemException if a system exception occurred 868 */ 869 public void removeUser(long pk, com.liferay.portal.model.User user) 870 throws com.liferay.portal.kernel.exception.SystemException; 871 872 /** 873 * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 874 * 875 * @param pk the primary key of the permission 876 * @param userPKs the primary keys of the users 877 * @throws SystemException if a system exception occurred 878 */ 879 public void removeUsers(long pk, long[] userPKs) 880 throws com.liferay.portal.kernel.exception.SystemException; 881 882 /** 883 * Removes the association between the permission and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 884 * 885 * @param pk the primary key of the permission 886 * @param users the users 887 * @throws SystemException if a system exception occurred 888 */ 889 public void removeUsers(long pk, 890 java.util.List<com.liferay.portal.model.User> users) 891 throws com.liferay.portal.kernel.exception.SystemException; 892 893 /** 894 * 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. 895 * 896 * @param pk the primary key of the permission 897 * @param userPKs the primary keys of the users to be associated with the permission 898 * @throws SystemException if a system exception occurred 899 */ 900 public void setUsers(long pk, long[] userPKs) 901 throws com.liferay.portal.kernel.exception.SystemException; 902 903 /** 904 * 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. 905 * 906 * @param pk the primary key of the permission 907 * @param users the users to be associated with the permission 908 * @throws SystemException if a system exception occurred 909 */ 910 public void setUsers(long pk, 911 java.util.List<com.liferay.portal.model.User> users) 912 throws com.liferay.portal.kernel.exception.SystemException; 913 914 public Permission remove(Permission permission) throws SystemException; 915 }