001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.exception.SystemException; 022 import com.liferay.portal.kernel.util.OrderByComparator; 023 import com.liferay.portal.kernel.util.ReferenceRegistry; 024 import com.liferay.portal.model.ResourceTypePermission; 025 import com.liferay.portal.service.ServiceContext; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the resource type permission service. This utility wraps {@link ResourceTypePermissionPersistenceImpl} 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. 031 * 032 * <p> 033 * Caching information and settings can be found in <code>portal.properties</code> 034 * </p> 035 * 036 * @author Brian Wing Shun Chan 037 * @see ResourceTypePermissionPersistence 038 * @see ResourceTypePermissionPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class ResourceTypePermissionUtil { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 047 */ 048 049 /** 050 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 051 */ 052 public static void clearCache() { 053 getPersistence().clearCache(); 054 } 055 056 /** 057 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 058 */ 059 public static void clearCache(ResourceTypePermission resourceTypePermission) { 060 getPersistence().clearCache(resourceTypePermission); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) 067 throws SystemException { 068 return getPersistence().countWithDynamicQuery(dynamicQuery); 069 } 070 071 /** 072 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 073 */ 074 public static List<ResourceTypePermission> findWithDynamicQuery( 075 DynamicQuery dynamicQuery) throws SystemException { 076 return getPersistence().findWithDynamicQuery(dynamicQuery); 077 } 078 079 /** 080 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 081 */ 082 public static List<ResourceTypePermission> findWithDynamicQuery( 083 DynamicQuery dynamicQuery, int start, int end) 084 throws SystemException { 085 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 086 } 087 088 /** 089 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 090 */ 091 public static List<ResourceTypePermission> findWithDynamicQuery( 092 DynamicQuery dynamicQuery, int start, int end, 093 OrderByComparator orderByComparator) throws SystemException { 094 return getPersistence() 095 .findWithDynamicQuery(dynamicQuery, start, end, 096 orderByComparator); 097 } 098 099 /** 100 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 101 */ 102 public static ResourceTypePermission update( 103 ResourceTypePermission resourceTypePermission) 104 throws SystemException { 105 return getPersistence().update(resourceTypePermission); 106 } 107 108 /** 109 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 110 */ 111 public static ResourceTypePermission update( 112 ResourceTypePermission resourceTypePermission, 113 ServiceContext serviceContext) throws SystemException { 114 return getPersistence().update(resourceTypePermission, serviceContext); 115 } 116 117 /** 118 * Returns all the resource type permissions where roleId = ?. 119 * 120 * @param roleId the role ID 121 * @return the matching resource type permissions 122 * @throws SystemException if a system exception occurred 123 */ 124 public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByRoleId( 125 long roleId) throws com.liferay.portal.kernel.exception.SystemException { 126 return getPersistence().findByRoleId(roleId); 127 } 128 129 /** 130 * Returns a range of all the resource type permissions where roleId = ?. 131 * 132 * <p> 133 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 134 * </p> 135 * 136 * @param roleId the role ID 137 * @param start the lower bound of the range of resource type permissions 138 * @param end the upper bound of the range of resource type permissions (not inclusive) 139 * @return the range of matching resource type permissions 140 * @throws SystemException if a system exception occurred 141 */ 142 public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByRoleId( 143 long roleId, int start, int end) 144 throws com.liferay.portal.kernel.exception.SystemException { 145 return getPersistence().findByRoleId(roleId, start, end); 146 } 147 148 /** 149 * Returns an ordered range of all the resource type permissions where roleId = ?. 150 * 151 * <p> 152 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 153 * </p> 154 * 155 * @param roleId the role ID 156 * @param start the lower bound of the range of resource type permissions 157 * @param end the upper bound of the range of resource type permissions (not inclusive) 158 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 159 * @return the ordered range of matching resource type permissions 160 * @throws SystemException if a system exception occurred 161 */ 162 public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByRoleId( 163 long roleId, int start, int end, 164 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 165 throws com.liferay.portal.kernel.exception.SystemException { 166 return getPersistence() 167 .findByRoleId(roleId, start, end, orderByComparator); 168 } 169 170 /** 171 * Returns the first resource type permission in the ordered set where roleId = ?. 172 * 173 * @param roleId the role ID 174 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 175 * @return the first matching resource type permission 176 * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found 177 * @throws SystemException if a system exception occurred 178 */ 179 public static com.liferay.portal.model.ResourceTypePermission findByRoleId_First( 180 long roleId, 181 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 182 throws com.liferay.portal.NoSuchResourceTypePermissionException, 183 com.liferay.portal.kernel.exception.SystemException { 184 return getPersistence().findByRoleId_First(roleId, orderByComparator); 185 } 186 187 /** 188 * Returns the first resource type permission in the ordered set where roleId = ?. 189 * 190 * @param roleId the role ID 191 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 192 * @return the first matching resource type permission, or <code>null</code> if a matching resource type permission could not be found 193 * @throws SystemException if a system exception occurred 194 */ 195 public static com.liferay.portal.model.ResourceTypePermission fetchByRoleId_First( 196 long roleId, 197 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 198 throws com.liferay.portal.kernel.exception.SystemException { 199 return getPersistence().fetchByRoleId_First(roleId, orderByComparator); 200 } 201 202 /** 203 * Returns the last resource type permission in the ordered set where roleId = ?. 204 * 205 * @param roleId the role ID 206 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 207 * @return the last matching resource type permission 208 * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found 209 * @throws SystemException if a system exception occurred 210 */ 211 public static com.liferay.portal.model.ResourceTypePermission findByRoleId_Last( 212 long roleId, 213 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 214 throws com.liferay.portal.NoSuchResourceTypePermissionException, 215 com.liferay.portal.kernel.exception.SystemException { 216 return getPersistence().findByRoleId_Last(roleId, orderByComparator); 217 } 218 219 /** 220 * Returns the last resource type permission in the ordered set where roleId = ?. 221 * 222 * @param roleId the role ID 223 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 224 * @return the last matching resource type permission, or <code>null</code> if a matching resource type permission could not be found 225 * @throws SystemException if a system exception occurred 226 */ 227 public static com.liferay.portal.model.ResourceTypePermission fetchByRoleId_Last( 228 long roleId, 229 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 230 throws com.liferay.portal.kernel.exception.SystemException { 231 return getPersistence().fetchByRoleId_Last(roleId, orderByComparator); 232 } 233 234 /** 235 * Returns the resource type permissions before and after the current resource type permission in the ordered set where roleId = ?. 236 * 237 * @param resourceTypePermissionId the primary key of the current resource type permission 238 * @param roleId the role ID 239 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 240 * @return the previous, current, and next resource type permission 241 * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found 242 * @throws SystemException if a system exception occurred 243 */ 244 public static com.liferay.portal.model.ResourceTypePermission[] findByRoleId_PrevAndNext( 245 long resourceTypePermissionId, long roleId, 246 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 247 throws com.liferay.portal.NoSuchResourceTypePermissionException, 248 com.liferay.portal.kernel.exception.SystemException { 249 return getPersistence() 250 .findByRoleId_PrevAndNext(resourceTypePermissionId, roleId, 251 orderByComparator); 252 } 253 254 /** 255 * Removes all the resource type permissions where roleId = ? from the database. 256 * 257 * @param roleId the role ID 258 * @throws SystemException if a system exception occurred 259 */ 260 public static void removeByRoleId(long roleId) 261 throws com.liferay.portal.kernel.exception.SystemException { 262 getPersistence().removeByRoleId(roleId); 263 } 264 265 /** 266 * Returns the number of resource type permissions where roleId = ?. 267 * 268 * @param roleId the role ID 269 * @return the number of matching resource type permissions 270 * @throws SystemException if a system exception occurred 271 */ 272 public static int countByRoleId(long roleId) 273 throws com.liferay.portal.kernel.exception.SystemException { 274 return getPersistence().countByRoleId(roleId); 275 } 276 277 /** 278 * Returns all the resource type permissions where companyId = ? and name = ? and roleId = ?. 279 * 280 * @param companyId the company ID 281 * @param name the name 282 * @param roleId the role ID 283 * @return the matching resource type permissions 284 * @throws SystemException if a system exception occurred 285 */ 286 public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByC_N_R( 287 long companyId, java.lang.String name, long roleId) 288 throws com.liferay.portal.kernel.exception.SystemException { 289 return getPersistence().findByC_N_R(companyId, name, roleId); 290 } 291 292 /** 293 * Returns a range of all the resource type permissions where companyId = ? and name = ? and roleId = ?. 294 * 295 * <p> 296 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 297 * </p> 298 * 299 * @param companyId the company ID 300 * @param name the name 301 * @param roleId the role ID 302 * @param start the lower bound of the range of resource type permissions 303 * @param end the upper bound of the range of resource type permissions (not inclusive) 304 * @return the range of matching resource type permissions 305 * @throws SystemException if a system exception occurred 306 */ 307 public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByC_N_R( 308 long companyId, java.lang.String name, long roleId, int start, int end) 309 throws com.liferay.portal.kernel.exception.SystemException { 310 return getPersistence().findByC_N_R(companyId, name, roleId, start, end); 311 } 312 313 /** 314 * Returns an ordered range of all the resource type permissions where companyId = ? and name = ? and roleId = ?. 315 * 316 * <p> 317 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 318 * </p> 319 * 320 * @param companyId the company ID 321 * @param name the name 322 * @param roleId the role ID 323 * @param start the lower bound of the range of resource type permissions 324 * @param end the upper bound of the range of resource type permissions (not inclusive) 325 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 326 * @return the ordered range of matching resource type permissions 327 * @throws SystemException if a system exception occurred 328 */ 329 public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findByC_N_R( 330 long companyId, java.lang.String name, long roleId, int start, int end, 331 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 332 throws com.liferay.portal.kernel.exception.SystemException { 333 return getPersistence() 334 .findByC_N_R(companyId, name, roleId, start, end, 335 orderByComparator); 336 } 337 338 /** 339 * Returns the first resource type permission in the ordered set where companyId = ? and name = ? and roleId = ?. 340 * 341 * @param companyId the company ID 342 * @param name the name 343 * @param roleId the role ID 344 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 345 * @return the first matching resource type permission 346 * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found 347 * @throws SystemException if a system exception occurred 348 */ 349 public static com.liferay.portal.model.ResourceTypePermission findByC_N_R_First( 350 long companyId, java.lang.String name, long roleId, 351 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 352 throws com.liferay.portal.NoSuchResourceTypePermissionException, 353 com.liferay.portal.kernel.exception.SystemException { 354 return getPersistence() 355 .findByC_N_R_First(companyId, name, roleId, orderByComparator); 356 } 357 358 /** 359 * Returns the first resource type permission in the ordered set where companyId = ? and name = ? and roleId = ?. 360 * 361 * @param companyId the company ID 362 * @param name the name 363 * @param roleId the role ID 364 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 365 * @return the first matching resource type permission, or <code>null</code> if a matching resource type permission could not be found 366 * @throws SystemException if a system exception occurred 367 */ 368 public static com.liferay.portal.model.ResourceTypePermission fetchByC_N_R_First( 369 long companyId, java.lang.String name, long roleId, 370 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 371 throws com.liferay.portal.kernel.exception.SystemException { 372 return getPersistence() 373 .fetchByC_N_R_First(companyId, name, roleId, 374 orderByComparator); 375 } 376 377 /** 378 * Returns the last resource type permission in the ordered set where companyId = ? and name = ? and roleId = ?. 379 * 380 * @param companyId the company ID 381 * @param name the name 382 * @param roleId the role ID 383 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 384 * @return the last matching resource type permission 385 * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found 386 * @throws SystemException if a system exception occurred 387 */ 388 public static com.liferay.portal.model.ResourceTypePermission findByC_N_R_Last( 389 long companyId, java.lang.String name, long roleId, 390 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 391 throws com.liferay.portal.NoSuchResourceTypePermissionException, 392 com.liferay.portal.kernel.exception.SystemException { 393 return getPersistence() 394 .findByC_N_R_Last(companyId, name, roleId, orderByComparator); 395 } 396 397 /** 398 * Returns the last resource type permission in the ordered set where companyId = ? and name = ? and roleId = ?. 399 * 400 * @param companyId the company ID 401 * @param name the name 402 * @param roleId the role ID 403 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 404 * @return the last matching resource type permission, or <code>null</code> if a matching resource type permission could not be found 405 * @throws SystemException if a system exception occurred 406 */ 407 public static com.liferay.portal.model.ResourceTypePermission fetchByC_N_R_Last( 408 long companyId, java.lang.String name, long roleId, 409 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 410 throws com.liferay.portal.kernel.exception.SystemException { 411 return getPersistence() 412 .fetchByC_N_R_Last(companyId, name, roleId, orderByComparator); 413 } 414 415 /** 416 * Returns the resource type permissions before and after the current resource type permission in the ordered set where companyId = ? and name = ? and roleId = ?. 417 * 418 * @param resourceTypePermissionId the primary key of the current resource type permission 419 * @param companyId the company ID 420 * @param name the name 421 * @param roleId the role ID 422 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 423 * @return the previous, current, and next resource type permission 424 * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found 425 * @throws SystemException if a system exception occurred 426 */ 427 public static com.liferay.portal.model.ResourceTypePermission[] findByC_N_R_PrevAndNext( 428 long resourceTypePermissionId, long companyId, java.lang.String name, 429 long roleId, 430 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 431 throws com.liferay.portal.NoSuchResourceTypePermissionException, 432 com.liferay.portal.kernel.exception.SystemException { 433 return getPersistence() 434 .findByC_N_R_PrevAndNext(resourceTypePermissionId, 435 companyId, name, roleId, orderByComparator); 436 } 437 438 /** 439 * Removes all the resource type permissions where companyId = ? and name = ? and roleId = ? from the database. 440 * 441 * @param companyId the company ID 442 * @param name the name 443 * @param roleId the role ID 444 * @throws SystemException if a system exception occurred 445 */ 446 public static void removeByC_N_R(long companyId, java.lang.String name, 447 long roleId) throws com.liferay.portal.kernel.exception.SystemException { 448 getPersistence().removeByC_N_R(companyId, name, roleId); 449 } 450 451 /** 452 * Returns the number of resource type permissions where companyId = ? and name = ? and roleId = ?. 453 * 454 * @param companyId the company ID 455 * @param name the name 456 * @param roleId the role ID 457 * @return the number of matching resource type permissions 458 * @throws SystemException if a system exception occurred 459 */ 460 public static int countByC_N_R(long companyId, java.lang.String name, 461 long roleId) throws com.liferay.portal.kernel.exception.SystemException { 462 return getPersistence().countByC_N_R(companyId, name, roleId); 463 } 464 465 /** 466 * Returns the resource type permission where companyId = ? and groupId = ? and name = ? and roleId = ? or throws a {@link com.liferay.portal.NoSuchResourceTypePermissionException} if it could not be found. 467 * 468 * @param companyId the company ID 469 * @param groupId the group ID 470 * @param name the name 471 * @param roleId the role ID 472 * @return the matching resource type permission 473 * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a matching resource type permission could not be found 474 * @throws SystemException if a system exception occurred 475 */ 476 public static com.liferay.portal.model.ResourceTypePermission findByC_G_N_R( 477 long companyId, long groupId, java.lang.String name, long roleId) 478 throws com.liferay.portal.NoSuchResourceTypePermissionException, 479 com.liferay.portal.kernel.exception.SystemException { 480 return getPersistence().findByC_G_N_R(companyId, groupId, name, roleId); 481 } 482 483 /** 484 * Returns the resource type permission where companyId = ? and groupId = ? and name = ? and roleId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 485 * 486 * @param companyId the company ID 487 * @param groupId the group ID 488 * @param name the name 489 * @param roleId the role ID 490 * @return the matching resource type permission, or <code>null</code> if a matching resource type permission could not be found 491 * @throws SystemException if a system exception occurred 492 */ 493 public static com.liferay.portal.model.ResourceTypePermission fetchByC_G_N_R( 494 long companyId, long groupId, java.lang.String name, long roleId) 495 throws com.liferay.portal.kernel.exception.SystemException { 496 return getPersistence().fetchByC_G_N_R(companyId, groupId, name, roleId); 497 } 498 499 /** 500 * Returns the resource type permission where companyId = ? and groupId = ? and name = ? and roleId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 501 * 502 * @param companyId the company ID 503 * @param groupId the group ID 504 * @param name the name 505 * @param roleId the role ID 506 * @param retrieveFromCache whether to use the finder cache 507 * @return the matching resource type permission, or <code>null</code> if a matching resource type permission could not be found 508 * @throws SystemException if a system exception occurred 509 */ 510 public static com.liferay.portal.model.ResourceTypePermission fetchByC_G_N_R( 511 long companyId, long groupId, java.lang.String name, long roleId, 512 boolean retrieveFromCache) 513 throws com.liferay.portal.kernel.exception.SystemException { 514 return getPersistence() 515 .fetchByC_G_N_R(companyId, groupId, name, roleId, 516 retrieveFromCache); 517 } 518 519 /** 520 * Removes the resource type permission where companyId = ? and groupId = ? and name = ? and roleId = ? from the database. 521 * 522 * @param companyId the company ID 523 * @param groupId the group ID 524 * @param name the name 525 * @param roleId the role ID 526 * @return the resource type permission that was removed 527 * @throws SystemException if a system exception occurred 528 */ 529 public static com.liferay.portal.model.ResourceTypePermission removeByC_G_N_R( 530 long companyId, long groupId, java.lang.String name, long roleId) 531 throws com.liferay.portal.NoSuchResourceTypePermissionException, 532 com.liferay.portal.kernel.exception.SystemException { 533 return getPersistence().removeByC_G_N_R(companyId, groupId, name, roleId); 534 } 535 536 /** 537 * Returns the number of resource type permissions where companyId = ? and groupId = ? and name = ? and roleId = ?. 538 * 539 * @param companyId the company ID 540 * @param groupId the group ID 541 * @param name the name 542 * @param roleId the role ID 543 * @return the number of matching resource type permissions 544 * @throws SystemException if a system exception occurred 545 */ 546 public static int countByC_G_N_R(long companyId, long groupId, 547 java.lang.String name, long roleId) 548 throws com.liferay.portal.kernel.exception.SystemException { 549 return getPersistence().countByC_G_N_R(companyId, groupId, name, roleId); 550 } 551 552 /** 553 * Caches the resource type permission in the entity cache if it is enabled. 554 * 555 * @param resourceTypePermission the resource type permission 556 */ 557 public static void cacheResult( 558 com.liferay.portal.model.ResourceTypePermission resourceTypePermission) { 559 getPersistence().cacheResult(resourceTypePermission); 560 } 561 562 /** 563 * Caches the resource type permissions in the entity cache if it is enabled. 564 * 565 * @param resourceTypePermissions the resource type permissions 566 */ 567 public static void cacheResult( 568 java.util.List<com.liferay.portal.model.ResourceTypePermission> resourceTypePermissions) { 569 getPersistence().cacheResult(resourceTypePermissions); 570 } 571 572 /** 573 * Creates a new resource type permission with the primary key. Does not add the resource type permission to the database. 574 * 575 * @param resourceTypePermissionId the primary key for the new resource type permission 576 * @return the new resource type permission 577 */ 578 public static com.liferay.portal.model.ResourceTypePermission create( 579 long resourceTypePermissionId) { 580 return getPersistence().create(resourceTypePermissionId); 581 } 582 583 /** 584 * Removes the resource type permission with the primary key from the database. Also notifies the appropriate model listeners. 585 * 586 * @param resourceTypePermissionId the primary key of the resource type permission 587 * @return the resource type permission that was removed 588 * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found 589 * @throws SystemException if a system exception occurred 590 */ 591 public static com.liferay.portal.model.ResourceTypePermission remove( 592 long resourceTypePermissionId) 593 throws com.liferay.portal.NoSuchResourceTypePermissionException, 594 com.liferay.portal.kernel.exception.SystemException { 595 return getPersistence().remove(resourceTypePermissionId); 596 } 597 598 public static com.liferay.portal.model.ResourceTypePermission updateImpl( 599 com.liferay.portal.model.ResourceTypePermission resourceTypePermission) 600 throws com.liferay.portal.kernel.exception.SystemException { 601 return getPersistence().updateImpl(resourceTypePermission); 602 } 603 604 /** 605 * Returns the resource type permission with the primary key or throws a {@link com.liferay.portal.NoSuchResourceTypePermissionException} if it could not be found. 606 * 607 * @param resourceTypePermissionId the primary key of the resource type permission 608 * @return the resource type permission 609 * @throws com.liferay.portal.NoSuchResourceTypePermissionException if a resource type permission with the primary key could not be found 610 * @throws SystemException if a system exception occurred 611 */ 612 public static com.liferay.portal.model.ResourceTypePermission findByPrimaryKey( 613 long resourceTypePermissionId) 614 throws com.liferay.portal.NoSuchResourceTypePermissionException, 615 com.liferay.portal.kernel.exception.SystemException { 616 return getPersistence().findByPrimaryKey(resourceTypePermissionId); 617 } 618 619 /** 620 * Returns the resource type permission with the primary key or returns <code>null</code> if it could not be found. 621 * 622 * @param resourceTypePermissionId the primary key of the resource type permission 623 * @return the resource type permission, or <code>null</code> if a resource type permission with the primary key could not be found 624 * @throws SystemException if a system exception occurred 625 */ 626 public static com.liferay.portal.model.ResourceTypePermission fetchByPrimaryKey( 627 long resourceTypePermissionId) 628 throws com.liferay.portal.kernel.exception.SystemException { 629 return getPersistence().fetchByPrimaryKey(resourceTypePermissionId); 630 } 631 632 /** 633 * Returns all the resource type permissions. 634 * 635 * @return the resource type permissions 636 * @throws SystemException if a system exception occurred 637 */ 638 public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findAll() 639 throws com.liferay.portal.kernel.exception.SystemException { 640 return getPersistence().findAll(); 641 } 642 643 /** 644 * Returns a range of all the resource type permissions. 645 * 646 * <p> 647 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 648 * </p> 649 * 650 * @param start the lower bound of the range of resource type permissions 651 * @param end the upper bound of the range of resource type permissions (not inclusive) 652 * @return the range of resource type permissions 653 * @throws SystemException if a system exception occurred 654 */ 655 public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findAll( 656 int start, int end) 657 throws com.liferay.portal.kernel.exception.SystemException { 658 return getPersistence().findAll(start, end); 659 } 660 661 /** 662 * Returns an ordered range of all the resource type permissions. 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceTypePermissionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 666 * </p> 667 * 668 * @param start the lower bound of the range of resource type permissions 669 * @param end the upper bound of the range of resource type permissions (not inclusive) 670 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 671 * @return the ordered range of resource type permissions 672 * @throws SystemException if a system exception occurred 673 */ 674 public static java.util.List<com.liferay.portal.model.ResourceTypePermission> findAll( 675 int start, int end, 676 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 677 throws com.liferay.portal.kernel.exception.SystemException { 678 return getPersistence().findAll(start, end, orderByComparator); 679 } 680 681 /** 682 * Removes all the resource type permissions from the database. 683 * 684 * @throws SystemException if a system exception occurred 685 */ 686 public static void removeAll() 687 throws com.liferay.portal.kernel.exception.SystemException { 688 getPersistence().removeAll(); 689 } 690 691 /** 692 * Returns the number of resource type permissions. 693 * 694 * @return the number of resource type permissions 695 * @throws SystemException if a system exception occurred 696 */ 697 public static int countAll() 698 throws com.liferay.portal.kernel.exception.SystemException { 699 return getPersistence().countAll(); 700 } 701 702 public static ResourceTypePermissionPersistence getPersistence() { 703 if (_persistence == null) { 704 _persistence = (ResourceTypePermissionPersistence)PortalBeanLocatorUtil.locate(ResourceTypePermissionPersistence.class.getName()); 705 706 ReferenceRegistry.registerReference(ResourceTypePermissionUtil.class, 707 "_persistence"); 708 } 709 710 return _persistence; 711 } 712 713 /** 714 * @deprecated As of 6.2.0 715 */ 716 public void setPersistence(ResourceTypePermissionPersistence persistence) { 717 } 718 719 private static ResourceTypePermissionPersistence _persistence; 720 }