001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service.persistence; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.kernel.util.ReferenceRegistry; 022 import com.liferay.portal.model.ServiceComponent; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the service component service. This utility wraps {@link ServiceComponentPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 029 * 030 * <p> 031 * Caching information and settings can be found in <code>portal.properties</code> 032 * </p> 033 * 034 * @author Brian Wing Shun Chan 035 * @see ServiceComponentPersistence 036 * @see ServiceComponentPersistenceImpl 037 * @generated 038 */ 039 public class ServiceComponentUtil { 040 /* 041 * NOTE FOR DEVELOPERS: 042 * 043 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 044 */ 045 046 /** 047 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 048 */ 049 public static void clearCache() { 050 getPersistence().clearCache(); 051 } 052 053 /** 054 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 055 */ 056 public static void clearCache(ServiceComponent serviceComponent) { 057 getPersistence().clearCache(serviceComponent); 058 } 059 060 /** 061 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 062 */ 063 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 064 throws SystemException { 065 return getPersistence().countWithDynamicQuery(dynamicQuery); 066 } 067 068 /** 069 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 070 */ 071 public static List<ServiceComponent> findWithDynamicQuery( 072 DynamicQuery dynamicQuery) throws SystemException { 073 return getPersistence().findWithDynamicQuery(dynamicQuery); 074 } 075 076 /** 077 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 078 */ 079 public static List<ServiceComponent> findWithDynamicQuery( 080 DynamicQuery dynamicQuery, int start, int end) 081 throws SystemException { 082 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 083 } 084 085 /** 086 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 087 */ 088 public static List<ServiceComponent> findWithDynamicQuery( 089 DynamicQuery dynamicQuery, int start, int end, 090 OrderByComparator orderByComparator) throws SystemException { 091 return getPersistence() 092 .findWithDynamicQuery(dynamicQuery, start, end, 093 orderByComparator); 094 } 095 096 /** 097 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, 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 * <p> 252 * 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. 253 * </p> 254 * 255 * @param buildNamespace the build namespace 256 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 257 * @return the first matching service component 258 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 259 * @throws SystemException if a system exception occurred 260 */ 261 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_First( 262 java.lang.String buildNamespace, 263 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 264 throws com.liferay.portal.NoSuchServiceComponentException, 265 com.liferay.portal.kernel.exception.SystemException { 266 return getPersistence() 267 .findByBuildNamespace_First(buildNamespace, orderByComparator); 268 } 269 270 /** 271 * Returns the last service component in the ordered set where buildNamespace = ?. 272 * 273 * <p> 274 * 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. 275 * </p> 276 * 277 * @param buildNamespace the build namespace 278 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 279 * @return the last matching service component 280 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 281 * @throws SystemException if a system exception occurred 282 */ 283 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_Last( 284 java.lang.String buildNamespace, 285 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 286 throws com.liferay.portal.NoSuchServiceComponentException, 287 com.liferay.portal.kernel.exception.SystemException { 288 return getPersistence() 289 .findByBuildNamespace_Last(buildNamespace, orderByComparator); 290 } 291 292 /** 293 * Returns the service components before and after the current service component in the ordered set where buildNamespace = ?. 294 * 295 * <p> 296 * 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. 297 * </p> 298 * 299 * @param serviceComponentId the primary key of the current service component 300 * @param buildNamespace the build namespace 301 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 302 * @return the previous, current, and next service component 303 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 304 * @throws SystemException if a system exception occurred 305 */ 306 public static com.liferay.portal.model.ServiceComponent[] findByBuildNamespace_PrevAndNext( 307 long serviceComponentId, java.lang.String buildNamespace, 308 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 309 throws com.liferay.portal.NoSuchServiceComponentException, 310 com.liferay.portal.kernel.exception.SystemException { 311 return getPersistence() 312 .findByBuildNamespace_PrevAndNext(serviceComponentId, 313 buildNamespace, orderByComparator); 314 } 315 316 /** 317 * Returns the service component where buildNamespace = ? and buildNumber = ? or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found. 318 * 319 * @param buildNamespace the build namespace 320 * @param buildNumber the build number 321 * @return the matching service component 322 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 323 * @throws SystemException if a system exception occurred 324 */ 325 public static com.liferay.portal.model.ServiceComponent findByBNS_BNU( 326 java.lang.String buildNamespace, long buildNumber) 327 throws com.liferay.portal.NoSuchServiceComponentException, 328 com.liferay.portal.kernel.exception.SystemException { 329 return getPersistence().findByBNS_BNU(buildNamespace, buildNumber); 330 } 331 332 /** 333 * Returns the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 334 * 335 * @param buildNamespace the build namespace 336 * @param buildNumber the build number 337 * @return the matching service component, or <code>null</code> if a matching service component could not be found 338 * @throws SystemException if a system exception occurred 339 */ 340 public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU( 341 java.lang.String buildNamespace, long buildNumber) 342 throws com.liferay.portal.kernel.exception.SystemException { 343 return getPersistence().fetchByBNS_BNU(buildNamespace, buildNumber); 344 } 345 346 /** 347 * Returns the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 348 * 349 * @param buildNamespace the build namespace 350 * @param buildNumber the build number 351 * @param retrieveFromCache whether to use the finder cache 352 * @return the matching service component, or <code>null</code> if a matching service component could not be found 353 * @throws SystemException if a system exception occurred 354 */ 355 public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU( 356 java.lang.String buildNamespace, long buildNumber, 357 boolean retrieveFromCache) 358 throws com.liferay.portal.kernel.exception.SystemException { 359 return getPersistence() 360 .fetchByBNS_BNU(buildNamespace, buildNumber, 361 retrieveFromCache); 362 } 363 364 /** 365 * Returns all the service components. 366 * 367 * @return the service components 368 * @throws SystemException if a system exception occurred 369 */ 370 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll() 371 throws com.liferay.portal.kernel.exception.SystemException { 372 return getPersistence().findAll(); 373 } 374 375 /** 376 * Returns a range of all the service components. 377 * 378 * <p> 379 * 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. 380 * </p> 381 * 382 * @param start the lower bound of the range of service components 383 * @param end the upper bound of the range of service components (not inclusive) 384 * @return the range of service components 385 * @throws SystemException if a system exception occurred 386 */ 387 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll( 388 int start, int end) 389 throws com.liferay.portal.kernel.exception.SystemException { 390 return getPersistence().findAll(start, end); 391 } 392 393 /** 394 * Returns an ordered range of all the service components. 395 * 396 * <p> 397 * 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. 398 * </p> 399 * 400 * @param start the lower bound of the range of service components 401 * @param end the upper bound of the range of service components (not inclusive) 402 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 403 * @return the ordered range of service components 404 * @throws SystemException if a system exception occurred 405 */ 406 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll( 407 int start, int end, 408 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 409 throws com.liferay.portal.kernel.exception.SystemException { 410 return getPersistence().findAll(start, end, orderByComparator); 411 } 412 413 /** 414 * Removes all the service components where buildNamespace = ? from the database. 415 * 416 * @param buildNamespace the build namespace 417 * @throws SystemException if a system exception occurred 418 */ 419 public static void removeByBuildNamespace(java.lang.String buildNamespace) 420 throws com.liferay.portal.kernel.exception.SystemException { 421 getPersistence().removeByBuildNamespace(buildNamespace); 422 } 423 424 /** 425 * Removes the service component where buildNamespace = ? and buildNumber = ? from the database. 426 * 427 * @param buildNamespace the build namespace 428 * @param buildNumber the build number 429 * @throws SystemException if a system exception occurred 430 */ 431 public static void removeByBNS_BNU(java.lang.String buildNamespace, 432 long buildNumber) 433 throws com.liferay.portal.NoSuchServiceComponentException, 434 com.liferay.portal.kernel.exception.SystemException { 435 getPersistence().removeByBNS_BNU(buildNamespace, buildNumber); 436 } 437 438 /** 439 * Removes all the service components from the database. 440 * 441 * @throws SystemException if a system exception occurred 442 */ 443 public static void removeAll() 444 throws com.liferay.portal.kernel.exception.SystemException { 445 getPersistence().removeAll(); 446 } 447 448 /** 449 * Returns the number of service components where buildNamespace = ?. 450 * 451 * @param buildNamespace the build namespace 452 * @return the number of matching service components 453 * @throws SystemException if a system exception occurred 454 */ 455 public static int countByBuildNamespace(java.lang.String buildNamespace) 456 throws com.liferay.portal.kernel.exception.SystemException { 457 return getPersistence().countByBuildNamespace(buildNamespace); 458 } 459 460 /** 461 * Returns the number of service components where buildNamespace = ? and buildNumber = ?. 462 * 463 * @param buildNamespace the build namespace 464 * @param buildNumber the build number 465 * @return the number of matching service components 466 * @throws SystemException if a system exception occurred 467 */ 468 public static int countByBNS_BNU(java.lang.String buildNamespace, 469 long buildNumber) 470 throws com.liferay.portal.kernel.exception.SystemException { 471 return getPersistence().countByBNS_BNU(buildNamespace, buildNumber); 472 } 473 474 /** 475 * Returns the number of service components. 476 * 477 * @return the number of service components 478 * @throws SystemException if a system exception occurred 479 */ 480 public static int countAll() 481 throws com.liferay.portal.kernel.exception.SystemException { 482 return getPersistence().countAll(); 483 } 484 485 public static ServiceComponentPersistence getPersistence() { 486 if (_persistence == null) { 487 _persistence = (ServiceComponentPersistence)PortalBeanLocatorUtil.locate(ServiceComponentPersistence.class.getName()); 488 489 ReferenceRegistry.registerReference(ServiceComponentUtil.class, 490 "_persistence"); 491 } 492 493 return _persistence; 494 } 495 496 public void setPersistence(ServiceComponentPersistence persistence) { 497 _persistence = persistence; 498 499 ReferenceRegistry.registerReference(ServiceComponentUtil.class, 500 "_persistence"); 501 } 502 503 private static ServiceComponentPersistence _persistence; 504 }