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