001 /** 002 * Copyright (c) 2000-2010 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.model.ResourceCode; 022 import com.liferay.portal.service.ServiceContext; 023 024 import java.util.List; 025 026 /** 027 * The persistence utility for the resource code service. 028 * 029 * <p> 030 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class. 031 * </p> 032 * 033 * @author Brian Wing Shun Chan 034 * @see ResourceCodePersistence 035 * @see ResourceCodePersistenceImpl 036 * @generated 037 */ 038 public class ResourceCodeUtil { 039 /** 040 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 041 */ 042 public static void clearCache() { 043 getPersistence().clearCache(); 044 } 045 046 /** 047 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 048 */ 049 public static void clearCache(ResourceCode resourceCode) { 050 getPersistence().clearCache(resourceCode); 051 } 052 053 /** 054 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 055 */ 056 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 057 throws SystemException { 058 return getPersistence().countWithDynamicQuery(dynamicQuery); 059 } 060 061 /** 062 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 063 */ 064 public static List<ResourceCode> findWithDynamicQuery( 065 DynamicQuery dynamicQuery) throws SystemException { 066 return getPersistence().findWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 071 */ 072 public static List<ResourceCode> findWithDynamicQuery( 073 DynamicQuery dynamicQuery, int start, int end) 074 throws SystemException { 075 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 076 } 077 078 /** 079 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 080 */ 081 public static List<ResourceCode> findWithDynamicQuery( 082 DynamicQuery dynamicQuery, int start, int end, 083 OrderByComparator orderByComparator) throws SystemException { 084 return getPersistence() 085 .findWithDynamicQuery(dynamicQuery, start, end, 086 orderByComparator); 087 } 088 089 /** 090 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 091 */ 092 public static ResourceCode remove(ResourceCode resourceCode) 093 throws SystemException { 094 return getPersistence().remove(resourceCode); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 099 */ 100 public static ResourceCode update(ResourceCode resourceCode, boolean merge) 101 throws SystemException { 102 return getPersistence().update(resourceCode, merge); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 107 */ 108 public static ResourceCode update(ResourceCode resourceCode, boolean merge, 109 ServiceContext serviceContext) throws SystemException { 110 return getPersistence().update(resourceCode, merge, serviceContext); 111 } 112 113 /** 114 * Caches the resource code in the entity cache if it is enabled. 115 * 116 * @param resourceCode the resource code to cache 117 */ 118 public static void cacheResult( 119 com.liferay.portal.model.ResourceCode resourceCode) { 120 getPersistence().cacheResult(resourceCode); 121 } 122 123 /** 124 * Caches the resource codes in the entity cache if it is enabled. 125 * 126 * @param resourceCodes the resource codes to cache 127 */ 128 public static void cacheResult( 129 java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes) { 130 getPersistence().cacheResult(resourceCodes); 131 } 132 133 /** 134 * Creates a new resource code with the primary key. 135 * 136 * @param codeId the primary key for the new resource code 137 * @return the new resource code 138 */ 139 public static com.liferay.portal.model.ResourceCode create(long codeId) { 140 return getPersistence().create(codeId); 141 } 142 143 /** 144 * Removes the resource code with the primary key from the database. Also notifies the appropriate model listeners. 145 * 146 * @param codeId the primary key of the resource code to remove 147 * @return the resource code that was removed 148 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 149 * @throws SystemException if a system exception occurred 150 */ 151 public static com.liferay.portal.model.ResourceCode remove(long codeId) 152 throws com.liferay.portal.NoSuchResourceCodeException, 153 com.liferay.portal.kernel.exception.SystemException { 154 return getPersistence().remove(codeId); 155 } 156 157 public static com.liferay.portal.model.ResourceCode updateImpl( 158 com.liferay.portal.model.ResourceCode resourceCode, boolean merge) 159 throws com.liferay.portal.kernel.exception.SystemException { 160 return getPersistence().updateImpl(resourceCode, merge); 161 } 162 163 /** 164 * Finds the resource code with the primary key or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found. 165 * 166 * @param codeId the primary key of the resource code to find 167 * @return the resource code 168 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 169 * @throws SystemException if a system exception occurred 170 */ 171 public static com.liferay.portal.model.ResourceCode findByPrimaryKey( 172 long codeId) 173 throws com.liferay.portal.NoSuchResourceCodeException, 174 com.liferay.portal.kernel.exception.SystemException { 175 return getPersistence().findByPrimaryKey(codeId); 176 } 177 178 /** 179 * Finds the resource code with the primary key or returns <code>null</code> if it could not be found. 180 * 181 * @param codeId the primary key of the resource code to find 182 * @return the resource code, or <code>null</code> if a resource code with the primary key could not be found 183 * @throws SystemException if a system exception occurred 184 */ 185 public static com.liferay.portal.model.ResourceCode fetchByPrimaryKey( 186 long codeId) throws com.liferay.portal.kernel.exception.SystemException { 187 return getPersistence().fetchByPrimaryKey(codeId); 188 } 189 190 /** 191 * Finds all the resource codes where companyId = ?. 192 * 193 * @param companyId the company id to search with 194 * @return the matching resource codes 195 * @throws SystemException if a system exception occurred 196 */ 197 public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId( 198 long companyId) 199 throws com.liferay.portal.kernel.exception.SystemException { 200 return getPersistence().findByCompanyId(companyId); 201 } 202 203 /** 204 * Finds a range of all the resource codes where companyId = ?. 205 * 206 * <p> 207 * 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. 208 * </p> 209 * 210 * @param companyId the company id to search with 211 * @param start the lower bound of the range of resource codes to return 212 * @param end the upper bound of the range of resource codes to return (not inclusive) 213 * @return the range of matching resource codes 214 * @throws SystemException if a system exception occurred 215 */ 216 public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId( 217 long companyId, int start, int end) 218 throws com.liferay.portal.kernel.exception.SystemException { 219 return getPersistence().findByCompanyId(companyId, start, end); 220 } 221 222 /** 223 * Finds an ordered range of all the resource codes where companyId = ?. 224 * 225 * <p> 226 * 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. 227 * </p> 228 * 229 * @param companyId the company id to search with 230 * @param start the lower bound of the range of resource codes to return 231 * @param end the upper bound of the range of resource codes to return (not inclusive) 232 * @param orderByComparator the comparator to order the results by 233 * @return the ordered range of matching resource codes 234 * @throws SystemException if a system exception occurred 235 */ 236 public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId( 237 long companyId, int start, int end, 238 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 239 throws com.liferay.portal.kernel.exception.SystemException { 240 return getPersistence() 241 .findByCompanyId(companyId, start, end, orderByComparator); 242 } 243 244 /** 245 * Finds the first resource code in the ordered set where companyId = ?. 246 * 247 * <p> 248 * 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. 249 * </p> 250 * 251 * @param companyId the company id to search with 252 * @param orderByComparator the comparator to order the set by 253 * @return the first matching resource code 254 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 255 * @throws SystemException if a system exception occurred 256 */ 257 public static com.liferay.portal.model.ResourceCode findByCompanyId_First( 258 long companyId, 259 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 260 throws com.liferay.portal.NoSuchResourceCodeException, 261 com.liferay.portal.kernel.exception.SystemException { 262 return getPersistence() 263 .findByCompanyId_First(companyId, orderByComparator); 264 } 265 266 /** 267 * Finds the last resource code in the ordered set where companyId = ?. 268 * 269 * <p> 270 * 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. 271 * </p> 272 * 273 * @param companyId the company id to search with 274 * @param orderByComparator the comparator to order the set by 275 * @return the last matching resource code 276 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 277 * @throws SystemException if a system exception occurred 278 */ 279 public static com.liferay.portal.model.ResourceCode findByCompanyId_Last( 280 long companyId, 281 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 282 throws com.liferay.portal.NoSuchResourceCodeException, 283 com.liferay.portal.kernel.exception.SystemException { 284 return getPersistence() 285 .findByCompanyId_Last(companyId, orderByComparator); 286 } 287 288 /** 289 * Finds the resource codes before and after the current resource code in the ordered set where companyId = ?. 290 * 291 * <p> 292 * 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. 293 * </p> 294 * 295 * @param codeId the primary key of the current resource code 296 * @param companyId the company id to search with 297 * @param orderByComparator the comparator to order the set by 298 * @return the previous, current, and next resource code 299 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 300 * @throws SystemException if a system exception occurred 301 */ 302 public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext( 303 long codeId, long companyId, 304 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 305 throws com.liferay.portal.NoSuchResourceCodeException, 306 com.liferay.portal.kernel.exception.SystemException { 307 return getPersistence() 308 .findByCompanyId_PrevAndNext(codeId, companyId, 309 orderByComparator); 310 } 311 312 /** 313 * Finds all the resource codes where name = ?. 314 * 315 * @param name the name to search with 316 * @return the matching resource codes 317 * @throws SystemException if a system exception occurred 318 */ 319 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 320 java.lang.String name) 321 throws com.liferay.portal.kernel.exception.SystemException { 322 return getPersistence().findByName(name); 323 } 324 325 /** 326 * Finds a range of all the resource codes where name = ?. 327 * 328 * <p> 329 * 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. 330 * </p> 331 * 332 * @param name the name to search with 333 * @param start the lower bound of the range of resource codes to return 334 * @param end the upper bound of the range of resource codes to return (not inclusive) 335 * @return the range of 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, int start, int end) 340 throws com.liferay.portal.kernel.exception.SystemException { 341 return getPersistence().findByName(name, start, end); 342 } 343 344 /** 345 * Finds an ordered 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 to search with 352 * @param start the lower bound of the range of resource codes to return 353 * @param end the upper bound of the range of resource codes to return (not inclusive) 354 * @param orderByComparator the comparator to order the results by 355 * @return the ordered range of matching resource codes 356 * @throws SystemException if a system exception occurred 357 */ 358 public static java.util.List<com.liferay.portal.model.ResourceCode> findByName( 359 java.lang.String name, int start, int end, 360 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 361 throws com.liferay.portal.kernel.exception.SystemException { 362 return getPersistence().findByName(name, start, end, orderByComparator); 363 } 364 365 /** 366 * Finds the first resource code in the ordered set where name = ?. 367 * 368 * <p> 369 * 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. 370 * </p> 371 * 372 * @param name the name to search with 373 * @param orderByComparator the comparator to order the set by 374 * @return the first matching resource code 375 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 376 * @throws SystemException if a system exception occurred 377 */ 378 public static com.liferay.portal.model.ResourceCode findByName_First( 379 java.lang.String name, 380 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 381 throws com.liferay.portal.NoSuchResourceCodeException, 382 com.liferay.portal.kernel.exception.SystemException { 383 return getPersistence().findByName_First(name, orderByComparator); 384 } 385 386 /** 387 * Finds the last resource code in the ordered set where name = ?. 388 * 389 * <p> 390 * 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. 391 * </p> 392 * 393 * @param name the name to search with 394 * @param orderByComparator the comparator to order the set by 395 * @return the last matching resource code 396 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 397 * @throws SystemException if a system exception occurred 398 */ 399 public static com.liferay.portal.model.ResourceCode findByName_Last( 400 java.lang.String name, 401 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 402 throws com.liferay.portal.NoSuchResourceCodeException, 403 com.liferay.portal.kernel.exception.SystemException { 404 return getPersistence().findByName_Last(name, orderByComparator); 405 } 406 407 /** 408 * Finds the resource codes before and after the current resource code in the ordered set where name = ?. 409 * 410 * <p> 411 * 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. 412 * </p> 413 * 414 * @param codeId the primary key of the current resource code 415 * @param name the name to search with 416 * @param orderByComparator the comparator to order the set by 417 * @return the previous, current, and next resource code 418 * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found 419 * @throws SystemException if a system exception occurred 420 */ 421 public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext( 422 long codeId, java.lang.String name, 423 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 424 throws com.liferay.portal.NoSuchResourceCodeException, 425 com.liferay.portal.kernel.exception.SystemException { 426 return getPersistence() 427 .findByName_PrevAndNext(codeId, name, orderByComparator); 428 } 429 430 /** 431 * Finds the resource code where companyId = ? and name = ? and scope = ? or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found. 432 * 433 * @param companyId the company id to search with 434 * @param name the name to search with 435 * @param scope the scope to search with 436 * @return the matching resource code 437 * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found 438 * @throws SystemException if a system exception occurred 439 */ 440 public static com.liferay.portal.model.ResourceCode findByC_N_S( 441 long companyId, java.lang.String name, int scope) 442 throws com.liferay.portal.NoSuchResourceCodeException, 443 com.liferay.portal.kernel.exception.SystemException { 444 return getPersistence().findByC_N_S(companyId, name, scope); 445 } 446 447 /** 448 * 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. 449 * 450 * @param companyId the company id to search with 451 * @param name the name to search with 452 * @param scope the scope to search with 453 * @return the matching resource code, or <code>null</code> if a matching resource code could not be found 454 * @throws SystemException if a system exception occurred 455 */ 456 public static com.liferay.portal.model.ResourceCode fetchByC_N_S( 457 long companyId, java.lang.String name, int scope) 458 throws com.liferay.portal.kernel.exception.SystemException { 459 return getPersistence().fetchByC_N_S(companyId, name, scope); 460 } 461 462 /** 463 * 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. 464 * 465 * @param companyId the company id to search with 466 * @param name the name to search with 467 * @param scope the scope to search with 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 * Finds 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 * Finds 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 to return 498 * @param end the upper bound of the range of resource codes to return (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 * Finds 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 to return 516 * @param end the upper bound of the range of resource codes to return (not inclusive) 517 * @param orderByComparator the comparator to order the results by 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 to search with 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 to search with 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 to search with 554 * @param name the name to search with 555 * @param scope the scope to search with 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 * Counts all the resource codes where companyId = ?. 577 * 578 * @param companyId the company id to search with 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 * Counts all the resource codes where name = ?. 589 * 590 * @param name the name to search with 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 * Counts all the resource codes where companyId = ? and name = ? and scope = ?. 601 * 602 * @param companyId the company id to search with 603 * @param name the name to search with 604 * @param scope the scope to search with 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 * Counts all the 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 629 return _persistence; 630 } 631 632 public void setPersistence(ResourceCodePersistence persistence) { 633 _persistence = persistence; 634 } 635 636 private static ResourceCodePersistence _persistence; 637 }