001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service.persistence; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.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 to cache 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 to cache 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 to remove 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 * Finds 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 to find 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 * Finds 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 to find 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 * Finds all the resource codes where companyId = ?. 199 * 200 * @param companyId the company ID to search with 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 * Finds 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 to search with 218 * @param start the lower bound of the range of resource codes to return 219 * @param end the upper bound of the range of resource codes to return (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 * Finds 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 to search with 237 * @param start the lower bound of the range of resource codes to return 238 * @param end the upper bound of the range of resource codes to return (not inclusive) 239 * @param orderByComparator the comparator to order the results by 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 * Finds 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 to search with 259 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 281 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 304 * @param orderByComparator the comparator to order the set by 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 * Finds all the resource codes where name = ?. 321 * 322 * @param name the name to search with 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 * Finds 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 to search with 340 * @param start the lower bound of the range of resource codes to return 341 * @param end the upper bound of the range of resource codes to return (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 * Finds 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 to search with 359 * @param start the lower bound of the range of resource codes to return 360 * @param end the upper bound of the range of resource codes to return (not inclusive) 361 * @param orderByComparator the comparator to order the results by 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 * Finds 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 to search with 380 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 401 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 423 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 441 * @param name the name to search with 442 * @param scope the scope to search with 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 * Finds 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 to search with 458 * @param name the name to search with 459 * @param scope the scope to search with 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 * Finds 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 to search with 473 * @param name the name to search with 474 * @param scope the scope to search with 475 * @return the matching resource code, or <code>null</code> if a matching resource code could not be found 476 * @throws SystemException if a system exception occurred 477 */ 478 public static com.liferay.portal.model.ResourceCode fetchByC_N_S( 479 long companyId, java.lang.String name, int scope, 480 boolean retrieveFromCache) 481 throws com.liferay.portal.kernel.exception.SystemException { 482 return getPersistence() 483 .fetchByC_N_S(companyId, name, scope, retrieveFromCache); 484 } 485 486 /** 487 * Finds all the resource codes. 488 * 489 * @return the resource codes 490 * @throws SystemException if a system exception occurred 491 */ 492 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll() 493 throws com.liferay.portal.kernel.exception.SystemException { 494 return getPersistence().findAll(); 495 } 496 497 /** 498 * Finds a range of all the resource codes. 499 * 500 * <p> 501 * 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. 502 * </p> 503 * 504 * @param start the lower bound of the range of resource codes to return 505 * @param end the upper bound of the range of resource codes to return (not inclusive) 506 * @return the range of resource codes 507 * @throws SystemException if a system exception occurred 508 */ 509 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll( 510 int start, int end) 511 throws com.liferay.portal.kernel.exception.SystemException { 512 return getPersistence().findAll(start, end); 513 } 514 515 /** 516 * Finds an ordered range of all the resource codes. 517 * 518 * <p> 519 * 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. 520 * </p> 521 * 522 * @param start the lower bound of the range of resource codes to return 523 * @param end the upper bound of the range of resource codes to return (not inclusive) 524 * @param orderByComparator the comparator to order the results by 525 * @return the ordered range of resource codes 526 * @throws SystemException if a system exception occurred 527 */ 528 public static java.util.List<com.liferay.portal.model.ResourceCode> findAll( 529 int start, int end, 530 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 531 throws com.liferay.portal.kernel.exception.SystemException { 532 return getPersistence().findAll(start, end, orderByComparator); 533 } 534 535 /** 536 * Removes all the resource codes where companyId = ? from the database. 537 * 538 * @param companyId the company ID to search with 539 * @throws SystemException if a system exception occurred 540 */ 541 public static void removeByCompanyId(long companyId) 542 throws com.liferay.portal.kernel.exception.SystemException { 543 getPersistence().removeByCompanyId(companyId); 544 } 545 546 /** 547 * Removes all the resource codes where name = ? from the database. 548 * 549 * @param name the name to search with 550 * @throws SystemException if a system exception occurred 551 */ 552 public static void removeByName(java.lang.String name) 553 throws com.liferay.portal.kernel.exception.SystemException { 554 getPersistence().removeByName(name); 555 } 556 557 /** 558 * Removes the resource code where companyId = ? and name = ? and scope = ? from the database. 559 * 560 * @param companyId the company ID to search with 561 * @param name the name to search with 562 * @param scope the scope to search with 563 * @throws SystemException if a system exception occurred 564 */ 565 public static void removeByC_N_S(long companyId, java.lang.String name, 566 int scope) 567 throws com.liferay.portal.NoSuchResourceCodeException, 568 com.liferay.portal.kernel.exception.SystemException { 569 getPersistence().removeByC_N_S(companyId, name, scope); 570 } 571 572 /** 573 * Removes all the resource codes from the database. 574 * 575 * @throws SystemException if a system exception occurred 576 */ 577 public static void removeAll() 578 throws com.liferay.portal.kernel.exception.SystemException { 579 getPersistence().removeAll(); 580 } 581 582 /** 583 * Counts all the resource codes where companyId = ?. 584 * 585 * @param companyId the company ID to search with 586 * @return the number of matching resource codes 587 * @throws SystemException if a system exception occurred 588 */ 589 public static int countByCompanyId(long companyId) 590 throws com.liferay.portal.kernel.exception.SystemException { 591 return getPersistence().countByCompanyId(companyId); 592 } 593 594 /** 595 * Counts all the resource codes where name = ?. 596 * 597 * @param name the name to search with 598 * @return the number of matching resource codes 599 * @throws SystemException if a system exception occurred 600 */ 601 public static int countByName(java.lang.String name) 602 throws com.liferay.portal.kernel.exception.SystemException { 603 return getPersistence().countByName(name); 604 } 605 606 /** 607 * Counts all the resource codes where companyId = ? and name = ? and scope = ?. 608 * 609 * @param companyId the company ID to search with 610 * @param name the name to search with 611 * @param scope the scope to search with 612 * @return the number of matching resource codes 613 * @throws SystemException if a system exception occurred 614 */ 615 public static int countByC_N_S(long companyId, java.lang.String name, 616 int scope) throws com.liferay.portal.kernel.exception.SystemException { 617 return getPersistence().countByC_N_S(companyId, name, scope); 618 } 619 620 /** 621 * Counts all the resource codes. 622 * 623 * @return the number of resource codes 624 * @throws SystemException if a system exception occurred 625 */ 626 public static int countAll() 627 throws com.liferay.portal.kernel.exception.SystemException { 628 return getPersistence().countAll(); 629 } 630 631 public static ResourceCodePersistence getPersistence() { 632 if (_persistence == null) { 633 _persistence = (ResourceCodePersistence)PortalBeanLocatorUtil.locate(ResourceCodePersistence.class.getName()); 634 635 ReferenceRegistry.registerReference(ResourceCodeUtil.class, 636 "_persistence"); 637 } 638 639 return _persistence; 640 } 641 642 public void setPersistence(ResourceCodePersistence persistence) { 643 _persistence = persistence; 644 645 ReferenceRegistry.registerReference(ResourceCodeUtil.class, 646 "_persistence"); 647 } 648 649 private static ResourceCodePersistence _persistence; 650 }