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 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 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 java.util.List<com.liferay.portal.model.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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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 java.util.List<com.liferay.portal.model.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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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 java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 153 java.lang.String buildNamespace, int start, int end, 154 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.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 com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 167 */ 168 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_First( 169 java.lang.String buildNamespace, 170 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.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 com.liferay.portal.model.ServiceComponent fetchByBuildNamespace_First( 184 java.lang.String buildNamespace, 185 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.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 com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 198 */ 199 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_Last( 200 java.lang.String buildNamespace, 201 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.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 com.liferay.portal.model.ServiceComponent fetchByBuildNamespace_Last( 215 java.lang.String buildNamespace, 216 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.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 com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 229 */ 230 public static com.liferay.portal.model.ServiceComponent[] findByBuildNamespace_PrevAndNext( 231 long serviceComponentId, java.lang.String buildNamespace, 232 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.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 com.liferay.portal.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 com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 265 */ 266 public static com.liferay.portal.model.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 com.liferay.portal.model.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 com.liferay.portal.model.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 com.liferay.portal.model.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( 331 com.liferay.portal.model.ServiceComponent serviceComponent) { 332 getPersistence().cacheResult(serviceComponent); 333 } 334 335 /** 336 * Caches the service components in the entity cache if it is enabled. 337 * 338 * @param serviceComponents the service components 339 */ 340 public static void cacheResult( 341 java.util.List<com.liferay.portal.model.ServiceComponent> serviceComponents) { 342 getPersistence().cacheResult(serviceComponents); 343 } 344 345 /** 346 * Creates a new service component with the primary key. Does not add the service component to the database. 347 * 348 * @param serviceComponentId the primary key for the new service component 349 * @return the new service component 350 */ 351 public static com.liferay.portal.model.ServiceComponent create( 352 long serviceComponentId) { 353 return getPersistence().create(serviceComponentId); 354 } 355 356 /** 357 * Removes the service component with the primary key from the database. Also notifies the appropriate model listeners. 358 * 359 * @param serviceComponentId the primary key of the service component 360 * @return the service component that was removed 361 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 362 */ 363 public static com.liferay.portal.model.ServiceComponent remove( 364 long serviceComponentId) 365 throws com.liferay.portal.NoSuchServiceComponentException { 366 return getPersistence().remove(serviceComponentId); 367 } 368 369 public static com.liferay.portal.model.ServiceComponent updateImpl( 370 com.liferay.portal.model.ServiceComponent serviceComponent) { 371 return getPersistence().updateImpl(serviceComponent); 372 } 373 374 /** 375 * Returns the service component with the primary key or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found. 376 * 377 * @param serviceComponentId the primary key of the service component 378 * @return the service component 379 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 380 */ 381 public static com.liferay.portal.model.ServiceComponent findByPrimaryKey( 382 long serviceComponentId) 383 throws com.liferay.portal.NoSuchServiceComponentException { 384 return getPersistence().findByPrimaryKey(serviceComponentId); 385 } 386 387 /** 388 * Returns the service component with the primary key or returns <code>null</code> if it could not be found. 389 * 390 * @param serviceComponentId the primary key of the service component 391 * @return the service component, or <code>null</code> if a service component with the primary key could not be found 392 */ 393 public static com.liferay.portal.model.ServiceComponent fetchByPrimaryKey( 394 long serviceComponentId) { 395 return getPersistence().fetchByPrimaryKey(serviceComponentId); 396 } 397 398 public static java.util.Map<java.io.Serializable, com.liferay.portal.model.ServiceComponent> fetchByPrimaryKeys( 399 java.util.Set<java.io.Serializable> primaryKeys) { 400 return getPersistence().fetchByPrimaryKeys(primaryKeys); 401 } 402 403 /** 404 * Returns all the service components. 405 * 406 * @return the service components 407 */ 408 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll() { 409 return getPersistence().findAll(); 410 } 411 412 /** 413 * Returns a range of all the service components. 414 * 415 * <p> 416 * 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. 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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. 417 * </p> 418 * 419 * @param start the lower bound of the range of service components 420 * @param end the upper bound of the range of service components (not inclusive) 421 * @return the range of service components 422 */ 423 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll( 424 int start, int end) { 425 return getPersistence().findAll(start, end); 426 } 427 428 /** 429 * Returns an ordered 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 438 * @return the ordered range of service components 439 */ 440 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll( 441 int start, int end, 442 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ServiceComponent> orderByComparator) { 443 return getPersistence().findAll(start, end, orderByComparator); 444 } 445 446 /** 447 * Removes all the service components from the database. 448 */ 449 public static void removeAll() { 450 getPersistence().removeAll(); 451 } 452 453 /** 454 * Returns the number of service components. 455 * 456 * @return the number of service components 457 */ 458 public static int countAll() { 459 return getPersistence().countAll(); 460 } 461 462 public static ServiceComponentPersistence getPersistence() { 463 if (_persistence == null) { 464 _persistence = (ServiceComponentPersistence)PortalBeanLocatorUtil.locate(ServiceComponentPersistence.class.getName()); 465 466 ReferenceRegistry.registerReference(ServiceComponentUtil.class, 467 "_persistence"); 468 } 469 470 return _persistence; 471 } 472 473 /** 474 * @deprecated As of 6.2.0 475 */ 476 @Deprecated 477 public void setPersistence(ServiceComponentPersistence persistence) { 478 } 479 480 private static ServiceComponentPersistence _persistence; 481 }