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.ServiceComponent; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the service component service. This utility wraps {@link ServiceComponentPersistenceImpl} 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 ServiceComponentPersistence 036 * @see ServiceComponentPersistenceImpl 037 * @generated 038 */ 039 public class ServiceComponentUtil { 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(ServiceComponent serviceComponent) { 057 getPersistence().clearCache(serviceComponent); 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<ServiceComponent> 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<ServiceComponent> 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<ServiceComponent> 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) 098 */ 099 public static ServiceComponent update(ServiceComponent serviceComponent) 100 throws SystemException { 101 return getPersistence().update(serviceComponent); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 106 */ 107 public static ServiceComponent update(ServiceComponent serviceComponent, 108 ServiceContext serviceContext) throws SystemException { 109 return getPersistence().update(serviceComponent, serviceContext); 110 } 111 112 /** 113 * Caches the service component in the entity cache if it is enabled. 114 * 115 * @param serviceComponent the service component 116 */ 117 public static void cacheResult( 118 com.liferay.portal.model.ServiceComponent serviceComponent) { 119 getPersistence().cacheResult(serviceComponent); 120 } 121 122 /** 123 * Caches the service components in the entity cache if it is enabled. 124 * 125 * @param serviceComponents the service components 126 */ 127 public static void cacheResult( 128 java.util.List<com.liferay.portal.model.ServiceComponent> serviceComponents) { 129 getPersistence().cacheResult(serviceComponents); 130 } 131 132 /** 133 * Creates a new service component with the primary key. Does not add the service component to the database. 134 * 135 * @param serviceComponentId the primary key for the new service component 136 * @return the new service component 137 */ 138 public static com.liferay.portal.model.ServiceComponent create( 139 long serviceComponentId) { 140 return getPersistence().create(serviceComponentId); 141 } 142 143 /** 144 * Removes the service component with the primary key from the database. Also notifies the appropriate model listeners. 145 * 146 * @param serviceComponentId the primary key of the service component 147 * @return the service component that was removed 148 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 149 * @throws SystemException if a system exception occurred 150 */ 151 public static com.liferay.portal.model.ServiceComponent remove( 152 long serviceComponentId) 153 throws com.liferay.portal.NoSuchServiceComponentException, 154 com.liferay.portal.kernel.exception.SystemException { 155 return getPersistence().remove(serviceComponentId); 156 } 157 158 public static com.liferay.portal.model.ServiceComponent updateImpl( 159 com.liferay.portal.model.ServiceComponent serviceComponent) 160 throws com.liferay.portal.kernel.exception.SystemException { 161 return getPersistence().updateImpl(serviceComponent); 162 } 163 164 /** 165 * Returns the service component with the primary key or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found. 166 * 167 * @param serviceComponentId the primary key of the service component 168 * @return the service component 169 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 170 * @throws SystemException if a system exception occurred 171 */ 172 public static com.liferay.portal.model.ServiceComponent findByPrimaryKey( 173 long serviceComponentId) 174 throws com.liferay.portal.NoSuchServiceComponentException, 175 com.liferay.portal.kernel.exception.SystemException { 176 return getPersistence().findByPrimaryKey(serviceComponentId); 177 } 178 179 /** 180 * Returns the service component with the primary key or returns <code>null</code> if it could not be found. 181 * 182 * @param serviceComponentId the primary key of the service component 183 * @return the service component, or <code>null</code> if a service component with the primary key could not be found 184 * @throws SystemException if a system exception occurred 185 */ 186 public static com.liferay.portal.model.ServiceComponent fetchByPrimaryKey( 187 long serviceComponentId) 188 throws com.liferay.portal.kernel.exception.SystemException { 189 return getPersistence().fetchByPrimaryKey(serviceComponentId); 190 } 191 192 /** 193 * Returns all the service components where buildNamespace = ?. 194 * 195 * @param buildNamespace the build namespace 196 * @return the matching service components 197 * @throws SystemException if a system exception occurred 198 */ 199 public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 200 java.lang.String buildNamespace) 201 throws com.liferay.portal.kernel.exception.SystemException { 202 return getPersistence().findByBuildNamespace(buildNamespace); 203 } 204 205 /** 206 * Returns a range of all the service components where buildNamespace = ?. 207 * 208 * <p> 209 * 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. 210 * </p> 211 * 212 * @param buildNamespace the build namespace 213 * @param start the lower bound of the range of service components 214 * @param end the upper bound of the range of service components (not inclusive) 215 * @return the range of matching service components 216 * @throws SystemException if a system exception occurred 217 */ 218 public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 219 java.lang.String buildNamespace, int start, int end) 220 throws com.liferay.portal.kernel.exception.SystemException { 221 return getPersistence().findByBuildNamespace(buildNamespace, start, end); 222 } 223 224 /** 225 * Returns an ordered range of all the service components where buildNamespace = ?. 226 * 227 * <p> 228 * 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. 229 * </p> 230 * 231 * @param buildNamespace the build namespace 232 * @param start the lower bound of the range of service components 233 * @param end the upper bound of the range of service components (not inclusive) 234 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 235 * @return the ordered range of matching service components 236 * @throws SystemException if a system exception occurred 237 */ 238 public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 239 java.lang.String buildNamespace, int start, int end, 240 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 241 throws com.liferay.portal.kernel.exception.SystemException { 242 return getPersistence() 243 .findByBuildNamespace(buildNamespace, start, end, 244 orderByComparator); 245 } 246 247 /** 248 * Returns the first service component in the ordered set where buildNamespace = ?. 249 * 250 * @param buildNamespace the build namespace 251 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 252 * @return the first matching service component 253 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 254 * @throws SystemException if a system exception occurred 255 */ 256 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_First( 257 java.lang.String buildNamespace, 258 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 259 throws com.liferay.portal.NoSuchServiceComponentException, 260 com.liferay.portal.kernel.exception.SystemException { 261 return getPersistence() 262 .findByBuildNamespace_First(buildNamespace, orderByComparator); 263 } 264 265 /** 266 * Returns the first service component in the ordered set where buildNamespace = ?. 267 * 268 * @param buildNamespace the build namespace 269 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 270 * @return the first matching service component, or <code>null</code> if a matching service component could not be found 271 * @throws SystemException if a system exception occurred 272 */ 273 public static com.liferay.portal.model.ServiceComponent fetchByBuildNamespace_First( 274 java.lang.String buildNamespace, 275 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 276 throws com.liferay.portal.kernel.exception.SystemException { 277 return getPersistence() 278 .fetchByBuildNamespace_First(buildNamespace, 279 orderByComparator); 280 } 281 282 /** 283 * Returns the last service component in the ordered set where buildNamespace = ?. 284 * 285 * @param buildNamespace the build namespace 286 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 287 * @return the last matching service component 288 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 289 * @throws SystemException if a system exception occurred 290 */ 291 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_Last( 292 java.lang.String buildNamespace, 293 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 294 throws com.liferay.portal.NoSuchServiceComponentException, 295 com.liferay.portal.kernel.exception.SystemException { 296 return getPersistence() 297 .findByBuildNamespace_Last(buildNamespace, orderByComparator); 298 } 299 300 /** 301 * Returns the last service component in the ordered set where buildNamespace = ?. 302 * 303 * @param buildNamespace the build namespace 304 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 305 * @return the last matching service component, or <code>null</code> if a matching service component could not be found 306 * @throws SystemException if a system exception occurred 307 */ 308 public static com.liferay.portal.model.ServiceComponent fetchByBuildNamespace_Last( 309 java.lang.String buildNamespace, 310 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 311 throws com.liferay.portal.kernel.exception.SystemException { 312 return getPersistence() 313 .fetchByBuildNamespace_Last(buildNamespace, orderByComparator); 314 } 315 316 /** 317 * Returns the service components before and after the current service component in the ordered set where buildNamespace = ?. 318 * 319 * @param serviceComponentId the primary key of the current service component 320 * @param buildNamespace the build namespace 321 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 322 * @return the previous, current, and next service component 323 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 324 * @throws SystemException if a system exception occurred 325 */ 326 public static com.liferay.portal.model.ServiceComponent[] findByBuildNamespace_PrevAndNext( 327 long serviceComponentId, java.lang.String buildNamespace, 328 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 329 throws com.liferay.portal.NoSuchServiceComponentException, 330 com.liferay.portal.kernel.exception.SystemException { 331 return getPersistence() 332 .findByBuildNamespace_PrevAndNext(serviceComponentId, 333 buildNamespace, orderByComparator); 334 } 335 336 /** 337 * Returns the service component where buildNamespace = ? and buildNumber = ? or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found. 338 * 339 * @param buildNamespace the build namespace 340 * @param buildNumber the build number 341 * @return the matching service component 342 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 343 * @throws SystemException if a system exception occurred 344 */ 345 public static com.liferay.portal.model.ServiceComponent findByBNS_BNU( 346 java.lang.String buildNamespace, long buildNumber) 347 throws com.liferay.portal.NoSuchServiceComponentException, 348 com.liferay.portal.kernel.exception.SystemException { 349 return getPersistence().findByBNS_BNU(buildNamespace, buildNumber); 350 } 351 352 /** 353 * Returns the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 354 * 355 * @param buildNamespace the build namespace 356 * @param buildNumber the build number 357 * @return the matching service component, or <code>null</code> if a matching service component could not be found 358 * @throws SystemException if a system exception occurred 359 */ 360 public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU( 361 java.lang.String buildNamespace, long buildNumber) 362 throws com.liferay.portal.kernel.exception.SystemException { 363 return getPersistence().fetchByBNS_BNU(buildNamespace, buildNumber); 364 } 365 366 /** 367 * Returns the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 368 * 369 * @param buildNamespace the build namespace 370 * @param buildNumber the build number 371 * @param retrieveFromCache whether to use the finder cache 372 * @return the matching service component, or <code>null</code> if a matching service component could not be found 373 * @throws SystemException if a system exception occurred 374 */ 375 public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU( 376 java.lang.String buildNamespace, long buildNumber, 377 boolean retrieveFromCache) 378 throws com.liferay.portal.kernel.exception.SystemException { 379 return getPersistence() 380 .fetchByBNS_BNU(buildNamespace, buildNumber, 381 retrieveFromCache); 382 } 383 384 /** 385 * Returns all the service components. 386 * 387 * @return the service components 388 * @throws SystemException if a system exception occurred 389 */ 390 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll() 391 throws com.liferay.portal.kernel.exception.SystemException { 392 return getPersistence().findAll(); 393 } 394 395 /** 396 * Returns a range of all the service components. 397 * 398 * <p> 399 * 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. 400 * </p> 401 * 402 * @param start the lower bound of the range of service components 403 * @param end the upper bound of the range of service components (not inclusive) 404 * @return the range of service components 405 * @throws SystemException if a system exception occurred 406 */ 407 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll( 408 int start, int end) 409 throws com.liferay.portal.kernel.exception.SystemException { 410 return getPersistence().findAll(start, end); 411 } 412 413 /** 414 * Returns an ordered range of all the service components. 415 * 416 * <p> 417 * 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. 418 * </p> 419 * 420 * @param start the lower bound of the range of service components 421 * @param end the upper bound of the range of service components (not inclusive) 422 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 423 * @return the ordered range of service components 424 * @throws SystemException if a system exception occurred 425 */ 426 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll( 427 int start, int end, 428 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 429 throws com.liferay.portal.kernel.exception.SystemException { 430 return getPersistence().findAll(start, end, orderByComparator); 431 } 432 433 /** 434 * Removes all the service components where buildNamespace = ? from the database. 435 * 436 * @param buildNamespace the build namespace 437 * @throws SystemException if a system exception occurred 438 */ 439 public static void removeByBuildNamespace(java.lang.String buildNamespace) 440 throws com.liferay.portal.kernel.exception.SystemException { 441 getPersistence().removeByBuildNamespace(buildNamespace); 442 } 443 444 /** 445 * Removes the service component where buildNamespace = ? and buildNumber = ? from the database. 446 * 447 * @param buildNamespace the build namespace 448 * @param buildNumber the build number 449 * @return the service component that was removed 450 * @throws SystemException if a system exception occurred 451 */ 452 public static com.liferay.portal.model.ServiceComponent removeByBNS_BNU( 453 java.lang.String buildNamespace, long buildNumber) 454 throws com.liferay.portal.NoSuchServiceComponentException, 455 com.liferay.portal.kernel.exception.SystemException { 456 return getPersistence().removeByBNS_BNU(buildNamespace, buildNumber); 457 } 458 459 /** 460 * Removes all the service components from the database. 461 * 462 * @throws SystemException if a system exception occurred 463 */ 464 public static void removeAll() 465 throws com.liferay.portal.kernel.exception.SystemException { 466 getPersistence().removeAll(); 467 } 468 469 /** 470 * Returns the number of service components where buildNamespace = ?. 471 * 472 * @param buildNamespace the build namespace 473 * @return the number of matching service components 474 * @throws SystemException if a system exception occurred 475 */ 476 public static int countByBuildNamespace(java.lang.String buildNamespace) 477 throws com.liferay.portal.kernel.exception.SystemException { 478 return getPersistence().countByBuildNamespace(buildNamespace); 479 } 480 481 /** 482 * Returns the number of service components where buildNamespace = ? and buildNumber = ?. 483 * 484 * @param buildNamespace the build namespace 485 * @param buildNumber the build number 486 * @return the number of matching service components 487 * @throws SystemException if a system exception occurred 488 */ 489 public static int countByBNS_BNU(java.lang.String buildNamespace, 490 long buildNumber) 491 throws com.liferay.portal.kernel.exception.SystemException { 492 return getPersistence().countByBNS_BNU(buildNamespace, buildNumber); 493 } 494 495 /** 496 * Returns the number of service components. 497 * 498 * @return the number of service components 499 * @throws SystemException if a system exception occurred 500 */ 501 public static int countAll() 502 throws com.liferay.portal.kernel.exception.SystemException { 503 return getPersistence().countAll(); 504 } 505 506 public static ServiceComponentPersistence getPersistence() { 507 if (_persistence == null) { 508 _persistence = (ServiceComponentPersistence)PortalBeanLocatorUtil.locate(ServiceComponentPersistence.class.getName()); 509 510 ReferenceRegistry.registerReference(ServiceComponentUtil.class, 511 "_persistence"); 512 } 513 514 return _persistence; 515 } 516 517 /** 518 * @deprecated 519 */ 520 public void setPersistence(ServiceComponentPersistence persistence) { 521 } 522 523 private static ServiceComponentPersistence _persistence; 524 }