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 the first service component in the ordered set where buildNamespace = ?. 162 * 163 * @param buildNamespace the build namespace 164 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 165 * @return the first matching service component 166 * @throws NoSuchServiceComponentException if a matching service component could not be found 167 */ 168 public static ServiceComponent findByBuildNamespace_First( 169 java.lang.String buildNamespace, 170 OrderByComparator<ServiceComponent> orderByComparator) 171 throws com.liferay.portal.NoSuchServiceComponentException { 172 return getPersistence() 173 .findByBuildNamespace_First(buildNamespace, orderByComparator); 174 } 175 176 /** 177 * Returns the first service component in the ordered set where buildNamespace = ?. 178 * 179 * @param buildNamespace the build namespace 180 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 181 * @return the first matching service component, or <code>null</code> if a matching service component could not be found 182 */ 183 public static ServiceComponent fetchByBuildNamespace_First( 184 java.lang.String buildNamespace, 185 OrderByComparator<ServiceComponent> orderByComparator) { 186 return getPersistence() 187 .fetchByBuildNamespace_First(buildNamespace, 188 orderByComparator); 189 } 190 191 /** 192 * Returns the last service component in the ordered set where buildNamespace = ?. 193 * 194 * @param buildNamespace the build namespace 195 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 196 * @return the last matching service component 197 * @throws NoSuchServiceComponentException if a matching service component could not be found 198 */ 199 public static ServiceComponent findByBuildNamespace_Last( 200 java.lang.String buildNamespace, 201 OrderByComparator<ServiceComponent> orderByComparator) 202 throws com.liferay.portal.NoSuchServiceComponentException { 203 return getPersistence() 204 .findByBuildNamespace_Last(buildNamespace, orderByComparator); 205 } 206 207 /** 208 * Returns the last service component in the ordered set where buildNamespace = ?. 209 * 210 * @param buildNamespace the build namespace 211 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 212 * @return the last matching service component, or <code>null</code> if a matching service component could not be found 213 */ 214 public static ServiceComponent fetchByBuildNamespace_Last( 215 java.lang.String buildNamespace, 216 OrderByComparator<ServiceComponent> orderByComparator) { 217 return getPersistence() 218 .fetchByBuildNamespace_Last(buildNamespace, orderByComparator); 219 } 220 221 /** 222 * Returns the service components before and after the current service component in the ordered set where buildNamespace = ?. 223 * 224 * @param serviceComponentId the primary key of the current service component 225 * @param buildNamespace the build namespace 226 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 227 * @return the previous, current, and next service component 228 * @throws NoSuchServiceComponentException if a service component with the primary key could not be found 229 */ 230 public static ServiceComponent[] findByBuildNamespace_PrevAndNext( 231 long serviceComponentId, java.lang.String buildNamespace, 232 OrderByComparator<ServiceComponent> orderByComparator) 233 throws com.liferay.portal.NoSuchServiceComponentException { 234 return getPersistence() 235 .findByBuildNamespace_PrevAndNext(serviceComponentId, 236 buildNamespace, orderByComparator); 237 } 238 239 /** 240 * Removes all the service components where buildNamespace = ? from the database. 241 * 242 * @param buildNamespace the build namespace 243 */ 244 public static void removeByBuildNamespace(java.lang.String buildNamespace) { 245 getPersistence().removeByBuildNamespace(buildNamespace); 246 } 247 248 /** 249 * Returns the number of service components where buildNamespace = ?. 250 * 251 * @param buildNamespace the build namespace 252 * @return the number of matching service components 253 */ 254 public static int countByBuildNamespace(java.lang.String buildNamespace) { 255 return getPersistence().countByBuildNamespace(buildNamespace); 256 } 257 258 /** 259 * Returns the service component where buildNamespace = ? and buildNumber = ? or throws a {@link NoSuchServiceComponentException} if it could not be found. 260 * 261 * @param buildNamespace the build namespace 262 * @param buildNumber the build number 263 * @return the matching service component 264 * @throws NoSuchServiceComponentException if a matching service component could not be found 265 */ 266 public static ServiceComponent findByBNS_BNU( 267 java.lang.String buildNamespace, long buildNumber) 268 throws com.liferay.portal.NoSuchServiceComponentException { 269 return getPersistence().findByBNS_BNU(buildNamespace, buildNumber); 270 } 271 272 /** 273 * Returns the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 274 * 275 * @param buildNamespace the build namespace 276 * @param buildNumber the build number 277 * @return the matching service component, or <code>null</code> if a matching service component could not be found 278 */ 279 public static ServiceComponent fetchByBNS_BNU( 280 java.lang.String buildNamespace, long buildNumber) { 281 return getPersistence().fetchByBNS_BNU(buildNamespace, buildNumber); 282 } 283 284 /** 285 * Returns the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 286 * 287 * @param buildNamespace the build namespace 288 * @param buildNumber the build number 289 * @param retrieveFromCache whether to use the finder cache 290 * @return the matching service component, or <code>null</code> if a matching service component could not be found 291 */ 292 public static ServiceComponent fetchByBNS_BNU( 293 java.lang.String buildNamespace, long buildNumber, 294 boolean retrieveFromCache) { 295 return getPersistence() 296 .fetchByBNS_BNU(buildNamespace, buildNumber, 297 retrieveFromCache); 298 } 299 300 /** 301 * Removes the service component where buildNamespace = ? and buildNumber = ? from the database. 302 * 303 * @param buildNamespace the build namespace 304 * @param buildNumber the build number 305 * @return the service component that was removed 306 */ 307 public static ServiceComponent removeByBNS_BNU( 308 java.lang.String buildNamespace, long buildNumber) 309 throws com.liferay.portal.NoSuchServiceComponentException { 310 return getPersistence().removeByBNS_BNU(buildNamespace, buildNumber); 311 } 312 313 /** 314 * Returns the number of service components where buildNamespace = ? and buildNumber = ?. 315 * 316 * @param buildNamespace the build namespace 317 * @param buildNumber the build number 318 * @return the number of matching service components 319 */ 320 public static int countByBNS_BNU(java.lang.String buildNamespace, 321 long buildNumber) { 322 return getPersistence().countByBNS_BNU(buildNamespace, buildNumber); 323 } 324 325 /** 326 * Caches the service component in the entity cache if it is enabled. 327 * 328 * @param serviceComponent the service component 329 */ 330 public static void cacheResult(ServiceComponent serviceComponent) { 331 getPersistence().cacheResult(serviceComponent); 332 } 333 334 /** 335 * Caches the service components in the entity cache if it is enabled. 336 * 337 * @param serviceComponents the service components 338 */ 339 public static void cacheResult(List<ServiceComponent> serviceComponents) { 340 getPersistence().cacheResult(serviceComponents); 341 } 342 343 /** 344 * Creates a new service component with the primary key. Does not add the service component to the database. 345 * 346 * @param serviceComponentId the primary key for the new service component 347 * @return the new service component 348 */ 349 public static ServiceComponent create(long serviceComponentId) { 350 return getPersistence().create(serviceComponentId); 351 } 352 353 /** 354 * Removes the service component with the primary key from the database. Also notifies the appropriate model listeners. 355 * 356 * @param serviceComponentId the primary key of the service component 357 * @return the service component that was removed 358 * @throws NoSuchServiceComponentException if a service component with the primary key could not be found 359 */ 360 public static ServiceComponent remove(long serviceComponentId) 361 throws com.liferay.portal.NoSuchServiceComponentException { 362 return getPersistence().remove(serviceComponentId); 363 } 364 365 public static ServiceComponent updateImpl(ServiceComponent serviceComponent) { 366 return getPersistence().updateImpl(serviceComponent); 367 } 368 369 /** 370 * Returns the service component with the primary key or throws a {@link NoSuchServiceComponentException} if it could not be found. 371 * 372 * @param serviceComponentId the primary key of the service component 373 * @return the service component 374 * @throws NoSuchServiceComponentException if a service component with the primary key could not be found 375 */ 376 public static ServiceComponent findByPrimaryKey(long serviceComponentId) 377 throws com.liferay.portal.NoSuchServiceComponentException { 378 return getPersistence().findByPrimaryKey(serviceComponentId); 379 } 380 381 /** 382 * Returns the service component with the primary key or returns <code>null</code> if it could not be found. 383 * 384 * @param serviceComponentId the primary key of the service component 385 * @return the service component, or <code>null</code> if a service component with the primary key could not be found 386 */ 387 public static ServiceComponent fetchByPrimaryKey(long serviceComponentId) { 388 return getPersistence().fetchByPrimaryKey(serviceComponentId); 389 } 390 391 public static java.util.Map<java.io.Serializable, ServiceComponent> fetchByPrimaryKeys( 392 java.util.Set<java.io.Serializable> primaryKeys) { 393 return getPersistence().fetchByPrimaryKeys(primaryKeys); 394 } 395 396 /** 397 * Returns all the service components. 398 * 399 * @return the service components 400 */ 401 public static List<ServiceComponent> findAll() { 402 return getPersistence().findAll(); 403 } 404 405 /** 406 * Returns a range of all the service components. 407 * 408 * <p> 409 * 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. 410 * </p> 411 * 412 * @param start the lower bound of the range of service components 413 * @param end the upper bound of the range of service components (not inclusive) 414 * @return the range of service components 415 */ 416 public static List<ServiceComponent> findAll(int start, int end) { 417 return getPersistence().findAll(start, end); 418 } 419 420 /** 421 * Returns an ordered range of all the service components. 422 * 423 * <p> 424 * 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. 425 * </p> 426 * 427 * @param start the lower bound of the range of service components 428 * @param end the upper bound of the range of service components (not inclusive) 429 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 430 * @return the ordered range of service components 431 */ 432 public static List<ServiceComponent> findAll(int start, int end, 433 OrderByComparator<ServiceComponent> orderByComparator) { 434 return getPersistence().findAll(start, end, orderByComparator); 435 } 436 437 /** 438 * Removes all the service components from the database. 439 */ 440 public static void removeAll() { 441 getPersistence().removeAll(); 442 } 443 444 /** 445 * Returns the number of service components. 446 * 447 * @return the number of service components 448 */ 449 public static int countAll() { 450 return getPersistence().countAll(); 451 } 452 453 public static ServiceComponentPersistence getPersistence() { 454 if (_persistence == null) { 455 _persistence = (ServiceComponentPersistence)PortalBeanLocatorUtil.locate(ServiceComponentPersistence.class.getName()); 456 457 ReferenceRegistry.registerReference(ServiceComponentUtil.class, 458 "_persistence"); 459 } 460 461 return _persistence; 462 } 463 464 /** 465 * @deprecated As of 6.2.0 466 */ 467 @Deprecated 468 public void setPersistence(ServiceComponentPersistence persistence) { 469 } 470 471 private static ServiceComponentPersistence _persistence; 472 }