001 /** 002 * Copyright (c) 2000-2012 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 * <p> 247 * 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. 248 * </p> 249 * 250 * @param companyId the company ID 251 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 252 * @return the first matching resource code 253 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 254 * @throws SystemException if a system exception occurred 255 */ 256 public static com.liferay.portal.model.ResourceCode findByCompanyId_First( 257 long companyId, 258 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 259 throws com.liferay.portal.NoSuchResourceCodeException, 260 com.liferay.portal.kernel.exception.SystemException { 261 return getPersistence() 262 .findByCompanyId_First(companyId, orderByComparator); 263 } 264 265 /** 266 * Returns the last resource code in the ordered set where companyId = ?. 267 * 268 * <p> 269 * 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. 270 * </p> 271 * 272 * @param companyId the company ID 273 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 274 * @return the last matching resource code 275 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 276 * @throws SystemException if a system exception occurred 277 */ 278 public static com.liferay.portal.model.ResourceCode findByCompanyId_Last( 279 long companyId, 280 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 281 throws com.liferay.portal.NoSuchResourceCodeException, 282 com.liferay.portal.kernel.exception.SystemException { 283 return getPersistence() 284 .findByCompanyId_Last(companyId, orderByComparator); 285 } 286 287 /** 288 * Returns the resource codes before and after the current resource code in the ordered set where companyId = ?. 289 * 290 * <p> 291 * 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. 292 * </p> 293 * 294 * @param codeId the primary key of the current resource code 295 * @param companyId the company ID 296 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 297 * @return the previous, current, and next resource code 298 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 299 * @throws SystemException if a system exception occurred 300 */ 301 public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext( 302 long codeId, long companyId, 303 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 304 throws com.liferay.portal.NoSuchResourceCodeException, 305 com.liferay.portal.kernel.exception.SystemException { 306 return getPersistence() 307 .findByCompanyId_PrevAndNext(codeId, companyId, 308 orderByComparator); 309 } 310 311 /** 312 * Returns all the resource codes where name = ?. 313 * 314 * @param name the name 315 * @return the matching resource codes 316 * @throws SystemException if a system exception occurred 317 */ 318 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 319 java.lang.String name) 320 throws com.liferay.portal.kernel.exception.SystemException { 321 return getPersistence().findByName(name); 322 } 323 324 /** 325 * Returns a range of all the resource codes where name = ?. 326 * 327 * <p> 328 * 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. 329 * </p> 330 * 331 * @param name the name 332 * @param start the lower bound of the range of resource codes 333 * @param end the upper bound of the range of resource codes (not inclusive) 334 * @return the range of matching resource codes 335 * @throws SystemException if a system exception occurred 336 */ 337 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 338 java.lang.String name, int start, int end) 339 throws com.liferay.portal.kernel.exception.SystemException { 340 return getPersistence().findByName(name, start, end); 341 } 342 343 /** 344 * Returns an ordered range of all the resource codes where name = ?. 345 * 346 * <p> 347 * 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. 348 * </p> 349 * 350 * @param name the name 351 * @param start the lower bound of the range of resource codes 352 * @param end the upper bound of the range of resource codes (not inclusive) 353 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 354 * @return the ordered 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 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 360 throws com.liferay.portal.kernel.exception.SystemException { 361 return getPersistence().findByName(name, start, end, orderByComparator); 362 } 363 364 /** 365 * Returns the first resource code in the ordered set where name = ?. 366 * 367 * <p> 368 * 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. 369 * </p> 370 * 371 * @param name the name 372 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 373 * @return the first matching resource code 374 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 375 * @throws SystemException if a system exception occurred 376 */ 377 public static com.liferay.portal.model.ResourceCode findByName_First( 378 java.lang.String name, 379 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 380 throws com.liferay.portal.NoSuchResourceCodeException, 381 com.liferay.portal.kernel.exception.SystemException { 382 return getPersistence().findByName_First(name, orderByComparator); 383 } 384 385 /** 386 * Returns the last resource code in the ordered set where name = ?. 387 * 388 * <p> 389 * 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. 390 * </p> 391 * 392 * @param name the name 393 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 394 * @return the last matching resource code 395 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 396 * @throws SystemException if a system exception occurred 397 */ 398 public static com.liferay.portal.model.ResourceCode findByName_Last( 399 java.lang.String name, 400 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 401 throws com.liferay.portal.NoSuchResourceCodeException, 402 com.liferay.portal.kernel.exception.SystemException { 403 return getPersistence().findByName_Last(name, orderByComparator); 404 } 405 406 /** 407 * Returns the resource codes before and after the current resource code in the ordered set where name = ?. 408 * 409 * <p> 410 * 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. 411 * </p> 412 * 413 * @param codeId the primary key of the current resource code 414 * @param name the name 415 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 416 * @return the previous, current, and next resource code 417 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 418 * @throws SystemException if a system exception occurred 419 */ 420 public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext( 421 long codeId, java.lang.String name, 422 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 423 throws com.liferay.portal.NoSuchResourceCodeException, 424 com.liferay.portal.kernel.exception.SystemException { 425 return getPersistence() 426 .findByName_PrevAndNext(codeId, name, orderByComparator); 427 } 428 429 /** 430 * Returns the resource code where companyId = ? and name = ? and scope = ? or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found. 431 * 432 * @param companyId the company ID 433 * @param name the name 434 * @param scope the scope 435 * @return the matching resource code 436 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 437 * @throws SystemException if a system exception occurred 438 */ 439 public static com.liferay.portal.model.ResourceCode findByC_N_S( 440 long companyId, java.lang.String name, int scope) 441 throws com.liferay.portal.NoSuchResourceCodeException, 442 com.liferay.portal.kernel.exception.SystemException { 443 return getPersistence().findByC_N_S(companyId, name, scope); 444 } 445 446 /** 447 * 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. 448 * 449 * @param companyId the company ID 450 * @param name the name 451 * @param scope the scope 452 * @return the matching resource code, or <code>null</code> if a matching resource code could not be found 453 * @throws SystemException if a system exception occurred 454 */ 455 public static com.liferay.portal.model.ResourceCode fetchByC_N_S( 456 long companyId, java.lang.String name, int scope) 457 throws com.liferay.portal.kernel.exception.SystemException { 458 return getPersistence().fetchByC_N_S(companyId, name, scope); 459 } 460 461 /** 462 * 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. 463 * 464 * @param companyId the company ID 465 * @param name the name 466 * @param scope the scope 467 * @param retrieveFromCache whether to use the finder cache 468 * @return the matching resource code, or <code>null</code> if a matching resource code could not be found 469 * @throws SystemException if a system exception occurred 470 */ 471 public static com.liferay.portal.model.ResourceCode fetchByC_N_S( 472 long companyId, java.lang.String name, int scope, 473 boolean retrieveFromCache) 474 throws com.liferay.portal.kernel.exception.SystemException { 475 return getPersistence() 476 .fetchByC_N_S(companyId, name, scope, retrieveFromCache); 477 } 478 479 /** 480 * Returns all the resource codes. 481 * 482 * @return the resource codes 483 * @throws SystemException if a system exception occurred 484 */ 485 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll() 486 throws com.liferay.portal.kernel.exception.SystemException { 487 return getPersistence().findAll(); 488 } 489 490 /** 491 * Returns a range of all the resource codes. 492 * 493 * <p> 494 * 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. 495 * </p> 496 * 497 * @param start the lower bound of the range of resource codes 498 * @param end the upper bound of the range of resource codes (not inclusive) 499 * @return the range of resource codes 500 * @throws SystemException if a system exception occurred 501 */ 502 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll( 503 int start, int end) 504 throws com.liferay.portal.kernel.exception.SystemException { 505 return getPersistence().findAll(start, end); 506 } 507 508 /** 509 * Returns an ordered range of all the resource codes. 510 * 511 * <p> 512 * 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. 513 * </p> 514 * 515 * @param start the lower bound of the range of resource codes 516 * @param end the upper bound of the range of resource codes (not inclusive) 517 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 518 * @return the ordered range of resource codes 519 * @throws SystemException if a system exception occurred 520 */ 521 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll( 522 int start, int end, 523 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 524 throws com.liferay.portal.kernel.exception.SystemException { 525 return getPersistence().findAll(start, end, orderByComparator); 526 } 527 528 /** 529 * Removes all the resource codes where companyId = ? from the database. 530 * 531 * @param companyId the company ID 532 * @throws SystemException if a system exception occurred 533 */ 534 public static void removeByCompanyId(long companyId) 535 throws com.liferay.portal.kernel.exception.SystemException { 536 getPersistence().removeByCompanyId(companyId); 537 } 538 539 /** 540 * Removes all the resource codes where name = ? from the database. 541 * 542 * @param name the name 543 * @throws SystemException if a system exception occurred 544 */ 545 public static void removeByName(java.lang.String name) 546 throws com.liferay.portal.kernel.exception.SystemException { 547 getPersistence().removeByName(name); 548 } 549 550 /** 551 * Removes the resource code where companyId = ? and name = ? and scope = ? from the database. 552 * 553 * @param companyId the company ID 554 * @param name the name 555 * @param scope the scope 556 * @throws SystemException if a system exception occurred 557 */ 558 public static void removeByC_N_S(long companyId, java.lang.String name, 559 int scope) 560 throws com.liferay.portal.NoSuchResourceCodeException, 561 com.liferay.portal.kernel.exception.SystemException { 562 getPersistence().removeByC_N_S(companyId, name, scope); 563 } 564 565 /** 566 * Removes all the resource codes from the database. 567 * 568 * @throws SystemException if a system exception occurred 569 */ 570 public static void removeAll() 571 throws com.liferay.portal.kernel.exception.SystemException { 572 getPersistence().removeAll(); 573 } 574 575 /** 576 * Returns the number of resource codes where companyId = ?. 577 * 578 * @param companyId the company ID 579 * @return the number of matching resource codes 580 * @throws SystemException if a system exception occurred 581 */ 582 public static int countByCompanyId(long companyId) 583 throws com.liferay.portal.kernel.exception.SystemException { 584 return getPersistence().countByCompanyId(companyId); 585 } 586 587 /** 588 * Returns the number of resource codes where name = ?. 589 * 590 * @param name the name 591 * @return the number of matching resource codes 592 * @throws SystemException if a system exception occurred 593 */ 594 public static int countByName(java.lang.String name) 595 throws com.liferay.portal.kernel.exception.SystemException { 596 return getPersistence().countByName(name); 597 } 598 599 /** 600 * Returns the number of resource codes where companyId = ? and name = ? and scope = ?. 601 * 602 * @param companyId the company ID 603 * @param name the name 604 * @param scope the scope 605 * @return the number of matching resource codes 606 * @throws SystemException if a system exception occurred 607 */ 608 public static int countByC_N_S(long companyId, java.lang.String name, 609 int scope) throws com.liferay.portal.kernel.exception.SystemException { 610 return getPersistence().countByC_N_S(companyId, name, scope); 611 } 612 613 /** 614 * Returns the number of resource codes. 615 * 616 * @return the number of resource codes 617 * @throws SystemException if a system exception occurred 618 */ 619 public static int countAll() 620 throws com.liferay.portal.kernel.exception.SystemException { 621 return getPersistence().countAll(); 622 } 623 624 public static ResourceCodePersistence getPersistence() { 625 if (_persistence == null) { 626 _persistence = (ResourceCodePersistence)PortalBeanLocatorUtil.locate(ResourceCodePersistence.class.getName()); 627 628 ReferenceRegistry.registerReference(ResourceCodeUtil.class, 629 "_persistence"); 630 } 631 632 return _persistence; 633 } 634 635 public void setPersistence(ResourceCodePersistence persistence) { 636 _persistence = persistence; 637 638 ReferenceRegistry.registerReference(ResourceCodeUtil.class, 639 "_persistence"); 640 } 641 642 private static ResourceCodePersistence _persistence; 643 }