001 /** 002 * Copyright (c) 2000-2011 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#remove(com.liferay.portal.model.BaseModel) 098 */ 099 public static ResourceCode remove(ResourceCode resourceCode) 100 throws SystemException { 101 return getPersistence().remove(resourceCode); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 106 */ 107 public static ResourceCode update(ResourceCode resourceCode, boolean merge) 108 throws SystemException { 109 return getPersistence().update(resourceCode, merge); 110 } 111 112 /** 113 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 114 */ 115 public static ResourceCode update(ResourceCode resourceCode, boolean merge, 116 ServiceContext serviceContext) throws SystemException { 117 return getPersistence().update(resourceCode, merge, serviceContext); 118 } 119 120 /** 121 * Caches the resource code in the entity cache if it is enabled. 122 * 123 * @param resourceCode the resource code 124 */ 125 public static void cacheResult( 126 com.liferay.portal.model.ResourceCode resourceCode) { 127 getPersistence().cacheResult(resourceCode); 128 } 129 130 /** 131 * Caches the resource codes in the entity cache if it is enabled. 132 * 133 * @param resourceCodes the resource codes 134 */ 135 public static void cacheResult( 136 java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes) { 137 getPersistence().cacheResult(resourceCodes); 138 } 139 140 /** 141 * Creates a new resource code with the primary key. Does not add the resource code to the database. 142 * 143 * @param codeId the primary key for the new resource code 144 * @return the new resource code 145 */ 146 public static com.liferay.portal.model.ResourceCode create(long codeId) { 147 return getPersistence().create(codeId); 148 } 149 150 /** 151 * Removes the resource code with the primary key from the database. Also notifies the appropriate model listeners. 152 * 153 * @param codeId the primary key of the resource code 154 * @return the resource code that was removed 155 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 156 * @throws SystemException if a system exception occurred 157 */ 158 public static com.liferay.portal.model.ResourceCode remove(long codeId) 159 throws com.liferay.portal.NoSuchResourceCodeException, 160 com.liferay.portal.kernel.exception.SystemException { 161 return getPersistence().remove(codeId); 162 } 163 164 public static com.liferay.portal.model.ResourceCode updateImpl( 165 com.liferay.portal.model.ResourceCode resourceCode, boolean merge) 166 throws com.liferay.portal.kernel.exception.SystemException { 167 return getPersistence().updateImpl(resourceCode, merge); 168 } 169 170 /** 171 * Returns the resource code with the primary key or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found. 172 * 173 * @param codeId the primary key of the resource code 174 * @return the resource code 175 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 176 * @throws SystemException if a system exception occurred 177 */ 178 public static com.liferay.portal.model.ResourceCode findByPrimaryKey( 179 long codeId) 180 throws com.liferay.portal.NoSuchResourceCodeException, 181 com.liferay.portal.kernel.exception.SystemException { 182 return getPersistence().findByPrimaryKey(codeId); 183 } 184 185 /** 186 * Returns the resource code with the primary key or returns <code>null</code> if it could not be found. 187 * 188 * @param codeId the primary key of the resource code 189 * @return the resource code, or <code>null</code> if a resource code with the primary key could not be found 190 * @throws SystemException if a system exception occurred 191 */ 192 public static com.liferay.portal.model.ResourceCode fetchByPrimaryKey( 193 long codeId) throws com.liferay.portal.kernel.exception.SystemException { 194 return getPersistence().fetchByPrimaryKey(codeId); 195 } 196 197 /** 198 * Returns all the resource codes where companyId = ?. 199 * 200 * @param companyId the company ID 201 * @return the matching resource codes 202 * @throws SystemException if a system exception occurred 203 */ 204 public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId( 205 long companyId) 206 throws com.liferay.portal.kernel.exception.SystemException { 207 return getPersistence().findByCompanyId(companyId); 208 } 209 210 /** 211 * Returns a range of all the resource codes where companyId = ?. 212 * 213 * <p> 214 * 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. 215 * </p> 216 * 217 * @param companyId the company ID 218 * @param start the lower bound of the range of resource codes 219 * @param end the upper bound of the range of resource codes (not inclusive) 220 * @return the range of matching resource codes 221 * @throws SystemException if a system exception occurred 222 */ 223 public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId( 224 long companyId, int start, int end) 225 throws com.liferay.portal.kernel.exception.SystemException { 226 return getPersistence().findByCompanyId(companyId, start, end); 227 } 228 229 /** 230 * Returns an ordered range of all the resource codes where companyId = ?. 231 * 232 * <p> 233 * 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. 234 * </p> 235 * 236 * @param companyId the company ID 237 * @param start the lower bound of the range of resource codes 238 * @param end the upper bound of the range of resource codes (not inclusive) 239 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 240 * @return the ordered range of matching resource codes 241 * @throws SystemException if a system exception occurred 242 */ 243 public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId( 244 long companyId, int start, int end, 245 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 246 throws com.liferay.portal.kernel.exception.SystemException { 247 return getPersistence() 248 .findByCompanyId(companyId, start, end, orderByComparator); 249 } 250 251 /** 252 * Returns the first resource code in the ordered set where companyId = ?. 253 * 254 * <p> 255 * 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. 256 * </p> 257 * 258 * @param companyId the company ID 259 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 260 * @return the first matching resource code 261 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 262 * @throws SystemException if a system exception occurred 263 */ 264 public static com.liferay.portal.model.ResourceCode findByCompanyId_First( 265 long companyId, 266 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 267 throws com.liferay.portal.NoSuchResourceCodeException, 268 com.liferay.portal.kernel.exception.SystemException { 269 return getPersistence() 270 .findByCompanyId_First(companyId, orderByComparator); 271 } 272 273 /** 274 * Returns the last resource code in the ordered set where companyId = ?. 275 * 276 * <p> 277 * 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. 278 * </p> 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 resource codes before and after the current resource code in the ordered set where companyId = ?. 297 * 298 * <p> 299 * 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. 300 * </p> 301 * 302 * @param codeId the primary key of the current resource code 303 * @param companyId the company ID 304 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 305 * @return the previous, current, and next resource code 306 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 307 * @throws SystemException if a system exception occurred 308 */ 309 public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext( 310 long codeId, long companyId, 311 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 312 throws com.liferay.portal.NoSuchResourceCodeException, 313 com.liferay.portal.kernel.exception.SystemException { 314 return getPersistence() 315 .findByCompanyId_PrevAndNext(codeId, companyId, 316 orderByComparator); 317 } 318 319 /** 320 * Returns all the resource codes where name = ?. 321 * 322 * @param name the name 323 * @return the matching resource codes 324 * @throws SystemException if a system exception occurred 325 */ 326 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 327 java.lang.String name) 328 throws com.liferay.portal.kernel.exception.SystemException { 329 return getPersistence().findByName(name); 330 } 331 332 /** 333 * Returns a range of all the resource codes where name = ?. 334 * 335 * <p> 336 * 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. 337 * </p> 338 * 339 * @param name the name 340 * @param start the lower bound of the range of resource codes 341 * @param end the upper bound of the range of resource codes (not inclusive) 342 * @return the range of matching resource codes 343 * @throws SystemException if a system exception occurred 344 */ 345 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 346 java.lang.String name, int start, int end) 347 throws com.liferay.portal.kernel.exception.SystemException { 348 return getPersistence().findByName(name, start, end); 349 } 350 351 /** 352 * Returns an ordered range of all the resource codes where name = ?. 353 * 354 * <p> 355 * 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. 356 * </p> 357 * 358 * @param name the name 359 * @param start the lower bound of the range of resource codes 360 * @param end the upper bound of the range of resource codes (not inclusive) 361 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 362 * @return the ordered range of matching resource codes 363 * @throws SystemException if a system exception occurred 364 */ 365 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 366 java.lang.String name, int start, int end, 367 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 368 throws com.liferay.portal.kernel.exception.SystemException { 369 return getPersistence().findByName(name, start, end, orderByComparator); 370 } 371 372 /** 373 * Returns the first resource code in the ordered set where name = ?. 374 * 375 * <p> 376 * 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. 377 * </p> 378 * 379 * @param name the name 380 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 381 * @return the first matching resource code 382 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 383 * @throws SystemException if a system exception occurred 384 */ 385 public static com.liferay.portal.model.ResourceCode findByName_First( 386 java.lang.String name, 387 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 388 throws com.liferay.portal.NoSuchResourceCodeException, 389 com.liferay.portal.kernel.exception.SystemException { 390 return getPersistence().findByName_First(name, orderByComparator); 391 } 392 393 /** 394 * Returns the last resource code in the ordered set where name = ?. 395 * 396 * <p> 397 * 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. 398 * </p> 399 * 400 * @param name the name 401 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 402 * @return the last matching resource code 403 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 404 * @throws SystemException if a system exception occurred 405 */ 406 public static com.liferay.portal.model.ResourceCode findByName_Last( 407 java.lang.String name, 408 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 409 throws com.liferay.portal.NoSuchResourceCodeException, 410 com.liferay.portal.kernel.exception.SystemException { 411 return getPersistence().findByName_Last(name, orderByComparator); 412 } 413 414 /** 415 * Returns the resource codes before and after the current resource code in the ordered set where name = ?. 416 * 417 * <p> 418 * 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. 419 * </p> 420 * 421 * @param codeId the primary key of the current resource code 422 * @param name the name 423 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 424 * @return the previous, current, and next resource code 425 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 426 * @throws SystemException if a system exception occurred 427 */ 428 public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext( 429 long codeId, java.lang.String name, 430 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 431 throws com.liferay.portal.NoSuchResourceCodeException, 432 com.liferay.portal.kernel.exception.SystemException { 433 return getPersistence() 434 .findByName_PrevAndNext(codeId, name, orderByComparator); 435 } 436 437 /** 438 * Returns the resource code where companyId = ? and name = ? and scope = ? or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found. 439 * 440 * @param companyId the company ID 441 * @param name the name 442 * @param scope the scope 443 * @return the matching resource code 444 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 445 * @throws SystemException if a system exception occurred 446 */ 447 public static com.liferay.portal.model.ResourceCode findByC_N_S( 448 long companyId, java.lang.String name, int scope) 449 throws com.liferay.portal.NoSuchResourceCodeException, 450 com.liferay.portal.kernel.exception.SystemException { 451 return getPersistence().findByC_N_S(companyId, name, scope); 452 } 453 454 /** 455 * 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. 456 * 457 * @param companyId the company ID 458 * @param name the name 459 * @param scope the scope 460 * @return the matching resource code, or <code>null</code> if a matching resource code could not be found 461 * @throws SystemException if a system exception occurred 462 */ 463 public static com.liferay.portal.model.ResourceCode fetchByC_N_S( 464 long companyId, java.lang.String name, int scope) 465 throws com.liferay.portal.kernel.exception.SystemException { 466 return getPersistence().fetchByC_N_S(companyId, name, scope); 467 } 468 469 /** 470 * 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. 471 * 472 * @param companyId the company ID 473 * @param name the name 474 * @param scope the scope 475 * @param retrieveFromCache whether to use the finder cache 476 * @return the matching resource code, or <code>null</code> if a matching resource code could not be found 477 * @throws SystemException if a system exception occurred 478 */ 479 public static com.liferay.portal.model.ResourceCode fetchByC_N_S( 480 long companyId, java.lang.String name, int scope, 481 boolean retrieveFromCache) 482 throws com.liferay.portal.kernel.exception.SystemException { 483 return getPersistence() 484 .fetchByC_N_S(companyId, name, scope, retrieveFromCache); 485 } 486 487 /** 488 * Returns all the resource codes. 489 * 490 * @return the resource codes 491 * @throws SystemException if a system exception occurred 492 */ 493 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll() 494 throws com.liferay.portal.kernel.exception.SystemException { 495 return getPersistence().findAll(); 496 } 497 498 /** 499 * Returns a range of all the resource codes. 500 * 501 * <p> 502 * 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. 503 * </p> 504 * 505 * @param start the lower bound of the range of resource codes 506 * @param end the upper bound of the range of resource codes (not inclusive) 507 * @return the range of resource codes 508 * @throws SystemException if a system exception occurred 509 */ 510 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll( 511 int start, int end) 512 throws com.liferay.portal.kernel.exception.SystemException { 513 return getPersistence().findAll(start, end); 514 } 515 516 /** 517 * Returns an ordered range of all the resource codes. 518 * 519 * <p> 520 * 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. 521 * </p> 522 * 523 * @param start the lower bound of the range of resource codes 524 * @param end the upper bound of the range of resource codes (not inclusive) 525 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 526 * @return the ordered range of resource codes 527 * @throws SystemException if a system exception occurred 528 */ 529 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll( 530 int start, int end, 531 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 532 throws com.liferay.portal.kernel.exception.SystemException { 533 return getPersistence().findAll(start, end, orderByComparator); 534 } 535 536 /** 537 * Removes all the resource codes where companyId = ? from the database. 538 * 539 * @param companyId the company ID 540 * @throws SystemException if a system exception occurred 541 */ 542 public static void removeByCompanyId(long companyId) 543 throws com.liferay.portal.kernel.exception.SystemException { 544 getPersistence().removeByCompanyId(companyId); 545 } 546 547 /** 548 * Removes all the resource codes where name = ? from the database. 549 * 550 * @param name the name 551 * @throws SystemException if a system exception occurred 552 */ 553 public static void removeByName(java.lang.String name) 554 throws com.liferay.portal.kernel.exception.SystemException { 555 getPersistence().removeByName(name); 556 } 557 558 /** 559 * Removes the resource code where companyId = ? and name = ? and scope = ? from the database. 560 * 561 * @param companyId the company ID 562 * @param name the name 563 * @param scope the scope 564 * @throws SystemException if a system exception occurred 565 */ 566 public static void removeByC_N_S(long companyId, java.lang.String name, 567 int scope) 568 throws com.liferay.portal.NoSuchResourceCodeException, 569 com.liferay.portal.kernel.exception.SystemException { 570 getPersistence().removeByC_N_S(companyId, name, scope); 571 } 572 573 /** 574 * Removes all the resource codes from the database. 575 * 576 * @throws SystemException if a system exception occurred 577 */ 578 public static void removeAll() 579 throws com.liferay.portal.kernel.exception.SystemException { 580 getPersistence().removeAll(); 581 } 582 583 /** 584 * Returns the number of resource codes where companyId = ?. 585 * 586 * @param companyId the company ID 587 * @return the number of matching resource codes 588 * @throws SystemException if a system exception occurred 589 */ 590 public static int countByCompanyId(long companyId) 591 throws com.liferay.portal.kernel.exception.SystemException { 592 return getPersistence().countByCompanyId(companyId); 593 } 594 595 /** 596 * Returns the number of resource codes where name = ?. 597 * 598 * @param name the name 599 * @return the number of matching resource codes 600 * @throws SystemException if a system exception occurred 601 */ 602 public static int countByName(java.lang.String name) 603 throws com.liferay.portal.kernel.exception.SystemException { 604 return getPersistence().countByName(name); 605 } 606 607 /** 608 * Returns the number of resource codes where companyId = ? and name = ? and scope = ?. 609 * 610 * @param companyId the company ID 611 * @param name the name 612 * @param scope the scope 613 * @return the number of matching resource codes 614 * @throws SystemException if a system exception occurred 615 */ 616 public static int countByC_N_S(long companyId, java.lang.String name, 617 int scope) throws com.liferay.portal.kernel.exception.SystemException { 618 return getPersistence().countByC_N_S(companyId, name, scope); 619 } 620 621 /** 622 * Returns the number of resource codes. 623 * 624 * @return the number of resource codes 625 * @throws SystemException if a system exception occurred 626 */ 627 public static int countAll() 628 throws com.liferay.portal.kernel.exception.SystemException { 629 return getPersistence().countAll(); 630 } 631 632 public static ResourceCodePersistence getPersistence() { 633 if (_persistence == null) { 634 _persistence = (ResourceCodePersistence)PortalBeanLocatorUtil.locate(ResourceCodePersistence.class.getName()); 635 636 ReferenceRegistry.registerReference(ResourceCodeUtil.class, 637 "_persistence"); 638 } 639 640 return _persistence; 641 } 642 643 public void setPersistence(ResourceCodePersistence persistence) { 644 _persistence = persistence; 645 646 ReferenceRegistry.registerReference(ResourceCodeUtil.class, 647 "_persistence"); 648 } 649 650 private static ResourceCodePersistence _persistence; 651 }