001 /** 002 * Copyright (c) 2000-2010 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.model.Role; 022 import com.liferay.portal.service.ServiceContext; 023 024 import java.util.List; 025 026 /** 027 * The persistence utility for the role service. This utility wraps {@link RolePersistenceImpl} 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. 028 * 029 * <p> 030 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 031 * </p> 032 * 033 * <p> 034 * Caching information and settings can be found in <code>portal.properties</code> 035 * </p> 036 * 037 * @author Brian Wing Shun Chan 038 * @see RolePersistence 039 * @see RolePersistenceImpl 040 * @generated 041 */ 042 public class RoleUtil { 043 /** 044 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 045 */ 046 public static void clearCache() { 047 getPersistence().clearCache(); 048 } 049 050 /** 051 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 052 */ 053 public static void clearCache(Role role) { 054 getPersistence().clearCache(role); 055 } 056 057 /** 058 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 059 */ 060 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 061 throws SystemException { 062 return getPersistence().countWithDynamicQuery(dynamicQuery); 063 } 064 065 /** 066 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 067 */ 068 public static List<Role> findWithDynamicQuery(DynamicQuery dynamicQuery) 069 throws SystemException { 070 return getPersistence().findWithDynamicQuery(dynamicQuery); 071 } 072 073 /** 074 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 075 */ 076 public static List<Role> findWithDynamicQuery(DynamicQuery dynamicQuery, 077 int start, int end) throws SystemException { 078 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 079 } 080 081 /** 082 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 083 */ 084 public static List<Role> findWithDynamicQuery(DynamicQuery dynamicQuery, 085 int start, int end, OrderByComparator orderByComparator) 086 throws SystemException { 087 return getPersistence() 088 .findWithDynamicQuery(dynamicQuery, start, end, 089 orderByComparator); 090 } 091 092 /** 093 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 094 */ 095 public static Role remove(Role role) throws SystemException { 096 return getPersistence().remove(role); 097 } 098 099 /** 100 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 101 */ 102 public static Role update(Role role, boolean merge) 103 throws SystemException { 104 return getPersistence().update(role, merge); 105 } 106 107 /** 108 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 109 */ 110 public static Role update(Role role, boolean merge, 111 ServiceContext serviceContext) throws SystemException { 112 return getPersistence().update(role, merge, serviceContext); 113 } 114 115 /** 116 * Caches the role in the entity cache if it is enabled. 117 * 118 * @param role the role to cache 119 */ 120 public static void cacheResult(com.liferay.portal.model.Role role) { 121 getPersistence().cacheResult(role); 122 } 123 124 /** 125 * Caches the roles in the entity cache if it is enabled. 126 * 127 * @param roles the roles to cache 128 */ 129 public static void cacheResult( 130 java.util.List<com.liferay.portal.model.Role> roles) { 131 getPersistence().cacheResult(roles); 132 } 133 134 /** 135 * Creates a new role with the primary key. Does not add the role to the database. 136 * 137 * @param roleId the primary key for the new role 138 * @return the new role 139 */ 140 public static com.liferay.portal.model.Role create(long roleId) { 141 return getPersistence().create(roleId); 142 } 143 144 /** 145 * Removes the role with the primary key from the database. Also notifies the appropriate model listeners. 146 * 147 * @param roleId the primary key of the role to remove 148 * @return the role that was removed 149 * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found 150 * @throws SystemException if a system exception occurred 151 */ 152 public static com.liferay.portal.model.Role remove(long roleId) 153 throws com.liferay.portal.NoSuchRoleException, 154 com.liferay.portal.kernel.exception.SystemException { 155 return getPersistence().remove(roleId); 156 } 157 158 public static com.liferay.portal.model.Role updateImpl( 159 com.liferay.portal.model.Role role, boolean merge) 160 throws com.liferay.portal.kernel.exception.SystemException { 161 return getPersistence().updateImpl(role, merge); 162 } 163 164 /** 165 * Finds the role with the primary key or throws a {@link com.liferay.portal.NoSuchRoleException} if it could not be found. 166 * 167 * @param roleId the primary key of the role to find 168 * @return the role 169 * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found 170 * @throws SystemException if a system exception occurred 171 */ 172 public static com.liferay.portal.model.Role findByPrimaryKey(long roleId) 173 throws com.liferay.portal.NoSuchRoleException, 174 com.liferay.portal.kernel.exception.SystemException { 175 return getPersistence().findByPrimaryKey(roleId); 176 } 177 178 /** 179 * Finds the role with the primary key or returns <code>null</code> if it could not be found. 180 * 181 * @param roleId the primary key of the role to find 182 * @return the role, or <code>null</code> if a role with the primary key could not be found 183 * @throws SystemException if a system exception occurred 184 */ 185 public static com.liferay.portal.model.Role fetchByPrimaryKey(long roleId) 186 throws com.liferay.portal.kernel.exception.SystemException { 187 return getPersistence().fetchByPrimaryKey(roleId); 188 } 189 190 /** 191 * Finds all the roles where companyId = ?. 192 * 193 * @param companyId the company id to search with 194 * @return the matching roles 195 * @throws SystemException if a system exception occurred 196 */ 197 public static java.util.List<com.liferay.portal.model.Role> findByCompanyId( 198 long companyId) 199 throws com.liferay.portal.kernel.exception.SystemException { 200 return getPersistence().findByCompanyId(companyId); 201 } 202 203 /** 204 * Finds a range of all the roles where companyId = ?. 205 * 206 * <p> 207 * 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. 208 * </p> 209 * 210 * @param companyId the company id to search with 211 * @param start the lower bound of the range of roles to return 212 * @param end the upper bound of the range of roles to return (not inclusive) 213 * @return the range of matching roles 214 * @throws SystemException if a system exception occurred 215 */ 216 public static java.util.List<com.liferay.portal.model.Role> findByCompanyId( 217 long companyId, int start, int end) 218 throws com.liferay.portal.kernel.exception.SystemException { 219 return getPersistence().findByCompanyId(companyId, start, end); 220 } 221 222 /** 223 * Finds an ordered range of all the roles where companyId = ?. 224 * 225 * <p> 226 * 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. 227 * </p> 228 * 229 * @param companyId the company id to search with 230 * @param start the lower bound of the range of roles to return 231 * @param end the upper bound of the range of roles to return (not inclusive) 232 * @param orderByComparator the comparator to order the results by 233 * @return the ordered range of matching roles 234 * @throws SystemException if a system exception occurred 235 */ 236 public static java.util.List<com.liferay.portal.model.Role> findByCompanyId( 237 long companyId, int start, int end, 238 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 239 throws com.liferay.portal.kernel.exception.SystemException { 240 return getPersistence() 241 .findByCompanyId(companyId, start, end, orderByComparator); 242 } 243 244 /** 245 * Finds the first role in the ordered set where companyId = ?. 246 * 247 * <p> 248 * 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. 249 * </p> 250 * 251 * @param companyId the company id to search with 252 * @param orderByComparator the comparator to order the set by 253 * @return the first matching role 254 * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found 255 * @throws SystemException if a system exception occurred 256 */ 257 public static com.liferay.portal.model.Role findByCompanyId_First( 258 long companyId, 259 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 260 throws com.liferay.portal.NoSuchRoleException, 261 com.liferay.portal.kernel.exception.SystemException { 262 return getPersistence() 263 .findByCompanyId_First(companyId, orderByComparator); 264 } 265 266 /** 267 * Finds the last role in the ordered set where companyId = ?. 268 * 269 * <p> 270 * 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. 271 * </p> 272 * 273 * @param companyId the company id to search with 274 * @param orderByComparator the comparator to order the set by 275 * @return the last matching role 276 * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found 277 * @throws SystemException if a system exception occurred 278 */ 279 public static com.liferay.portal.model.Role findByCompanyId_Last( 280 long companyId, 281 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 282 throws com.liferay.portal.NoSuchRoleException, 283 com.liferay.portal.kernel.exception.SystemException { 284 return getPersistence() 285 .findByCompanyId_Last(companyId, orderByComparator); 286 } 287 288 /** 289 * Finds the roles before and after the current role in the ordered set where companyId = ?. 290 * 291 * <p> 292 * 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. 293 * </p> 294 * 295 * @param roleId the primary key of the current role 296 * @param companyId the company id to search with 297 * @param orderByComparator the comparator to order the set by 298 * @return the previous, current, and next role 299 * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found 300 * @throws SystemException if a system exception occurred 301 */ 302 public static com.liferay.portal.model.Role[] findByCompanyId_PrevAndNext( 303 long roleId, long companyId, 304 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 305 throws com.liferay.portal.NoSuchRoleException, 306 com.liferay.portal.kernel.exception.SystemException { 307 return getPersistence() 308 .findByCompanyId_PrevAndNext(roleId, companyId, 309 orderByComparator); 310 } 311 312 /** 313 * Finds all the roles where subtype = ?. 314 * 315 * @param subtype the subtype to search with 316 * @return the matching roles 317 * @throws SystemException if a system exception occurred 318 */ 319 public static java.util.List<com.liferay.portal.model.Role> findBySubtype( 320 java.lang.String subtype) 321 throws com.liferay.portal.kernel.exception.SystemException { 322 return getPersistence().findBySubtype(subtype); 323 } 324 325 /** 326 * Finds a range of all the roles where subtype = ?. 327 * 328 * <p> 329 * 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. 330 * </p> 331 * 332 * @param subtype the subtype to search with 333 * @param start the lower bound of the range of roles to return 334 * @param end the upper bound of the range of roles to return (not inclusive) 335 * @return the range of matching roles 336 * @throws SystemException if a system exception occurred 337 */ 338 public static java.util.List<com.liferay.portal.model.Role> findBySubtype( 339 java.lang.String subtype, int start, int end) 340 throws com.liferay.portal.kernel.exception.SystemException { 341 return getPersistence().findBySubtype(subtype, start, end); 342 } 343 344 /** 345 * Finds an ordered range of all the roles where subtype = ?. 346 * 347 * <p> 348 * 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. 349 * </p> 350 * 351 * @param subtype the subtype to search with 352 * @param start the lower bound of the range of roles to return 353 * @param end the upper bound of the range of roles to return (not inclusive) 354 * @param orderByComparator the comparator to order the results by 355 * @return the ordered range of matching roles 356 * @throws SystemException if a system exception occurred 357 */ 358 public static java.util.List<com.liferay.portal.model.Role> findBySubtype( 359 java.lang.String subtype, int start, int end, 360 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 361 throws com.liferay.portal.kernel.exception.SystemException { 362 return getPersistence() 363 .findBySubtype(subtype, start, end, orderByComparator); 364 } 365 366 /** 367 * Finds the first role in the ordered set where subtype = ?. 368 * 369 * <p> 370 * 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. 371 * </p> 372 * 373 * @param subtype the subtype to search with 374 * @param orderByComparator the comparator to order the set by 375 * @return the first matching role 376 * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found 377 * @throws SystemException if a system exception occurred 378 */ 379 public static com.liferay.portal.model.Role findBySubtype_First( 380 java.lang.String subtype, 381 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 382 throws com.liferay.portal.NoSuchRoleException, 383 com.liferay.portal.kernel.exception.SystemException { 384 return getPersistence().findBySubtype_First(subtype, orderByComparator); 385 } 386 387 /** 388 * Finds the last role in the ordered set where subtype = ?. 389 * 390 * <p> 391 * 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. 392 * </p> 393 * 394 * @param subtype the subtype to search with 395 * @param orderByComparator the comparator to order the set by 396 * @return the last matching role 397 * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found 398 * @throws SystemException if a system exception occurred 399 */ 400 public static com.liferay.portal.model.Role findBySubtype_Last( 401 java.lang.String subtype, 402 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 403 throws com.liferay.portal.NoSuchRoleException, 404 com.liferay.portal.kernel.exception.SystemException { 405 return getPersistence().findBySubtype_Last(subtype, orderByComparator); 406 } 407 408 /** 409 * Finds the roles before and after the current role in the ordered set where subtype = ?. 410 * 411 * <p> 412 * 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. 413 * </p> 414 * 415 * @param roleId the primary key of the current role 416 * @param subtype the subtype to search with 417 * @param orderByComparator the comparator to order the set by 418 * @return the previous, current, and next role 419 * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found 420 * @throws SystemException if a system exception occurred 421 */ 422 public static com.liferay.portal.model.Role[] findBySubtype_PrevAndNext( 423 long roleId, java.lang.String subtype, 424 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 425 throws com.liferay.portal.NoSuchRoleException, 426 com.liferay.portal.kernel.exception.SystemException { 427 return getPersistence() 428 .findBySubtype_PrevAndNext(roleId, subtype, orderByComparator); 429 } 430 431 /** 432 * Finds the role where companyId = ? and name = ? or throws a {@link com.liferay.portal.NoSuchRoleException} if it could not be found. 433 * 434 * @param companyId the company id to search with 435 * @param name the name to search with 436 * @return the matching role 437 * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found 438 * @throws SystemException if a system exception occurred 439 */ 440 public static com.liferay.portal.model.Role findByC_N(long companyId, 441 java.lang.String name) 442 throws com.liferay.portal.NoSuchRoleException, 443 com.liferay.portal.kernel.exception.SystemException { 444 return getPersistence().findByC_N(companyId, name); 445 } 446 447 /** 448 * Finds the role where companyId = ? and name = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 449 * 450 * @param companyId the company id to search with 451 * @param name the name to search with 452 * @return the matching role, or <code>null</code> if a matching role could not be found 453 * @throws SystemException if a system exception occurred 454 */ 455 public static com.liferay.portal.model.Role fetchByC_N(long companyId, 456 java.lang.String name) 457 throws com.liferay.portal.kernel.exception.SystemException { 458 return getPersistence().fetchByC_N(companyId, name); 459 } 460 461 /** 462 * Finds the role where companyId = ? and name = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 463 * 464 * @param companyId the company id to search with 465 * @param name the name to search with 466 * @return the matching role, or <code>null</code> if a matching role could not be found 467 * @throws SystemException if a system exception occurred 468 */ 469 public static com.liferay.portal.model.Role fetchByC_N(long companyId, 470 java.lang.String name, boolean retrieveFromCache) 471 throws com.liferay.portal.kernel.exception.SystemException { 472 return getPersistence().fetchByC_N(companyId, name, retrieveFromCache); 473 } 474 475 /** 476 * Finds all the roles where type = ? and subtype = ?. 477 * 478 * @param type the type to search with 479 * @param subtype the subtype to search with 480 * @return the matching roles 481 * @throws SystemException if a system exception occurred 482 */ 483 public static java.util.List<com.liferay.portal.model.Role> findByT_S( 484 int type, java.lang.String subtype) 485 throws com.liferay.portal.kernel.exception.SystemException { 486 return getPersistence().findByT_S(type, subtype); 487 } 488 489 /** 490 * Finds a range of all the roles where type = ? and subtype = ?. 491 * 492 * <p> 493 * 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. 494 * </p> 495 * 496 * @param type the type to search with 497 * @param subtype the subtype to search with 498 * @param start the lower bound of the range of roles to return 499 * @param end the upper bound of the range of roles to return (not inclusive) 500 * @return the range of matching roles 501 * @throws SystemException if a system exception occurred 502 */ 503 public static java.util.List<com.liferay.portal.model.Role> findByT_S( 504 int type, java.lang.String subtype, int start, int end) 505 throws com.liferay.portal.kernel.exception.SystemException { 506 return getPersistence().findByT_S(type, subtype, start, end); 507 } 508 509 /** 510 * Finds an ordered range of all the roles where type = ? and subtype = ?. 511 * 512 * <p> 513 * 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. 514 * </p> 515 * 516 * @param type the type to search with 517 * @param subtype the subtype to search with 518 * @param start the lower bound of the range of roles to return 519 * @param end the upper bound of the range of roles to return (not inclusive) 520 * @param orderByComparator the comparator to order the results by 521 * @return the ordered range of matching roles 522 * @throws SystemException if a system exception occurred 523 */ 524 public static java.util.List<com.liferay.portal.model.Role> findByT_S( 525 int type, java.lang.String subtype, int start, int end, 526 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 527 throws com.liferay.portal.kernel.exception.SystemException { 528 return getPersistence() 529 .findByT_S(type, subtype, start, end, orderByComparator); 530 } 531 532 /** 533 * Finds the first role in the ordered set where type = ? and subtype = ?. 534 * 535 * <p> 536 * 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. 537 * </p> 538 * 539 * @param type the type to search with 540 * @param subtype the subtype to search with 541 * @param orderByComparator the comparator to order the set by 542 * @return the first matching role 543 * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found 544 * @throws SystemException if a system exception occurred 545 */ 546 public static com.liferay.portal.model.Role findByT_S_First(int type, 547 java.lang.String subtype, 548 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 549 throws com.liferay.portal.NoSuchRoleException, 550 com.liferay.portal.kernel.exception.SystemException { 551 return getPersistence().findByT_S_First(type, subtype, orderByComparator); 552 } 553 554 /** 555 * Finds the last role in the ordered set where type = ? and subtype = ?. 556 * 557 * <p> 558 * 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. 559 * </p> 560 * 561 * @param type the type to search with 562 * @param subtype the subtype to search with 563 * @param orderByComparator the comparator to order the set by 564 * @return the last matching role 565 * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found 566 * @throws SystemException if a system exception occurred 567 */ 568 public static com.liferay.portal.model.Role findByT_S_Last(int type, 569 java.lang.String subtype, 570 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 571 throws com.liferay.portal.NoSuchRoleException, 572 com.liferay.portal.kernel.exception.SystemException { 573 return getPersistence().findByT_S_Last(type, subtype, orderByComparator); 574 } 575 576 /** 577 * Finds the roles before and after the current role in the ordered set where type = ? and subtype = ?. 578 * 579 * <p> 580 * 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. 581 * </p> 582 * 583 * @param roleId the primary key of the current role 584 * @param type the type to search with 585 * @param subtype the subtype to search with 586 * @param orderByComparator the comparator to order the set by 587 * @return the previous, current, and next role 588 * @throws com.liferay.portal.NoSuchRoleException if a role with the primary key could not be found 589 * @throws SystemException if a system exception occurred 590 */ 591 public static com.liferay.portal.model.Role[] findByT_S_PrevAndNext( 592 long roleId, int type, java.lang.String subtype, 593 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 594 throws com.liferay.portal.NoSuchRoleException, 595 com.liferay.portal.kernel.exception.SystemException { 596 return getPersistence() 597 .findByT_S_PrevAndNext(roleId, type, subtype, 598 orderByComparator); 599 } 600 601 /** 602 * Finds the role where companyId = ? and classNameId = ? and classPK = ? or throws a {@link com.liferay.portal.NoSuchRoleException} if it could not be found. 603 * 604 * @param companyId the company id to search with 605 * @param classNameId the class name id to search with 606 * @param classPK the class p k to search with 607 * @return the matching role 608 * @throws com.liferay.portal.NoSuchRoleException if a matching role could not be found 609 * @throws SystemException if a system exception occurred 610 */ 611 public static com.liferay.portal.model.Role findByC_C_C(long companyId, 612 long classNameId, long classPK) 613 throws com.liferay.portal.NoSuchRoleException, 614 com.liferay.portal.kernel.exception.SystemException { 615 return getPersistence().findByC_C_C(companyId, classNameId, classPK); 616 } 617 618 /** 619 * Finds the role where companyId = ? and classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 620 * 621 * @param companyId the company id to search with 622 * @param classNameId the class name id to search with 623 * @param classPK the class p k to search with 624 * @return the matching role, or <code>null</code> if a matching role could not be found 625 * @throws SystemException if a system exception occurred 626 */ 627 public static com.liferay.portal.model.Role fetchByC_C_C(long companyId, 628 long classNameId, long classPK) 629 throws com.liferay.portal.kernel.exception.SystemException { 630 return getPersistence().fetchByC_C_C(companyId, classNameId, classPK); 631 } 632 633 /** 634 * Finds the role where companyId = ? and classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 635 * 636 * @param companyId the company id to search with 637 * @param classNameId the class name id to search with 638 * @param classPK the class p k to search with 639 * @return the matching role, or <code>null</code> if a matching role could not be found 640 * @throws SystemException if a system exception occurred 641 */ 642 public static com.liferay.portal.model.Role fetchByC_C_C(long companyId, 643 long classNameId, long classPK, boolean retrieveFromCache) 644 throws com.liferay.portal.kernel.exception.SystemException { 645 return getPersistence() 646 .fetchByC_C_C(companyId, classNameId, classPK, 647 retrieveFromCache); 648 } 649 650 /** 651 * Finds all the roles. 652 * 653 * @return the roles 654 * @throws SystemException if a system exception occurred 655 */ 656 public static java.util.List<com.liferay.portal.model.Role> findAll() 657 throws com.liferay.portal.kernel.exception.SystemException { 658 return getPersistence().findAll(); 659 } 660 661 /** 662 * Finds a range of all the roles. 663 * 664 * <p> 665 * 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. 666 * </p> 667 * 668 * @param start the lower bound of the range of roles to return 669 * @param end the upper bound of the range of roles to return (not inclusive) 670 * @return the range of roles 671 * @throws SystemException if a system exception occurred 672 */ 673 public static java.util.List<com.liferay.portal.model.Role> findAll( 674 int start, int end) 675 throws com.liferay.portal.kernel.exception.SystemException { 676 return getPersistence().findAll(start, end); 677 } 678 679 /** 680 * Finds an ordered range of all the roles. 681 * 682 * <p> 683 * 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. 684 * </p> 685 * 686 * @param start the lower bound of the range of roles to return 687 * @param end the upper bound of the range of roles to return (not inclusive) 688 * @param orderByComparator the comparator to order the results by 689 * @return the ordered range of roles 690 * @throws SystemException if a system exception occurred 691 */ 692 public static java.util.List<com.liferay.portal.model.Role> findAll( 693 int start, int end, 694 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 695 throws com.liferay.portal.kernel.exception.SystemException { 696 return getPersistence().findAll(start, end, orderByComparator); 697 } 698 699 /** 700 * Removes all the roles where companyId = ? from the database. 701 * 702 * @param companyId the company id to search with 703 * @throws SystemException if a system exception occurred 704 */ 705 public static void removeByCompanyId(long companyId) 706 throws com.liferay.portal.kernel.exception.SystemException { 707 getPersistence().removeByCompanyId(companyId); 708 } 709 710 /** 711 * Removes all the roles where subtype = ? from the database. 712 * 713 * @param subtype the subtype to search with 714 * @throws SystemException if a system exception occurred 715 */ 716 public static void removeBySubtype(java.lang.String subtype) 717 throws com.liferay.portal.kernel.exception.SystemException { 718 getPersistence().removeBySubtype(subtype); 719 } 720 721 /** 722 * Removes the role where companyId = ? and name = ? from the database. 723 * 724 * @param companyId the company id to search with 725 * @param name the name to search with 726 * @throws SystemException if a system exception occurred 727 */ 728 public static void removeByC_N(long companyId, java.lang.String name) 729 throws com.liferay.portal.NoSuchRoleException, 730 com.liferay.portal.kernel.exception.SystemException { 731 getPersistence().removeByC_N(companyId, name); 732 } 733 734 /** 735 * Removes all the roles where type = ? and subtype = ? from the database. 736 * 737 * @param type the type to search with 738 * @param subtype the subtype to search with 739 * @throws SystemException if a system exception occurred 740 */ 741 public static void removeByT_S(int type, java.lang.String subtype) 742 throws com.liferay.portal.kernel.exception.SystemException { 743 getPersistence().removeByT_S(type, subtype); 744 } 745 746 /** 747 * Removes the role where companyId = ? and classNameId = ? and classPK = ? from the database. 748 * 749 * @param companyId the company id to search with 750 * @param classNameId the class name id to search with 751 * @param classPK the class p k to search with 752 * @throws SystemException if a system exception occurred 753 */ 754 public static void removeByC_C_C(long companyId, long classNameId, 755 long classPK) 756 throws com.liferay.portal.NoSuchRoleException, 757 com.liferay.portal.kernel.exception.SystemException { 758 getPersistence().removeByC_C_C(companyId, classNameId, classPK); 759 } 760 761 /** 762 * Removes all the roles from the database. 763 * 764 * @throws SystemException if a system exception occurred 765 */ 766 public static void removeAll() 767 throws com.liferay.portal.kernel.exception.SystemException { 768 getPersistence().removeAll(); 769 } 770 771 /** 772 * Counts all the roles where companyId = ?. 773 * 774 * @param companyId the company id to search with 775 * @return the number of matching roles 776 * @throws SystemException if a system exception occurred 777 */ 778 public static int countByCompanyId(long companyId) 779 throws com.liferay.portal.kernel.exception.SystemException { 780 return getPersistence().countByCompanyId(companyId); 781 } 782 783 /** 784 * Counts all the roles where subtype = ?. 785 * 786 * @param subtype the subtype to search with 787 * @return the number of matching roles 788 * @throws SystemException if a system exception occurred 789 */ 790 public static int countBySubtype(java.lang.String subtype) 791 throws com.liferay.portal.kernel.exception.SystemException { 792 return getPersistence().countBySubtype(subtype); 793 } 794 795 /** 796 * Counts all the roles where companyId = ? and name = ?. 797 * 798 * @param companyId the company id to search with 799 * @param name the name to search with 800 * @return the number of matching roles 801 * @throws SystemException if a system exception occurred 802 */ 803 public static int countByC_N(long companyId, java.lang.String name) 804 throws com.liferay.portal.kernel.exception.SystemException { 805 return getPersistence().countByC_N(companyId, name); 806 } 807 808 /** 809 * Counts all the roles where type = ? and subtype = ?. 810 * 811 * @param type the type to search with 812 * @param subtype the subtype to search with 813 * @return the number of matching roles 814 * @throws SystemException if a system exception occurred 815 */ 816 public static int countByT_S(int type, java.lang.String subtype) 817 throws com.liferay.portal.kernel.exception.SystemException { 818 return getPersistence().countByT_S(type, subtype); 819 } 820 821 /** 822 * Counts all the roles where companyId = ? and classNameId = ? and classPK = ?. 823 * 824 * @param companyId the company id to search with 825 * @param classNameId the class name id to search with 826 * @param classPK the class p k to search with 827 * @return the number of matching roles 828 * @throws SystemException if a system exception occurred 829 */ 830 public static int countByC_C_C(long companyId, long classNameId, 831 long classPK) 832 throws com.liferay.portal.kernel.exception.SystemException { 833 return getPersistence().countByC_C_C(companyId, classNameId, classPK); 834 } 835 836 /** 837 * Counts all the roles. 838 * 839 * @return the number of roles 840 * @throws SystemException if a system exception occurred 841 */ 842 public static int countAll() 843 throws com.liferay.portal.kernel.exception.SystemException { 844 return getPersistence().countAll(); 845 } 846 847 /** 848 * Gets all the groups associated with the role. 849 * 850 * @param pk the primary key of the role to get the associated groups for 851 * @return the groups associated with the role 852 * @throws SystemException if a system exception occurred 853 */ 854 public static java.util.List<com.liferay.portal.model.Group> getGroups( 855 long pk) throws com.liferay.portal.kernel.exception.SystemException { 856 return getPersistence().getGroups(pk); 857 } 858 859 /** 860 * Gets a range of all the groups associated with the role. 861 * 862 * <p> 863 * 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. 864 * </p> 865 * 866 * @param pk the primary key of the role to get the associated groups for 867 * @param start the lower bound of the range of roles to return 868 * @param end the upper bound of the range of roles to return (not inclusive) 869 * @return the range of groups associated with the role 870 * @throws SystemException if a system exception occurred 871 */ 872 public static java.util.List<com.liferay.portal.model.Group> getGroups( 873 long pk, int start, int end) 874 throws com.liferay.portal.kernel.exception.SystemException { 875 return getPersistence().getGroups(pk, start, end); 876 } 877 878 /** 879 * Gets an ordered range of all the groups associated with the role. 880 * 881 * <p> 882 * 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. 883 * </p> 884 * 885 * @param pk the primary key of the role to get the associated groups for 886 * @param start the lower bound of the range of roles to return 887 * @param end the upper bound of the range of roles to return (not inclusive) 888 * @param orderByComparator the comparator to order the results by 889 * @return the ordered range of groups associated with the role 890 * @throws SystemException if a system exception occurred 891 */ 892 public static java.util.List<com.liferay.portal.model.Group> getGroups( 893 long pk, int start, int end, 894 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 895 throws com.liferay.portal.kernel.exception.SystemException { 896 return getPersistence().getGroups(pk, start, end, orderByComparator); 897 } 898 899 /** 900 * Gets the number of groups associated with the role. 901 * 902 * @param pk the primary key of the role to get the number of associated groups for 903 * @return the number of groups associated with the role 904 * @throws SystemException if a system exception occurred 905 */ 906 public static int getGroupsSize(long pk) 907 throws com.liferay.portal.kernel.exception.SystemException { 908 return getPersistence().getGroupsSize(pk); 909 } 910 911 /** 912 * Determines whether the group is associated with the role. 913 * 914 * @param pk the primary key of the role 915 * @param groupPK the primary key of the group 916 * @return whether the group is associated with the role 917 * @throws SystemException if a system exception occurred 918 */ 919 public static boolean containsGroup(long pk, long groupPK) 920 throws com.liferay.portal.kernel.exception.SystemException { 921 return getPersistence().containsGroup(pk, groupPK); 922 } 923 924 /** 925 * Determines whether the role has any groups associated with it. 926 * 927 * @param pk the primary key of the role to check for associations with groups 928 * @return whether the role has any groups associated with it 929 * @throws SystemException if a system exception occurred 930 */ 931 public static boolean containsGroups(long pk) 932 throws com.liferay.portal.kernel.exception.SystemException { 933 return getPersistence().containsGroups(pk); 934 } 935 936 /** 937 * Adds an association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 938 * 939 * @param pk the primary key of the role 940 * @param groupPK the primary key of the group 941 * @throws SystemException if a system exception occurred 942 */ 943 public static void addGroup(long pk, long groupPK) 944 throws com.liferay.portal.kernel.exception.SystemException { 945 getPersistence().addGroup(pk, groupPK); 946 } 947 948 /** 949 * Adds an association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 950 * 951 * @param pk the primary key of the role 952 * @param group the group 953 * @throws SystemException if a system exception occurred 954 */ 955 public static void addGroup(long pk, com.liferay.portal.model.Group group) 956 throws com.liferay.portal.kernel.exception.SystemException { 957 getPersistence().addGroup(pk, group); 958 } 959 960 /** 961 * Adds an association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 962 * 963 * @param pk the primary key of the role 964 * @param groupPKs the primary keys of the groups 965 * @throws SystemException if a system exception occurred 966 */ 967 public static void addGroups(long pk, long[] groupPKs) 968 throws com.liferay.portal.kernel.exception.SystemException { 969 getPersistence().addGroups(pk, groupPKs); 970 } 971 972 /** 973 * Adds an association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 974 * 975 * @param pk the primary key of the role 976 * @param groups the groups 977 * @throws SystemException if a system exception occurred 978 */ 979 public static void addGroups(long pk, 980 java.util.List<com.liferay.portal.model.Group> groups) 981 throws com.liferay.portal.kernel.exception.SystemException { 982 getPersistence().addGroups(pk, groups); 983 } 984 985 /** 986 * Clears all associations between the role and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 987 * 988 * @param pk the primary key of the role to clear the associated groups from 989 * @throws SystemException if a system exception occurred 990 */ 991 public static void clearGroups(long pk) 992 throws com.liferay.portal.kernel.exception.SystemException { 993 getPersistence().clearGroups(pk); 994 } 995 996 /** 997 * Removes the association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 998 * 999 * @param pk the primary key of the role 1000 * @param groupPK the primary key of the group 1001 * @throws SystemException if a system exception occurred 1002 */ 1003 public static void removeGroup(long pk, long groupPK) 1004 throws com.liferay.portal.kernel.exception.SystemException { 1005 getPersistence().removeGroup(pk, groupPK); 1006 } 1007 1008 /** 1009 * Removes the association between the role and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1010 * 1011 * @param pk the primary key of the role 1012 * @param group the group 1013 * @throws SystemException if a system exception occurred 1014 */ 1015 public static void removeGroup(long pk, com.liferay.portal.model.Group group) 1016 throws com.liferay.portal.kernel.exception.SystemException { 1017 getPersistence().removeGroup(pk, group); 1018 } 1019 1020 /** 1021 * Removes the association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1022 * 1023 * @param pk the primary key of the role 1024 * @param groupPKs the primary keys of the groups 1025 * @throws SystemException if a system exception occurred 1026 */ 1027 public static void removeGroups(long pk, long[] groupPKs) 1028 throws com.liferay.portal.kernel.exception.SystemException { 1029 getPersistence().removeGroups(pk, groupPKs); 1030 } 1031 1032 /** 1033 * Removes the association between the role and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1034 * 1035 * @param pk the primary key of the role 1036 * @param groups the groups 1037 * @throws SystemException if a system exception occurred 1038 */ 1039 public static void removeGroups(long pk, 1040 java.util.List<com.liferay.portal.model.Group> groups) 1041 throws com.liferay.portal.kernel.exception.SystemException { 1042 getPersistence().removeGroups(pk, groups); 1043 } 1044 1045 /** 1046 * Sets the groups associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1047 * 1048 * @param pk the primary key of the role to set the associations for 1049 * @param groupPKs the primary keys of the groups to be associated with the role 1050 * @throws SystemException if a system exception occurred 1051 */ 1052 public static void setGroups(long pk, long[] groupPKs) 1053 throws com.liferay.portal.kernel.exception.SystemException { 1054 getPersistence().setGroups(pk, groupPKs); 1055 } 1056 1057 /** 1058 * Sets the groups associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1059 * 1060 * @param pk the primary key of the role to set the associations for 1061 * @param groups the groups to be associated with the role 1062 * @throws SystemException if a system exception occurred 1063 */ 1064 public static void setGroups(long pk, 1065 java.util.List<com.liferay.portal.model.Group> groups) 1066 throws com.liferay.portal.kernel.exception.SystemException { 1067 getPersistence().setGroups(pk, groups); 1068 } 1069 1070 /** 1071 * Gets all the permissions associated with the role. 1072 * 1073 * @param pk the primary key of the role to get the associated permissions for 1074 * @return the permissions associated with the role 1075 * @throws SystemException if a system exception occurred 1076 */ 1077 public static java.util.List<com.liferay.portal.model.Permission> getPermissions( 1078 long pk) throws com.liferay.portal.kernel.exception.SystemException { 1079 return getPersistence().getPermissions(pk); 1080 } 1081 1082 /** 1083 * Gets a range of all the permissions associated with the role. 1084 * 1085 * <p> 1086 * 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. 1087 * </p> 1088 * 1089 * @param pk the primary key of the role to get the associated permissions for 1090 * @param start the lower bound of the range of roles to return 1091 * @param end the upper bound of the range of roles to return (not inclusive) 1092 * @return the range of permissions associated with the role 1093 * @throws SystemException if a system exception occurred 1094 */ 1095 public static java.util.List<com.liferay.portal.model.Permission> getPermissions( 1096 long pk, int start, int end) 1097 throws com.liferay.portal.kernel.exception.SystemException { 1098 return getPersistence().getPermissions(pk, start, end); 1099 } 1100 1101 /** 1102 * Gets an ordered range of all the permissions associated with the role. 1103 * 1104 * <p> 1105 * 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. 1106 * </p> 1107 * 1108 * @param pk the primary key of the role to get the associated permissions for 1109 * @param start the lower bound of the range of roles to return 1110 * @param end the upper bound of the range of roles to return (not inclusive) 1111 * @param orderByComparator the comparator to order the results by 1112 * @return the ordered range of permissions associated with the role 1113 * @throws SystemException if a system exception occurred 1114 */ 1115 public static java.util.List<com.liferay.portal.model.Permission> getPermissions( 1116 long pk, int start, int end, 1117 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 1118 throws com.liferay.portal.kernel.exception.SystemException { 1119 return getPersistence().getPermissions(pk, start, end, orderByComparator); 1120 } 1121 1122 /** 1123 * Gets the number of permissions associated with the role. 1124 * 1125 * @param pk the primary key of the role to get the number of associated permissions for 1126 * @return the number of permissions associated with the role 1127 * @throws SystemException if a system exception occurred 1128 */ 1129 public static int getPermissionsSize(long pk) 1130 throws com.liferay.portal.kernel.exception.SystemException { 1131 return getPersistence().getPermissionsSize(pk); 1132 } 1133 1134 /** 1135 * Determines whether the permission is associated with the role. 1136 * 1137 * @param pk the primary key of the role 1138 * @param permissionPK the primary key of the permission 1139 * @return whether the permission is associated with the role 1140 * @throws SystemException if a system exception occurred 1141 */ 1142 public static boolean containsPermission(long pk, long permissionPK) 1143 throws com.liferay.portal.kernel.exception.SystemException { 1144 return getPersistence().containsPermission(pk, permissionPK); 1145 } 1146 1147 /** 1148 * Determines whether the role has any permissions associated with it. 1149 * 1150 * @param pk the primary key of the role to check for associations with permissions 1151 * @return whether the role has any permissions associated with it 1152 * @throws SystemException if a system exception occurred 1153 */ 1154 public static boolean containsPermissions(long pk) 1155 throws com.liferay.portal.kernel.exception.SystemException { 1156 return getPersistence().containsPermissions(pk); 1157 } 1158 1159 /** 1160 * Adds an association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1161 * 1162 * @param pk the primary key of the role 1163 * @param permissionPK the primary key of the permission 1164 * @throws SystemException if a system exception occurred 1165 */ 1166 public static void addPermission(long pk, long permissionPK) 1167 throws com.liferay.portal.kernel.exception.SystemException { 1168 getPersistence().addPermission(pk, permissionPK); 1169 } 1170 1171 /** 1172 * Adds an association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1173 * 1174 * @param pk the primary key of the role 1175 * @param permission the permission 1176 * @throws SystemException if a system exception occurred 1177 */ 1178 public static void addPermission(long pk, 1179 com.liferay.portal.model.Permission permission) 1180 throws com.liferay.portal.kernel.exception.SystemException { 1181 getPersistence().addPermission(pk, permission); 1182 } 1183 1184 /** 1185 * Adds an association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1186 * 1187 * @param pk the primary key of the role 1188 * @param permissionPKs the primary keys of the permissions 1189 * @throws SystemException if a system exception occurred 1190 */ 1191 public static void addPermissions(long pk, long[] permissionPKs) 1192 throws com.liferay.portal.kernel.exception.SystemException { 1193 getPersistence().addPermissions(pk, permissionPKs); 1194 } 1195 1196 /** 1197 * Adds an association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1198 * 1199 * @param pk the primary key of the role 1200 * @param permissions the permissions 1201 * @throws SystemException if a system exception occurred 1202 */ 1203 public static void addPermissions(long pk, 1204 java.util.List<com.liferay.portal.model.Permission> permissions) 1205 throws com.liferay.portal.kernel.exception.SystemException { 1206 getPersistence().addPermissions(pk, permissions); 1207 } 1208 1209 /** 1210 * Clears all associations between the role and its permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1211 * 1212 * @param pk the primary key of the role to clear the associated permissions from 1213 * @throws SystemException if a system exception occurred 1214 */ 1215 public static void clearPermissions(long pk) 1216 throws com.liferay.portal.kernel.exception.SystemException { 1217 getPersistence().clearPermissions(pk); 1218 } 1219 1220 /** 1221 * Removes the association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1222 * 1223 * @param pk the primary key of the role 1224 * @param permissionPK the primary key of the permission 1225 * @throws SystemException if a system exception occurred 1226 */ 1227 public static void removePermission(long pk, long permissionPK) 1228 throws com.liferay.portal.kernel.exception.SystemException { 1229 getPersistence().removePermission(pk, permissionPK); 1230 } 1231 1232 /** 1233 * Removes the association between the role and the permission. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1234 * 1235 * @param pk the primary key of the role 1236 * @param permission the permission 1237 * @throws SystemException if a system exception occurred 1238 */ 1239 public static void removePermission(long pk, 1240 com.liferay.portal.model.Permission permission) 1241 throws com.liferay.portal.kernel.exception.SystemException { 1242 getPersistence().removePermission(pk, permission); 1243 } 1244 1245 /** 1246 * Removes the association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1247 * 1248 * @param pk the primary key of the role 1249 * @param permissionPKs the primary keys of the permissions 1250 * @throws SystemException if a system exception occurred 1251 */ 1252 public static void removePermissions(long pk, long[] permissionPKs) 1253 throws com.liferay.portal.kernel.exception.SystemException { 1254 getPersistence().removePermissions(pk, permissionPKs); 1255 } 1256 1257 /** 1258 * Removes the association between the role and the permissions. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1259 * 1260 * @param pk the primary key of the role 1261 * @param permissions the permissions 1262 * @throws SystemException if a system exception occurred 1263 */ 1264 public static void removePermissions(long pk, 1265 java.util.List<com.liferay.portal.model.Permission> permissions) 1266 throws com.liferay.portal.kernel.exception.SystemException { 1267 getPersistence().removePermissions(pk, permissions); 1268 } 1269 1270 /** 1271 * Sets the permissions associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1272 * 1273 * @param pk the primary key of the role to set the associations for 1274 * @param permissionPKs the primary keys of the permissions to be associated with the role 1275 * @throws SystemException if a system exception occurred 1276 */ 1277 public static void setPermissions(long pk, long[] permissionPKs) 1278 throws com.liferay.portal.kernel.exception.SystemException { 1279 getPersistence().setPermissions(pk, permissionPKs); 1280 } 1281 1282 /** 1283 * Sets the permissions associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1284 * 1285 * @param pk the primary key of the role to set the associations for 1286 * @param permissions the permissions to be associated with the role 1287 * @throws SystemException if a system exception occurred 1288 */ 1289 public static void setPermissions(long pk, 1290 java.util.List<com.liferay.portal.model.Permission> permissions) 1291 throws com.liferay.portal.kernel.exception.SystemException { 1292 getPersistence().setPermissions(pk, permissions); 1293 } 1294 1295 /** 1296 * Gets all the users associated with the role. 1297 * 1298 * @param pk the primary key of the role to get the associated users for 1299 * @return the users associated with the role 1300 * @throws SystemException if a system exception occurred 1301 */ 1302 public static java.util.List<com.liferay.portal.model.User> getUsers( 1303 long pk) throws com.liferay.portal.kernel.exception.SystemException { 1304 return getPersistence().getUsers(pk); 1305 } 1306 1307 /** 1308 * Gets a range of all the users associated with the role. 1309 * 1310 * <p> 1311 * 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. 1312 * </p> 1313 * 1314 * @param pk the primary key of the role to get the associated users for 1315 * @param start the lower bound of the range of roles to return 1316 * @param end the upper bound of the range of roles to return (not inclusive) 1317 * @return the range of users associated with the role 1318 * @throws SystemException if a system exception occurred 1319 */ 1320 public static java.util.List<com.liferay.portal.model.User> getUsers( 1321 long pk, int start, int end) 1322 throws com.liferay.portal.kernel.exception.SystemException { 1323 return getPersistence().getUsers(pk, start, end); 1324 } 1325 1326 /** 1327 * Gets an ordered range of all the users associated with the role. 1328 * 1329 * <p> 1330 * 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. 1331 * </p> 1332 * 1333 * @param pk the primary key of the role to get the associated users for 1334 * @param start the lower bound of the range of roles to return 1335 * @param end the upper bound of the range of roles to return (not inclusive) 1336 * @param orderByComparator the comparator to order the results by 1337 * @return the ordered range of users associated with the role 1338 * @throws SystemException if a system exception occurred 1339 */ 1340 public static java.util.List<com.liferay.portal.model.User> getUsers( 1341 long pk, int start, int end, 1342 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 1343 throws com.liferay.portal.kernel.exception.SystemException { 1344 return getPersistence().getUsers(pk, start, end, orderByComparator); 1345 } 1346 1347 /** 1348 * Gets the number of users associated with the role. 1349 * 1350 * @param pk the primary key of the role to get the number of associated users for 1351 * @return the number of users associated with the role 1352 * @throws SystemException if a system exception occurred 1353 */ 1354 public static int getUsersSize(long pk) 1355 throws com.liferay.portal.kernel.exception.SystemException { 1356 return getPersistence().getUsersSize(pk); 1357 } 1358 1359 /** 1360 * Determines whether the user is associated with the role. 1361 * 1362 * @param pk the primary key of the role 1363 * @param userPK the primary key of the user 1364 * @return whether the user is associated with the role 1365 * @throws SystemException if a system exception occurred 1366 */ 1367 public static boolean containsUser(long pk, long userPK) 1368 throws com.liferay.portal.kernel.exception.SystemException { 1369 return getPersistence().containsUser(pk, userPK); 1370 } 1371 1372 /** 1373 * Determines whether the role has any users associated with it. 1374 * 1375 * @param pk the primary key of the role to check for associations with users 1376 * @return whether the role has any users associated with it 1377 * @throws SystemException if a system exception occurred 1378 */ 1379 public static boolean containsUsers(long pk) 1380 throws com.liferay.portal.kernel.exception.SystemException { 1381 return getPersistence().containsUsers(pk); 1382 } 1383 1384 /** 1385 * Adds an association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1386 * 1387 * @param pk the primary key of the role 1388 * @param userPK the primary key of the user 1389 * @throws SystemException if a system exception occurred 1390 */ 1391 public static void addUser(long pk, long userPK) 1392 throws com.liferay.portal.kernel.exception.SystemException { 1393 getPersistence().addUser(pk, userPK); 1394 } 1395 1396 /** 1397 * Adds an association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1398 * 1399 * @param pk the primary key of the role 1400 * @param user the user 1401 * @throws SystemException if a system exception occurred 1402 */ 1403 public static void addUser(long pk, com.liferay.portal.model.User user) 1404 throws com.liferay.portal.kernel.exception.SystemException { 1405 getPersistence().addUser(pk, user); 1406 } 1407 1408 /** 1409 * Adds an association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1410 * 1411 * @param pk the primary key of the role 1412 * @param userPKs the primary keys of the users 1413 * @throws SystemException if a system exception occurred 1414 */ 1415 public static void addUsers(long pk, long[] userPKs) 1416 throws com.liferay.portal.kernel.exception.SystemException { 1417 getPersistence().addUsers(pk, userPKs); 1418 } 1419 1420 /** 1421 * Adds an association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1422 * 1423 * @param pk the primary key of the role 1424 * @param users the users 1425 * @throws SystemException if a system exception occurred 1426 */ 1427 public static void addUsers(long pk, 1428 java.util.List<com.liferay.portal.model.User> users) 1429 throws com.liferay.portal.kernel.exception.SystemException { 1430 getPersistence().addUsers(pk, users); 1431 } 1432 1433 /** 1434 * Clears all associations between the role and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1435 * 1436 * @param pk the primary key of the role to clear the associated users from 1437 * @throws SystemException if a system exception occurred 1438 */ 1439 public static void clearUsers(long pk) 1440 throws com.liferay.portal.kernel.exception.SystemException { 1441 getPersistence().clearUsers(pk); 1442 } 1443 1444 /** 1445 * Removes the association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1446 * 1447 * @param pk the primary key of the role 1448 * @param userPK the primary key of the user 1449 * @throws SystemException if a system exception occurred 1450 */ 1451 public static void removeUser(long pk, long userPK) 1452 throws com.liferay.portal.kernel.exception.SystemException { 1453 getPersistence().removeUser(pk, userPK); 1454 } 1455 1456 /** 1457 * Removes the association between the role and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1458 * 1459 * @param pk the primary key of the role 1460 * @param user the user 1461 * @throws SystemException if a system exception occurred 1462 */ 1463 public static void removeUser(long pk, com.liferay.portal.model.User user) 1464 throws com.liferay.portal.kernel.exception.SystemException { 1465 getPersistence().removeUser(pk, user); 1466 } 1467 1468 /** 1469 * Removes the association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1470 * 1471 * @param pk the primary key of the role 1472 * @param userPKs the primary keys of the users 1473 * @throws SystemException if a system exception occurred 1474 */ 1475 public static void removeUsers(long pk, long[] userPKs) 1476 throws com.liferay.portal.kernel.exception.SystemException { 1477 getPersistence().removeUsers(pk, userPKs); 1478 } 1479 1480 /** 1481 * Removes the association between the role and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1482 * 1483 * @param pk the primary key of the role 1484 * @param users the users 1485 * @throws SystemException if a system exception occurred 1486 */ 1487 public static void removeUsers(long pk, 1488 java.util.List<com.liferay.portal.model.User> users) 1489 throws com.liferay.portal.kernel.exception.SystemException { 1490 getPersistence().removeUsers(pk, users); 1491 } 1492 1493 /** 1494 * Sets the users associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1495 * 1496 * @param pk the primary key of the role to set the associations for 1497 * @param userPKs the primary keys of the users to be associated with the role 1498 * @throws SystemException if a system exception occurred 1499 */ 1500 public static void setUsers(long pk, long[] userPKs) 1501 throws com.liferay.portal.kernel.exception.SystemException { 1502 getPersistence().setUsers(pk, userPKs); 1503 } 1504 1505 /** 1506 * Sets the users associated with the role, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache. 1507 * 1508 * @param pk the primary key of the role to set the associations for 1509 * @param users the users to be associated with the role 1510 * @throws SystemException if a system exception occurred 1511 */ 1512 public static void setUsers(long pk, 1513 java.util.List<com.liferay.portal.model.User> users) 1514 throws com.liferay.portal.kernel.exception.SystemException { 1515 getPersistence().setUsers(pk, users); 1516 } 1517 1518 public static RolePersistence getPersistence() { 1519 if (_persistence == null) { 1520 _persistence = (RolePersistence)PortalBeanLocatorUtil.locate(RolePersistence.class.getName()); 1521 } 1522 1523 return _persistence; 1524 } 1525 1526 public void setPersistence(RolePersistence persistence) { 1527 _persistence = persistence; 1528 } 1529 1530 private static RolePersistence _persistence; 1531 }