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 com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.kernel.util.ReferenceRegistry; 022 import com.liferay.portal.model.ResourceCode; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the resource code service. This utility wraps {@link ResourceCodePersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 029 * 030 * <p> 031 * Caching information and settings can be found in <code>portal.properties</code> 032 * </p> 033 * 034 * @author Brian Wing Shun Chan 035 * @see ResourceCodePersistence 036 * @see ResourceCodePersistenceImpl 037 * @generated 038 */ 039 public class ResourceCodeUtil { 040 /* 041 * NOTE FOR DEVELOPERS: 042 * 043 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 044 */ 045 046 /** 047 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 048 */ 049 public static void clearCache() { 050 getPersistence().clearCache(); 051 } 052 053 /** 054 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 055 */ 056 public static void clearCache(ResourceCode resourceCode) { 057 getPersistence().clearCache(resourceCode); 058 } 059 060 /** 061 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 062 */ 063 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 064 throws SystemException { 065 return getPersistence().countWithDynamicQuery(dynamicQuery); 066 } 067 068 /** 069 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 070 */ 071 public static List<ResourceCode> findWithDynamicQuery( 072 DynamicQuery dynamicQuery) throws SystemException { 073 return getPersistence().findWithDynamicQuery(dynamicQuery); 074 } 075 076 /** 077 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 078 */ 079 public static List<ResourceCode> findWithDynamicQuery( 080 DynamicQuery dynamicQuery, int start, int end) 081 throws SystemException { 082 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 083 } 084 085 /** 086 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 087 */ 088 public static List<ResourceCode> findWithDynamicQuery( 089 DynamicQuery dynamicQuery, int start, int end, 090 OrderByComparator orderByComparator) throws SystemException { 091 return getPersistence() 092 .findWithDynamicQuery(dynamicQuery, start, end, 093 orderByComparator); 094 } 095 096 /** 097 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 098 */ 099 public static ResourceCode update(ResourceCode resourceCode, boolean merge) 100 throws SystemException { 101 return getPersistence().update(resourceCode, merge); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 106 */ 107 public static ResourceCode update(ResourceCode resourceCode, boolean merge, 108 ServiceContext serviceContext) throws SystemException { 109 return getPersistence().update(resourceCode, merge, serviceContext); 110 } 111 112 /** 113 * Caches the resource code in the entity cache if it is enabled. 114 * 115 * @param resourceCode the resource code 116 */ 117 public static void cacheResult( 118 com.liferay.portal.model.ResourceCode resourceCode) { 119 getPersistence().cacheResult(resourceCode); 120 } 121 122 /** 123 * Caches the resource codes in the entity cache if it is enabled. 124 * 125 * @param resourceCodes the resource codes 126 */ 127 public static void cacheResult( 128 java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes) { 129 getPersistence().cacheResult(resourceCodes); 130 } 131 132 /** 133 * Creates a new resource code with the primary key. Does not add the resource code to the database. 134 * 135 * @param codeId the primary key for the new resource code 136 * @return the new resource code 137 */ 138 public static com.liferay.portal.model.ResourceCode create(long codeId) { 139 return getPersistence().create(codeId); 140 } 141 142 /** 143 * Removes the resource code with the primary key from the database. Also notifies the appropriate model listeners. 144 * 145 * @param codeId the primary key of the resource code 146 * @return the resource code that was removed 147 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 148 * @throws SystemException if a system exception occurred 149 */ 150 public static com.liferay.portal.model.ResourceCode remove(long codeId) 151 throws com.liferay.portal.NoSuchResourceCodeException, 152 com.liferay.portal.kernel.exception.SystemException { 153 return getPersistence().remove(codeId); 154 } 155 156 public static com.liferay.portal.model.ResourceCode updateImpl( 157 com.liferay.portal.model.ResourceCode resourceCode, boolean merge) 158 throws com.liferay.portal.kernel.exception.SystemException { 159 return getPersistence().updateImpl(resourceCode, merge); 160 } 161 162 /** 163 * Returns the resource code with the primary key or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found. 164 * 165 * @param codeId the primary key of the resource code 166 * @return the resource code 167 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 168 * @throws SystemException if a system exception occurred 169 */ 170 public static com.liferay.portal.model.ResourceCode findByPrimaryKey( 171 long codeId) 172 throws com.liferay.portal.NoSuchResourceCodeException, 173 com.liferay.portal.kernel.exception.SystemException { 174 return getPersistence().findByPrimaryKey(codeId); 175 } 176 177 /** 178 * Returns the resource code with the primary key or returns <code>null</code> if it could not be found. 179 * 180 * @param codeId the primary key of the resource code 181 * @return the resource code, or <code>null</code> if a resource code with the primary key could not be found 182 * @throws SystemException if a system exception occurred 183 */ 184 public static com.liferay.portal.model.ResourceCode fetchByPrimaryKey( 185 long codeId) throws com.liferay.portal.kernel.exception.SystemException { 186 return getPersistence().fetchByPrimaryKey(codeId); 187 } 188 189 /** 190 * Returns all the resource codes where companyId = ?. 191 * 192 * @param companyId the company ID 193 * @return the matching resource codes 194 * @throws SystemException if a system exception occurred 195 */ 196 public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId( 197 long companyId) 198 throws com.liferay.portal.kernel.exception.SystemException { 199 return getPersistence().findByCompanyId(companyId); 200 } 201 202 /** 203 * Returns a range of all the resource codes where companyId = ?. 204 * 205 * <p> 206 * 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. 207 * </p> 208 * 209 * @param companyId the company ID 210 * @param start the lower bound of the range of resource codes 211 * @param end the upper bound of the range of resource codes (not inclusive) 212 * @return the range of matching resource codes 213 * @throws SystemException if a system exception occurred 214 */ 215 public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId( 216 long companyId, int start, int end) 217 throws com.liferay.portal.kernel.exception.SystemException { 218 return getPersistence().findByCompanyId(companyId, start, end); 219 } 220 221 /** 222 * Returns an ordered range of all the resource codes where companyId = ?. 223 * 224 * <p> 225 * 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. 226 * </p> 227 * 228 * @param companyId the company ID 229 * @param start the lower bound of the range of resource codes 230 * @param end the upper bound of the range of resource codes (not inclusive) 231 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 232 * @return the ordered range of matching resource codes 233 * @throws SystemException if a system exception occurred 234 */ 235 public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId( 236 long companyId, int start, int end, 237 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 238 throws com.liferay.portal.kernel.exception.SystemException { 239 return getPersistence() 240 .findByCompanyId(companyId, start, end, orderByComparator); 241 } 242 243 /** 244 * Returns the first resource code in the ordered set where companyId = ?. 245 * 246 * @param companyId the company ID 247 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 248 * @return the first matching resource code 249 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 250 * @throws SystemException if a system exception occurred 251 */ 252 public static com.liferay.portal.model.ResourceCode findByCompanyId_First( 253 long companyId, 254 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 255 throws com.liferay.portal.NoSuchResourceCodeException, 256 com.liferay.portal.kernel.exception.SystemException { 257 return getPersistence() 258 .findByCompanyId_First(companyId, orderByComparator); 259 } 260 261 /** 262 * Returns the first resource code in the ordered set where companyId = ?. 263 * 264 * @param companyId the company ID 265 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 266 * @return the first matching resource code, or <code>null</code> if a matching resource code could not be found 267 * @throws SystemException if a system exception occurred 268 */ 269 public static com.liferay.portal.model.ResourceCode fetchByCompanyId_First( 270 long companyId, 271 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 272 throws com.liferay.portal.kernel.exception.SystemException { 273 return getPersistence() 274 .fetchByCompanyId_First(companyId, orderByComparator); 275 } 276 277 /** 278 * Returns the last resource code in the ordered set where companyId = ?. 279 * 280 * @param companyId the company ID 281 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 282 * @return the last matching resource code 283 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 284 * @throws SystemException if a system exception occurred 285 */ 286 public static com.liferay.portal.model.ResourceCode findByCompanyId_Last( 287 long companyId, 288 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 289 throws com.liferay.portal.NoSuchResourceCodeException, 290 com.liferay.portal.kernel.exception.SystemException { 291 return getPersistence() 292 .findByCompanyId_Last(companyId, orderByComparator); 293 } 294 295 /** 296 * Returns the last resource code in the ordered set where companyId = ?. 297 * 298 * @param companyId the company ID 299 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 300 * @return the last matching resource code, or <code>null</code> if a matching resource code could not be found 301 * @throws SystemException if a system exception occurred 302 */ 303 public static com.liferay.portal.model.ResourceCode fetchByCompanyId_Last( 304 long companyId, 305 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 306 throws com.liferay.portal.kernel.exception.SystemException { 307 return getPersistence() 308 .fetchByCompanyId_Last(companyId, orderByComparator); 309 } 310 311 /** 312 * Returns the resource codes before and after the current resource code in the ordered set where companyId = ?. 313 * 314 * @param codeId the primary key of the current resource code 315 * @param companyId the company ID 316 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 317 * @return the previous, current, and next resource code 318 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 319 * @throws SystemException if a system exception occurred 320 */ 321 public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext( 322 long codeId, long companyId, 323 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 324 throws com.liferay.portal.NoSuchResourceCodeException, 325 com.liferay.portal.kernel.exception.SystemException { 326 return getPersistence() 327 .findByCompanyId_PrevAndNext(codeId, companyId, 328 orderByComparator); 329 } 330 331 /** 332 * Returns all the resource codes where name = ?. 333 * 334 * @param name the name 335 * @return the matching resource codes 336 * @throws SystemException if a system exception occurred 337 */ 338 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 339 java.lang.String name) 340 throws com.liferay.portal.kernel.exception.SystemException { 341 return getPersistence().findByName(name); 342 } 343 344 /** 345 * Returns a range of all the resource codes where name = ?. 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 name the name 352 * @param start the lower bound of the range of resource codes 353 * @param end the upper bound of the range of resource codes (not inclusive) 354 * @return the range of matching resource codes 355 * @throws SystemException if a system exception occurred 356 */ 357 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 358 java.lang.String name, int start, int end) 359 throws com.liferay.portal.kernel.exception.SystemException { 360 return getPersistence().findByName(name, start, end); 361 } 362 363 /** 364 * Returns an ordered range of all the resource codes where name = ?. 365 * 366 * <p> 367 * 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. 368 * </p> 369 * 370 * @param name the name 371 * @param start the lower bound of the range of resource codes 372 * @param end the upper bound of the range of resource codes (not inclusive) 373 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 374 * @return the ordered range of matching resource codes 375 * @throws SystemException if a system exception occurred 376 */ 377 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 378 java.lang.String name, int start, int end, 379 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 380 throws com.liferay.portal.kernel.exception.SystemException { 381 return getPersistence().findByName(name, start, end, orderByComparator); 382 } 383 384 /** 385 * Returns the first resource code in the ordered set where name = ?. 386 * 387 * @param name the name 388 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 389 * @return the first matching resource code 390 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 391 * @throws SystemException if a system exception occurred 392 */ 393 public static com.liferay.portal.model.ResourceCode findByName_First( 394 java.lang.String name, 395 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 396 throws com.liferay.portal.NoSuchResourceCodeException, 397 com.liferay.portal.kernel.exception.SystemException { 398 return getPersistence().findByName_First(name, orderByComparator); 399 } 400 401 /** 402 * Returns the first resource code in the ordered set where name = ?. 403 * 404 * @param name the name 405 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 406 * @return the first matching resource code, or <code>null</code> if a matching resource code could not be found 407 * @throws SystemException if a system exception occurred 408 */ 409 public static com.liferay.portal.model.ResourceCode fetchByName_First( 410 java.lang.String name, 411 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 412 throws com.liferay.portal.kernel.exception.SystemException { 413 return getPersistence().fetchByName_First(name, orderByComparator); 414 } 415 416 /** 417 * Returns the last resource code in the ordered set where name = ?. 418 * 419 * @param name the name 420 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 421 * @return the last matching resource code 422 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 423 * @throws SystemException if a system exception occurred 424 */ 425 public static com.liferay.portal.model.ResourceCode findByName_Last( 426 java.lang.String name, 427 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 428 throws com.liferay.portal.NoSuchResourceCodeException, 429 com.liferay.portal.kernel.exception.SystemException { 430 return getPersistence().findByName_Last(name, orderByComparator); 431 } 432 433 /** 434 * Returns the last resource code in the ordered set where name = ?. 435 * 436 * @param name the name 437 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 438 * @return the last matching resource code, or <code>null</code> if a matching resource code could not be found 439 * @throws SystemException if a system exception occurred 440 */ 441 public static com.liferay.portal.model.ResourceCode fetchByName_Last( 442 java.lang.String name, 443 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 444 throws com.liferay.portal.kernel.exception.SystemException { 445 return getPersistence().fetchByName_Last(name, orderByComparator); 446 } 447 448 /** 449 * Returns the resource codes before and after the current resource code in the ordered set where name = ?. 450 * 451 * @param codeId the primary key of the current resource code 452 * @param name the name 453 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 454 * @return the previous, current, and next resource code 455 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 456 * @throws SystemException if a system exception occurred 457 */ 458 public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext( 459 long codeId, java.lang.String name, 460 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 461 throws com.liferay.portal.NoSuchResourceCodeException, 462 com.liferay.portal.kernel.exception.SystemException { 463 return getPersistence() 464 .findByName_PrevAndNext(codeId, name, orderByComparator); 465 } 466 467 /** 468 * Returns the resource code where companyId = ? and name = ? and scope = ? or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found. 469 * 470 * @param companyId the company ID 471 * @param name the name 472 * @param scope the scope 473 * @return the matching resource code 474 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 475 * @throws SystemException if a system exception occurred 476 */ 477 public static com.liferay.portal.model.ResourceCode findByC_N_S( 478 long companyId, java.lang.String name, int scope) 479 throws com.liferay.portal.NoSuchResourceCodeException, 480 com.liferay.portal.kernel.exception.SystemException { 481 return getPersistence().findByC_N_S(companyId, name, scope); 482 } 483 484 /** 485 * Returns the resource code where companyId = ? and name = ? and scope = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 486 * 487 * @param companyId the company ID 488 * @param name the name 489 * @param scope the scope 490 * @return the matching resource code, or <code>null</code> if a matching resource code could not be found 491 * @throws SystemException if a system exception occurred 492 */ 493 public static com.liferay.portal.model.ResourceCode fetchByC_N_S( 494 long companyId, java.lang.String name, int scope) 495 throws com.liferay.portal.kernel.exception.SystemException { 496 return getPersistence().fetchByC_N_S(companyId, name, scope); 497 } 498 499 /** 500 * Returns the resource code where companyId = ? and name = ? and scope = ? 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 name the name 504 * @param scope the scope 505 * @param retrieveFromCache whether to use the finder cache 506 * @return the matching resource code, or <code>null</code> if a matching resource code could not be found 507 * @throws SystemException if a system exception occurred 508 */ 509 public static com.liferay.portal.model.ResourceCode fetchByC_N_S( 510 long companyId, java.lang.String name, int scope, 511 boolean retrieveFromCache) 512 throws com.liferay.portal.kernel.exception.SystemException { 513 return getPersistence() 514 .fetchByC_N_S(companyId, name, scope, retrieveFromCache); 515 } 516 517 /** 518 * Returns all the resource codes. 519 * 520 * @return the resource codes 521 * @throws SystemException if a system exception occurred 522 */ 523 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll() 524 throws com.liferay.portal.kernel.exception.SystemException { 525 return getPersistence().findAll(); 526 } 527 528 /** 529 * Returns a range of all the resource codes. 530 * 531 * <p> 532 * 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. 533 * </p> 534 * 535 * @param start the lower bound of the range of resource codes 536 * @param end the upper bound of the range of resource codes (not inclusive) 537 * @return the range of resource codes 538 * @throws SystemException if a system exception occurred 539 */ 540 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll( 541 int start, int end) 542 throws com.liferay.portal.kernel.exception.SystemException { 543 return getPersistence().findAll(start, end); 544 } 545 546 /** 547 * Returns an ordered range of all the resource codes. 548 * 549 * <p> 550 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 551 * </p> 552 * 553 * @param start the lower bound of the range of resource codes 554 * @param end the upper bound of the range of resource codes (not inclusive) 555 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 556 * @return the ordered range of resource codes 557 * @throws SystemException if a system exception occurred 558 */ 559 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll( 560 int start, int end, 561 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 562 throws com.liferay.portal.kernel.exception.SystemException { 563 return getPersistence().findAll(start, end, orderByComparator); 564 } 565 566 /** 567 * Removes all the resource codes where companyId = ? from the database. 568 * 569 * @param companyId the company ID 570 * @throws SystemException if a system exception occurred 571 */ 572 public static void removeByCompanyId(long companyId) 573 throws com.liferay.portal.kernel.exception.SystemException { 574 getPersistence().removeByCompanyId(companyId); 575 } 576 577 /** 578 * Removes all the resource codes where name = ? from the database. 579 * 580 * @param name the name 581 * @throws SystemException if a system exception occurred 582 */ 583 public static void removeByName(java.lang.String name) 584 throws com.liferay.portal.kernel.exception.SystemException { 585 getPersistence().removeByName(name); 586 } 587 588 /** 589 * Removes the resource code where companyId = ? and name = ? and scope = ? from the database. 590 * 591 * @param companyId the company ID 592 * @param name the name 593 * @param scope the scope 594 * @return the resource code that was removed 595 * @throws SystemException if a system exception occurred 596 */ 597 public static com.liferay.portal.model.ResourceCode removeByC_N_S( 598 long companyId, java.lang.String name, int scope) 599 throws com.liferay.portal.NoSuchResourceCodeException, 600 com.liferay.portal.kernel.exception.SystemException { 601 return getPersistence().removeByC_N_S(companyId, name, scope); 602 } 603 604 /** 605 * Removes all the resource codes from the database. 606 * 607 * @throws SystemException if a system exception occurred 608 */ 609 public static void removeAll() 610 throws com.liferay.portal.kernel.exception.SystemException { 611 getPersistence().removeAll(); 612 } 613 614 /** 615 * Returns the number of resource codes where companyId = ?. 616 * 617 * @param companyId the company ID 618 * @return the number of matching resource codes 619 * @throws SystemException if a system exception occurred 620 */ 621 public static int countByCompanyId(long companyId) 622 throws com.liferay.portal.kernel.exception.SystemException { 623 return getPersistence().countByCompanyId(companyId); 624 } 625 626 /** 627 * Returns the number of resource codes where name = ?. 628 * 629 * @param name the name 630 * @return the number of matching resource codes 631 * @throws SystemException if a system exception occurred 632 */ 633 public static int countByName(java.lang.String name) 634 throws com.liferay.portal.kernel.exception.SystemException { 635 return getPersistence().countByName(name); 636 } 637 638 /** 639 * Returns the number of resource codes where companyId = ? and name = ? and scope = ?. 640 * 641 * @param companyId the company ID 642 * @param name the name 643 * @param scope the scope 644 * @return the number of matching resource codes 645 * @throws SystemException if a system exception occurred 646 */ 647 public static int countByC_N_S(long companyId, java.lang.String name, 648 int scope) throws com.liferay.portal.kernel.exception.SystemException { 649 return getPersistence().countByC_N_S(companyId, name, scope); 650 } 651 652 /** 653 * Returns the number of resource codes. 654 * 655 * @return the number of resource codes 656 * @throws SystemException if a system exception occurred 657 */ 658 public static int countAll() 659 throws com.liferay.portal.kernel.exception.SystemException { 660 return getPersistence().countAll(); 661 } 662 663 public static ResourceCodePersistence getPersistence() { 664 if (_persistence == null) { 665 _persistence = (ResourceCodePersistence)PortalBeanLocatorUtil.locate(ResourceCodePersistence.class.getName()); 666 667 ReferenceRegistry.registerReference(ResourceCodeUtil.class, 668 "_persistence"); 669 } 670 671 return _persistence; 672 } 673 674 /** 675 * @deprecated 676 */ 677 public void setPersistence(ResourceCodePersistence persistence) { 678 } 679 680 private static ResourceCodePersistence _persistence; 681 }