001 /** 002 * Copyright (c) 2000-2010 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.model.ServiceComponent; 022 import com.liferay.portal.service.ServiceContext; 023 024 import java.util.List; 025 026 /** 027 * The persistence utility for the service component service. 028 * 029 * <p> 030 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class. 031 * </p> 032 * 033 * @author Brian Wing Shun Chan 034 * @see ServiceComponentPersistence 035 * @see ServiceComponentPersistenceImpl 036 * @generated 037 */ 038 public class ServiceComponentUtil { 039 /** 040 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 041 */ 042 public static void clearCache() { 043 getPersistence().clearCache(); 044 } 045 046 /** 047 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 048 */ 049 public static void clearCache(ServiceComponent serviceComponent) { 050 getPersistence().clearCache(serviceComponent); 051 } 052 053 /** 054 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 055 */ 056 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 057 throws SystemException { 058 return getPersistence().countWithDynamicQuery(dynamicQuery); 059 } 060 061 /** 062 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 063 */ 064 public static List<ServiceComponent> findWithDynamicQuery( 065 DynamicQuery dynamicQuery) throws SystemException { 066 return getPersistence().findWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 071 */ 072 public static List<ServiceComponent> findWithDynamicQuery( 073 DynamicQuery dynamicQuery, int start, int end) 074 throws SystemException { 075 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 076 } 077 078 /** 079 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 080 */ 081 public static List<ServiceComponent> findWithDynamicQuery( 082 DynamicQuery dynamicQuery, int start, int end, 083 OrderByComparator orderByComparator) throws SystemException { 084 return getPersistence() 085 .findWithDynamicQuery(dynamicQuery, start, end, 086 orderByComparator); 087 } 088 089 /** 090 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 091 */ 092 public static ServiceComponent remove(ServiceComponent serviceComponent) 093 throws SystemException { 094 return getPersistence().remove(serviceComponent); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 099 */ 100 public static ServiceComponent update(ServiceComponent serviceComponent, 101 boolean merge) throws SystemException { 102 return getPersistence().update(serviceComponent, merge); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 107 */ 108 public static ServiceComponent update(ServiceComponent serviceComponent, 109 boolean merge, ServiceContext serviceContext) throws SystemException { 110 return getPersistence().update(serviceComponent, merge, serviceContext); 111 } 112 113 /** 114 * Caches the service component in the entity cache if it is enabled. 115 * 116 * @param serviceComponent the service component to cache 117 */ 118 public static void cacheResult( 119 com.liferay.portal.model.ServiceComponent serviceComponent) { 120 getPersistence().cacheResult(serviceComponent); 121 } 122 123 /** 124 * Caches the service components in the entity cache if it is enabled. 125 * 126 * @param serviceComponents the service components to cache 127 */ 128 public static void cacheResult( 129 java.util.List<com.liferay.portal.model.ServiceComponent> serviceComponents) { 130 getPersistence().cacheResult(serviceComponents); 131 } 132 133 /** 134 * Creates a new service component with the primary key. 135 * 136 * @param serviceComponentId the primary key for the new service component 137 * @return the new service component 138 */ 139 public static com.liferay.portal.model.ServiceComponent create( 140 long serviceComponentId) { 141 return getPersistence().create(serviceComponentId); 142 } 143 144 /** 145 * Removes the service component with the primary key from the database. Also notifies the appropriate model listeners. 146 * 147 * @param serviceComponentId the primary key of the service component to remove 148 * @return the service component that was removed 149 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 150 * @throws SystemException if a system exception occurred 151 */ 152 public static com.liferay.portal.model.ServiceComponent remove( 153 long serviceComponentId) 154 throws com.liferay.portal.NoSuchServiceComponentException, 155 com.liferay.portal.kernel.exception.SystemException { 156 return getPersistence().remove(serviceComponentId); 157 } 158 159 public static com.liferay.portal.model.ServiceComponent updateImpl( 160 com.liferay.portal.model.ServiceComponent serviceComponent, 161 boolean merge) 162 throws com.liferay.portal.kernel.exception.SystemException { 163 return getPersistence().updateImpl(serviceComponent, merge); 164 } 165 166 /** 167 * Finds the service component with the primary key or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found. 168 * 169 * @param serviceComponentId the primary key of the service component to find 170 * @return the service component 171 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 172 * @throws SystemException if a system exception occurred 173 */ 174 public static com.liferay.portal.model.ServiceComponent findByPrimaryKey( 175 long serviceComponentId) 176 throws com.liferay.portal.NoSuchServiceComponentException, 177 com.liferay.portal.kernel.exception.SystemException { 178 return getPersistence().findByPrimaryKey(serviceComponentId); 179 } 180 181 /** 182 * Finds the service component with the primary key or returns <code>null</code> if it could not be found. 183 * 184 * @param serviceComponentId the primary key of the service component to find 185 * @return the service component, or <code>null</code> if a service component with the primary key could not be found 186 * @throws SystemException if a system exception occurred 187 */ 188 public static com.liferay.portal.model.ServiceComponent fetchByPrimaryKey( 189 long serviceComponentId) 190 throws com.liferay.portal.kernel.exception.SystemException { 191 return getPersistence().fetchByPrimaryKey(serviceComponentId); 192 } 193 194 /** 195 * Finds all the service components where buildNamespace = ?. 196 * 197 * @param buildNamespace the build namespace to search with 198 * @return the matching service components 199 * @throws SystemException if a system exception occurred 200 */ 201 public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 202 java.lang.String buildNamespace) 203 throws com.liferay.portal.kernel.exception.SystemException { 204 return getPersistence().findByBuildNamespace(buildNamespace); 205 } 206 207 /** 208 * Finds a range of all the service components where buildNamespace = ?. 209 * 210 * <p> 211 * 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. 212 * </p> 213 * 214 * @param buildNamespace the build namespace to search with 215 * @param start the lower bound of the range of service components to return 216 * @param end the upper bound of the range of service components to return (not inclusive) 217 * @return the range of matching service components 218 * @throws SystemException if a system exception occurred 219 */ 220 public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 221 java.lang.String buildNamespace, int start, int end) 222 throws com.liferay.portal.kernel.exception.SystemException { 223 return getPersistence().findByBuildNamespace(buildNamespace, start, end); 224 } 225 226 /** 227 * Finds an ordered range of all the service components where buildNamespace = ?. 228 * 229 * <p> 230 * 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. 231 * </p> 232 * 233 * @param buildNamespace the build namespace to search with 234 * @param start the lower bound of the range of service components to return 235 * @param end the upper bound of the range of service components to return (not inclusive) 236 * @param orderByComparator the comparator to order the results by 237 * @return the ordered range of matching service components 238 * @throws SystemException if a system exception occurred 239 */ 240 public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 241 java.lang.String buildNamespace, int start, int end, 242 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 243 throws com.liferay.portal.kernel.exception.SystemException { 244 return getPersistence() 245 .findByBuildNamespace(buildNamespace, start, end, 246 orderByComparator); 247 } 248 249 /** 250 * Finds the first service component in the ordered set where buildNamespace = ?. 251 * 252 * <p> 253 * 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. 254 * </p> 255 * 256 * @param buildNamespace the build namespace to search with 257 * @param orderByComparator the comparator to order the set by 258 * @return the first matching service component 259 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 260 * @throws SystemException if a system exception occurred 261 */ 262 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_First( 263 java.lang.String buildNamespace, 264 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 265 throws com.liferay.portal.NoSuchServiceComponentException, 266 com.liferay.portal.kernel.exception.SystemException { 267 return getPersistence() 268 .findByBuildNamespace_First(buildNamespace, orderByComparator); 269 } 270 271 /** 272 * Finds the last service component in the ordered set where buildNamespace = ?. 273 * 274 * <p> 275 * 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. 276 * </p> 277 * 278 * @param buildNamespace the build namespace to search with 279 * @param orderByComparator the comparator to order the set by 280 * @return the last matching service component 281 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 282 * @throws SystemException if a system exception occurred 283 */ 284 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_Last( 285 java.lang.String buildNamespace, 286 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 287 throws com.liferay.portal.NoSuchServiceComponentException, 288 com.liferay.portal.kernel.exception.SystemException { 289 return getPersistence() 290 .findByBuildNamespace_Last(buildNamespace, orderByComparator); 291 } 292 293 /** 294 * Finds the service components before and after the current service component in the ordered set where buildNamespace = ?. 295 * 296 * <p> 297 * 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. 298 * </p> 299 * 300 * @param serviceComponentId the primary key of the current service component 301 * @param buildNamespace the build namespace to search with 302 * @param orderByComparator the comparator to order the set by 303 * @return the previous, current, and next service component 304 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 305 * @throws SystemException if a system exception occurred 306 */ 307 public static com.liferay.portal.model.ServiceComponent[] findByBuildNamespace_PrevAndNext( 308 long serviceComponentId, java.lang.String buildNamespace, 309 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 310 throws com.liferay.portal.NoSuchServiceComponentException, 311 com.liferay.portal.kernel.exception.SystemException { 312 return getPersistence() 313 .findByBuildNamespace_PrevAndNext(serviceComponentId, 314 buildNamespace, orderByComparator); 315 } 316 317 /** 318 * Finds the service component where buildNamespace = ? and buildNumber = ? or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found. 319 * 320 * @param buildNamespace the build namespace to search with 321 * @param buildNumber the build number to search with 322 * @return the matching service component 323 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 324 * @throws SystemException if a system exception occurred 325 */ 326 public static com.liferay.portal.model.ServiceComponent findByBNS_BNU( 327 java.lang.String buildNamespace, long buildNumber) 328 throws com.liferay.portal.NoSuchServiceComponentException, 329 com.liferay.portal.kernel.exception.SystemException { 330 return getPersistence().findByBNS_BNU(buildNamespace, buildNumber); 331 } 332 333 /** 334 * Finds the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 335 * 336 * @param buildNamespace the build namespace to search with 337 * @param buildNumber the build number to search with 338 * @return the matching service component, or <code>null</code> if a matching service component could not be found 339 * @throws SystemException if a system exception occurred 340 */ 341 public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU( 342 java.lang.String buildNamespace, long buildNumber) 343 throws com.liferay.portal.kernel.exception.SystemException { 344 return getPersistence().fetchByBNS_BNU(buildNamespace, buildNumber); 345 } 346 347 /** 348 * Finds the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 349 * 350 * @param buildNamespace the build namespace to search with 351 * @param buildNumber the build number to search with 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 * Finds 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 * Finds 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 to return 383 * @param end the upper bound of the range of service components to return (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 * Finds 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 to return 401 * @param end the upper bound of the range of service components to return (not inclusive) 402 * @param orderByComparator the comparator to order the results by 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 to search with 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 to search with 428 * @param buildNumber the build number to search with 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 * Counts all the service components where buildNamespace = ?. 450 * 451 * @param buildNamespace the build namespace to search with 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 * Counts all the service components where buildNamespace = ? and buildNumber = ?. 462 * 463 * @param buildNamespace the build namespace to search with 464 * @param buildNumber the build number to search with 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 * Counts all the 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 490 return _persistence; 491 } 492 493 public void setPersistence(ServiceComponentPersistence persistence) { 494 _persistence = persistence; 495 } 496 497 private static ServiceComponentPersistence _persistence; 498 }