001 /** 002 * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.util.OrderByComparator; 022 import com.liferay.portal.kernel.util.ReferenceRegistry; 023 import com.liferay.portal.model.ServiceComponent; 024 import com.liferay.portal.service.ServiceContext; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the service component service. This utility wraps {@link com.liferay.portal.service.persistence.impl.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. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see ServiceComponentPersistence 037 * @see com.liferay.portal.service.persistence.impl.ServiceComponentPersistenceImpl 038 * @generated 039 */ 040 @ProviderType 041 public class ServiceComponentUtil { 042 /* 043 * NOTE FOR DEVELOPERS: 044 * 045 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 046 */ 047 048 /** 049 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 050 */ 051 public static void clearCache() { 052 getPersistence().clearCache(); 053 } 054 055 /** 056 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 057 */ 058 public static void clearCache(ServiceComponent serviceComponent) { 059 getPersistence().clearCache(serviceComponent); 060 } 061 062 /** 063 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 064 */ 065 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<ServiceComponent> findWithDynamicQuery( 073 DynamicQuery dynamicQuery) { 074 return getPersistence().findWithDynamicQuery(dynamicQuery); 075 } 076 077 /** 078 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 079 */ 080 public static List<ServiceComponent> findWithDynamicQuery( 081 DynamicQuery dynamicQuery, int start, int end) { 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<ServiceComponent> orderByComparator) { 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 return getPersistence().update(serviceComponent); 101 } 102 103 /** 104 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 105 */ 106 public static ServiceComponent update(ServiceComponent serviceComponent, 107 ServiceContext serviceContext) { 108 return getPersistence().update(serviceComponent, serviceContext); 109 } 110 111 /** 112 * Returns all the service components where buildNamespace = ?. 113 * 114 * @param buildNamespace the build namespace 115 * @return the matching service components 116 */ 117 public static List<ServiceComponent> findByBuildNamespace( 118 java.lang.String buildNamespace) { 119 return getPersistence().findByBuildNamespace(buildNamespace); 120 } 121 122 /** 123 * Returns a range of all the service components where buildNamespace = ?. 124 * 125 * <p> 126 * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 127 * </p> 128 * 129 * @param buildNamespace the build namespace 130 * @param start the lower bound of the range of service components 131 * @param end the upper bound of the range of service components (not inclusive) 132 * @return the range of matching service components 133 */ 134 public static List<ServiceComponent> findByBuildNamespace( 135 java.lang.String buildNamespace, int start, int end) { 136 return getPersistence().findByBuildNamespace(buildNamespace, start, end); 137 } 138 139 /** 140 * Returns an ordered range of all the service components where buildNamespace = ?. 141 * 142 * <p> 143 * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 144 * </p> 145 * 146 * @param buildNamespace the build namespace 147 * @param start the lower bound of the range of service components 148 * @param end the upper bound of the range of service components (not inclusive) 149 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 150 * @return the ordered range of matching service components 151 */ 152 public static List<ServiceComponent> findByBuildNamespace( 153 java.lang.String buildNamespace, int start, int end, 154 OrderByComparator<ServiceComponent> orderByComparator) { 155 return getPersistence() 156 .findByBuildNamespace(buildNamespace, start, end, 157 orderByComparator); 158 } 159 160 /** 161 * Returns an ordered range of all the service components where buildNamespace = ?. 162 * 163 * <p> 164 * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 165 * </p> 166 * 167 * @param buildNamespace the build namespace 168 * @param start the lower bound of the range of service components 169 * @param end the upper bound of the range of service components (not inclusive) 170 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 171 * @param retrieveFromCache whether to retrieve from the finder cache 172 * @return the ordered range of matching service components 173 */ 174 public static List<ServiceComponent> findByBuildNamespace( 175 java.lang.String buildNamespace, int start, int end, 176 OrderByComparator<ServiceComponent> orderByComparator, 177 boolean retrieveFromCache) { 178 return getPersistence() 179 .findByBuildNamespace(buildNamespace, start, end, 180 orderByComparator, retrieveFromCache); 181 } 182 183 /** 184 * Returns the first service component in the ordered set where buildNamespace = ?. 185 * 186 * @param buildNamespace the build namespace 187 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 188 * @return the first matching service component 189 * @throws NoSuchServiceComponentException if a matching service component could not be found 190 */ 191 public static ServiceComponent findByBuildNamespace_First( 192 java.lang.String buildNamespace, 193 OrderByComparator<ServiceComponent> orderByComparator) 194 throws com.liferay.portal.exception.NoSuchServiceComponentException { 195 return getPersistence() 196 .findByBuildNamespace_First(buildNamespace, orderByComparator); 197 } 198 199 /** 200 * Returns the first service component in the ordered set where buildNamespace = ?. 201 * 202 * @param buildNamespace the build namespace 203 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 204 * @return the first matching service component, or <code>null</code> if a matching service component could not be found 205 */ 206 public static ServiceComponent fetchByBuildNamespace_First( 207 java.lang.String buildNamespace, 208 OrderByComparator<ServiceComponent> orderByComparator) { 209 return getPersistence() 210 .fetchByBuildNamespace_First(buildNamespace, 211 orderByComparator); 212 } 213 214 /** 215 * Returns the last service component in the ordered set where buildNamespace = ?. 216 * 217 * @param buildNamespace the build namespace 218 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 219 * @return the last matching service component 220 * @throws NoSuchServiceComponentException if a matching service component could not be found 221 */ 222 public static ServiceComponent findByBuildNamespace_Last( 223 java.lang.String buildNamespace, 224 OrderByComparator<ServiceComponent> orderByComparator) 225 throws com.liferay.portal.exception.NoSuchServiceComponentException { 226 return getPersistence() 227 .findByBuildNamespace_Last(buildNamespace, orderByComparator); 228 } 229 230 /** 231 * Returns the last service component in the ordered set where buildNamespace = ?. 232 * 233 * @param buildNamespace the build namespace 234 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 235 * @return the last matching service component, or <code>null</code> if a matching service component could not be found 236 */ 237 public static ServiceComponent fetchByBuildNamespace_Last( 238 java.lang.String buildNamespace, 239 OrderByComparator<ServiceComponent> orderByComparator) { 240 return getPersistence() 241 .fetchByBuildNamespace_Last(buildNamespace, orderByComparator); 242 } 243 244 /** 245 * Returns the service components before and after the current service component in the ordered set where buildNamespace = ?. 246 * 247 * @param serviceComponentId the primary key of the current service component 248 * @param buildNamespace the build namespace 249 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 250 * @return the previous, current, and next service component 251 * @throws NoSuchServiceComponentException if a service component with the primary key could not be found 252 */ 253 public static ServiceComponent[] findByBuildNamespace_PrevAndNext( 254 long serviceComponentId, java.lang.String buildNamespace, 255 OrderByComparator<ServiceComponent> orderByComparator) 256 throws com.liferay.portal.exception.NoSuchServiceComponentException { 257 return getPersistence() 258 .findByBuildNamespace_PrevAndNext(serviceComponentId, 259 buildNamespace, orderByComparator); 260 } 261 262 /** 263 * Removes all the service components where buildNamespace = ? from the database. 264 * 265 * @param buildNamespace the build namespace 266 */ 267 public static void removeByBuildNamespace(java.lang.String buildNamespace) { 268 getPersistence().removeByBuildNamespace(buildNamespace); 269 } 270 271 /** 272 * Returns the number of service components where buildNamespace = ?. 273 * 274 * @param buildNamespace the build namespace 275 * @return the number of matching service components 276 */ 277 public static int countByBuildNamespace(java.lang.String buildNamespace) { 278 return getPersistence().countByBuildNamespace(buildNamespace); 279 } 280 281 /** 282 * Returns the service component where buildNamespace = ? and buildNumber = ? or throws a {@link NoSuchServiceComponentException} if it could not be found. 283 * 284 * @param buildNamespace the build namespace 285 * @param buildNumber the build number 286 * @return the matching service component 287 * @throws NoSuchServiceComponentException if a matching service component could not be found 288 */ 289 public static ServiceComponent findByBNS_BNU( 290 java.lang.String buildNamespace, long buildNumber) 291 throws com.liferay.portal.exception.NoSuchServiceComponentException { 292 return getPersistence().findByBNS_BNU(buildNamespace, buildNumber); 293 } 294 295 /** 296 * Returns the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 297 * 298 * @param buildNamespace the build namespace 299 * @param buildNumber the build number 300 * @return the matching service component, or <code>null</code> if a matching service component could not be found 301 */ 302 public static ServiceComponent fetchByBNS_BNU( 303 java.lang.String buildNamespace, long buildNumber) { 304 return getPersistence().fetchByBNS_BNU(buildNamespace, buildNumber); 305 } 306 307 /** 308 * Returns the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 309 * 310 * @param buildNamespace the build namespace 311 * @param buildNumber the build number 312 * @param retrieveFromCache whether to retrieve from the finder cache 313 * @return the matching service component, or <code>null</code> if a matching service component could not be found 314 */ 315 public static ServiceComponent fetchByBNS_BNU( 316 java.lang.String buildNamespace, long buildNumber, 317 boolean retrieveFromCache) { 318 return getPersistence() 319 .fetchByBNS_BNU(buildNamespace, buildNumber, 320 retrieveFromCache); 321 } 322 323 /** 324 * Removes the service component where buildNamespace = ? and buildNumber = ? from the database. 325 * 326 * @param buildNamespace the build namespace 327 * @param buildNumber the build number 328 * @return the service component that was removed 329 */ 330 public static ServiceComponent removeByBNS_BNU( 331 java.lang.String buildNamespace, long buildNumber) 332 throws com.liferay.portal.exception.NoSuchServiceComponentException { 333 return getPersistence().removeByBNS_BNU(buildNamespace, buildNumber); 334 } 335 336 /** 337 * Returns the number of service components where buildNamespace = ? and buildNumber = ?. 338 * 339 * @param buildNamespace the build namespace 340 * @param buildNumber the build number 341 * @return the number of matching service components 342 */ 343 public static int countByBNS_BNU(java.lang.String buildNamespace, 344 long buildNumber) { 345 return getPersistence().countByBNS_BNU(buildNamespace, buildNumber); 346 } 347 348 /** 349 * Caches the service component in the entity cache if it is enabled. 350 * 351 * @param serviceComponent the service component 352 */ 353 public static void cacheResult(ServiceComponent serviceComponent) { 354 getPersistence().cacheResult(serviceComponent); 355 } 356 357 /** 358 * Caches the service components in the entity cache if it is enabled. 359 * 360 * @param serviceComponents the service components 361 */ 362 public static void cacheResult(List<ServiceComponent> serviceComponents) { 363 getPersistence().cacheResult(serviceComponents); 364 } 365 366 /** 367 * Creates a new service component with the primary key. Does not add the service component to the database. 368 * 369 * @param serviceComponentId the primary key for the new service component 370 * @return the new service component 371 */ 372 public static ServiceComponent create(long serviceComponentId) { 373 return getPersistence().create(serviceComponentId); 374 } 375 376 /** 377 * Removes the service component with the primary key from the database. Also notifies the appropriate model listeners. 378 * 379 * @param serviceComponentId the primary key of the service component 380 * @return the service component that was removed 381 * @throws NoSuchServiceComponentException if a service component with the primary key could not be found 382 */ 383 public static ServiceComponent remove(long serviceComponentId) 384 throws com.liferay.portal.exception.NoSuchServiceComponentException { 385 return getPersistence().remove(serviceComponentId); 386 } 387 388 public static ServiceComponent updateImpl(ServiceComponent serviceComponent) { 389 return getPersistence().updateImpl(serviceComponent); 390 } 391 392 /** 393 * Returns the service component with the primary key or throws a {@link NoSuchServiceComponentException} if it could not be found. 394 * 395 * @param serviceComponentId the primary key of the service component 396 * @return the service component 397 * @throws NoSuchServiceComponentException if a service component with the primary key could not be found 398 */ 399 public static ServiceComponent findByPrimaryKey(long serviceComponentId) 400 throws com.liferay.portal.exception.NoSuchServiceComponentException { 401 return getPersistence().findByPrimaryKey(serviceComponentId); 402 } 403 404 /** 405 * Returns the service component with the primary key or returns <code>null</code> if it could not be found. 406 * 407 * @param serviceComponentId the primary key of the service component 408 * @return the service component, or <code>null</code> if a service component with the primary key could not be found 409 */ 410 public static ServiceComponent fetchByPrimaryKey(long serviceComponentId) { 411 return getPersistence().fetchByPrimaryKey(serviceComponentId); 412 } 413 414 public static java.util.Map<java.io.Serializable, ServiceComponent> fetchByPrimaryKeys( 415 java.util.Set<java.io.Serializable> primaryKeys) { 416 return getPersistence().fetchByPrimaryKeys(primaryKeys); 417 } 418 419 /** 420 * Returns all the service components. 421 * 422 * @return the service components 423 */ 424 public static List<ServiceComponent> findAll() { 425 return getPersistence().findAll(); 426 } 427 428 /** 429 * Returns a range of all the service components. 430 * 431 * <p> 432 * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 433 * </p> 434 * 435 * @param start the lower bound of the range of service components 436 * @param end the upper bound of the range of service components (not inclusive) 437 * @return the range of service components 438 */ 439 public static List<ServiceComponent> findAll(int start, int end) { 440 return getPersistence().findAll(start, end); 441 } 442 443 /** 444 * Returns an ordered range of all the service components. 445 * 446 * <p> 447 * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 448 * </p> 449 * 450 * @param start the lower bound of the range of service components 451 * @param end the upper bound of the range of service components (not inclusive) 452 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 453 * @return the ordered range of service components 454 */ 455 public static List<ServiceComponent> findAll(int start, int end, 456 OrderByComparator<ServiceComponent> orderByComparator) { 457 return getPersistence().findAll(start, end, orderByComparator); 458 } 459 460 /** 461 * Returns an ordered range of all the service components. 462 * 463 * <p> 464 * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ServiceComponentModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 465 * </p> 466 * 467 * @param start the lower bound of the range of service components 468 * @param end the upper bound of the range of service components (not inclusive) 469 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 470 * @param retrieveFromCache whether to retrieve from the finder cache 471 * @return the ordered range of service components 472 */ 473 public static List<ServiceComponent> findAll(int start, int end, 474 OrderByComparator<ServiceComponent> orderByComparator, 475 boolean retrieveFromCache) { 476 return getPersistence() 477 .findAll(start, end, orderByComparator, retrieveFromCache); 478 } 479 480 /** 481 * Removes all the service components from the database. 482 */ 483 public static void removeAll() { 484 getPersistence().removeAll(); 485 } 486 487 /** 488 * Returns the number of service components. 489 * 490 * @return the number of service components 491 */ 492 public static int countAll() { 493 return getPersistence().countAll(); 494 } 495 496 public static java.util.Set<java.lang.String> getBadColumnNames() { 497 return getPersistence().getBadColumnNames(); 498 } 499 500 public static ServiceComponentPersistence getPersistence() { 501 if (_persistence == null) { 502 _persistence = (ServiceComponentPersistence)PortalBeanLocatorUtil.locate(ServiceComponentPersistence.class.getName()); 503 504 ReferenceRegistry.registerReference(ServiceComponentUtil.class, 505 "_persistence"); 506 } 507 508 return _persistence; 509 } 510 511 private static ServiceComponentPersistence _persistence; 512 }