001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 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#remove(com.liferay.portal.model.BaseModel) 098 */ 099 public static ServiceComponent remove(ServiceComponent serviceComponent) 100 throws SystemException { 101 return getPersistence().remove(serviceComponent); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 106 */ 107 public static ServiceComponent update(ServiceComponent serviceComponent, 108 boolean merge) throws SystemException { 109 return getPersistence().update(serviceComponent, merge); 110 } 111 112 /** 113 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 114 */ 115 public static ServiceComponent update(ServiceComponent serviceComponent, 116 boolean merge, ServiceContext serviceContext) throws SystemException { 117 return getPersistence().update(serviceComponent, merge, serviceContext); 118 } 119 120 /** 121 * Caches the service component in the entity cache if it is enabled. 122 * 123 * @param serviceComponent the service component to cache 124 */ 125 public static void cacheResult( 126 com.liferay.portal.model.ServiceComponent serviceComponent) { 127 getPersistence().cacheResult(serviceComponent); 128 } 129 130 /** 131 * Caches the service components in the entity cache if it is enabled. 132 * 133 * @param serviceComponents the service components to cache 134 */ 135 public static void cacheResult( 136 java.util.List<com.liferay.portal.model.ServiceComponent> serviceComponents) { 137 getPersistence().cacheResult(serviceComponents); 138 } 139 140 /** 141 * Creates a new service component with the primary key. Does not add the service component to the database. 142 * 143 * @param serviceComponentId the primary key for the new service component 144 * @return the new service component 145 */ 146 public static com.liferay.portal.model.ServiceComponent create( 147 long serviceComponentId) { 148 return getPersistence().create(serviceComponentId); 149 } 150 151 /** 152 * Removes the service component with the primary key from the database. Also notifies the appropriate model listeners. 153 * 154 * @param serviceComponentId the primary key of the service component to remove 155 * @return the service component that was removed 156 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 157 * @throws SystemException if a system exception occurred 158 */ 159 public static com.liferay.portal.model.ServiceComponent remove( 160 long serviceComponentId) 161 throws com.liferay.portal.NoSuchServiceComponentException, 162 com.liferay.portal.kernel.exception.SystemException { 163 return getPersistence().remove(serviceComponentId); 164 } 165 166 public static com.liferay.portal.model.ServiceComponent updateImpl( 167 com.liferay.portal.model.ServiceComponent serviceComponent, 168 boolean merge) 169 throws com.liferay.portal.kernel.exception.SystemException { 170 return getPersistence().updateImpl(serviceComponent, merge); 171 } 172 173 /** 174 * Finds the service component with the primary key or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found. 175 * 176 * @param serviceComponentId the primary key of the service component to find 177 * @return the service component 178 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 179 * @throws SystemException if a system exception occurred 180 */ 181 public static com.liferay.portal.model.ServiceComponent findByPrimaryKey( 182 long serviceComponentId) 183 throws com.liferay.portal.NoSuchServiceComponentException, 184 com.liferay.portal.kernel.exception.SystemException { 185 return getPersistence().findByPrimaryKey(serviceComponentId); 186 } 187 188 /** 189 * Finds the service component with the primary key or returns <code>null</code> if it could not be found. 190 * 191 * @param serviceComponentId the primary key of the service component to find 192 * @return the service component, or <code>null</code> if a service component with the primary key could not be found 193 * @throws SystemException if a system exception occurred 194 */ 195 public static com.liferay.portal.model.ServiceComponent fetchByPrimaryKey( 196 long serviceComponentId) 197 throws com.liferay.portal.kernel.exception.SystemException { 198 return getPersistence().fetchByPrimaryKey(serviceComponentId); 199 } 200 201 /** 202 * Finds all the service components where buildNamespace = ?. 203 * 204 * @param buildNamespace the build namespace to search with 205 * @return the matching service components 206 * @throws SystemException if a system exception occurred 207 */ 208 public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 209 java.lang.String buildNamespace) 210 throws com.liferay.portal.kernel.exception.SystemException { 211 return getPersistence().findByBuildNamespace(buildNamespace); 212 } 213 214 /** 215 * Finds a range of all the service components where buildNamespace = ?. 216 * 217 * <p> 218 * 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. 219 * </p> 220 * 221 * @param buildNamespace the build namespace to search with 222 * @param start the lower bound of the range of service components to return 223 * @param end the upper bound of the range of service components to return (not inclusive) 224 * @return the range of matching service components 225 * @throws SystemException if a system exception occurred 226 */ 227 public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 228 java.lang.String buildNamespace, int start, int end) 229 throws com.liferay.portal.kernel.exception.SystemException { 230 return getPersistence().findByBuildNamespace(buildNamespace, start, end); 231 } 232 233 /** 234 * Finds an ordered range of all the service components where buildNamespace = ?. 235 * 236 * <p> 237 * 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. 238 * </p> 239 * 240 * @param buildNamespace the build namespace to search with 241 * @param start the lower bound of the range of service components to return 242 * @param end the upper bound of the range of service components to return (not inclusive) 243 * @param orderByComparator the comparator to order the results by 244 * @return the ordered range of matching service components 245 * @throws SystemException if a system exception occurred 246 */ 247 public static java.util.List<com.liferay.portal.model.ServiceComponent> findByBuildNamespace( 248 java.lang.String buildNamespace, int start, int end, 249 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 250 throws com.liferay.portal.kernel.exception.SystemException { 251 return getPersistence() 252 .findByBuildNamespace(buildNamespace, start, end, 253 orderByComparator); 254 } 255 256 /** 257 * Finds the first service component in the ordered set where buildNamespace = ?. 258 * 259 * <p> 260 * 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. 261 * </p> 262 * 263 * @param buildNamespace the build namespace to search with 264 * @param orderByComparator the comparator to order the set by 265 * @return the first matching service component 266 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 267 * @throws SystemException if a system exception occurred 268 */ 269 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_First( 270 java.lang.String buildNamespace, 271 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 272 throws com.liferay.portal.NoSuchServiceComponentException, 273 com.liferay.portal.kernel.exception.SystemException { 274 return getPersistence() 275 .findByBuildNamespace_First(buildNamespace, orderByComparator); 276 } 277 278 /** 279 * Finds the last service component in the ordered set where buildNamespace = ?. 280 * 281 * <p> 282 * 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. 283 * </p> 284 * 285 * @param buildNamespace the build namespace to search with 286 * @param orderByComparator the comparator to order the set by 287 * @return the last matching service component 288 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 289 * @throws SystemException if a system exception occurred 290 */ 291 public static com.liferay.portal.model.ServiceComponent findByBuildNamespace_Last( 292 java.lang.String buildNamespace, 293 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 294 throws com.liferay.portal.NoSuchServiceComponentException, 295 com.liferay.portal.kernel.exception.SystemException { 296 return getPersistence() 297 .findByBuildNamespace_Last(buildNamespace, orderByComparator); 298 } 299 300 /** 301 * Finds the service components before and after the current service component in the ordered set where buildNamespace = ?. 302 * 303 * <p> 304 * 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. 305 * </p> 306 * 307 * @param serviceComponentId the primary key of the current service component 308 * @param buildNamespace the build namespace to search with 309 * @param orderByComparator the comparator to order the set by 310 * @return the previous, current, and next service component 311 * @throws com.liferay.portal.NoSuchServiceComponentException if a service component with the primary key could not be found 312 * @throws SystemException if a system exception occurred 313 */ 314 public static com.liferay.portal.model.ServiceComponent[] findByBuildNamespace_PrevAndNext( 315 long serviceComponentId, java.lang.String buildNamespace, 316 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 317 throws com.liferay.portal.NoSuchServiceComponentException, 318 com.liferay.portal.kernel.exception.SystemException { 319 return getPersistence() 320 .findByBuildNamespace_PrevAndNext(serviceComponentId, 321 buildNamespace, orderByComparator); 322 } 323 324 /** 325 * Finds the service component where buildNamespace = ? and buildNumber = ? or throws a {@link com.liferay.portal.NoSuchServiceComponentException} if it could not be found. 326 * 327 * @param buildNamespace the build namespace to search with 328 * @param buildNumber the build number to search with 329 * @return the matching service component 330 * @throws com.liferay.portal.NoSuchServiceComponentException if a matching service component could not be found 331 * @throws SystemException if a system exception occurred 332 */ 333 public static com.liferay.portal.model.ServiceComponent findByBNS_BNU( 334 java.lang.String buildNamespace, long buildNumber) 335 throws com.liferay.portal.NoSuchServiceComponentException, 336 com.liferay.portal.kernel.exception.SystemException { 337 return getPersistence().findByBNS_BNU(buildNamespace, buildNumber); 338 } 339 340 /** 341 * Finds the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 342 * 343 * @param buildNamespace the build namespace to search with 344 * @param buildNumber the build number to search with 345 * @return the matching service component, or <code>null</code> if a matching service component could not be found 346 * @throws SystemException if a system exception occurred 347 */ 348 public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU( 349 java.lang.String buildNamespace, long buildNumber) 350 throws com.liferay.portal.kernel.exception.SystemException { 351 return getPersistence().fetchByBNS_BNU(buildNamespace, buildNumber); 352 } 353 354 /** 355 * Finds the service component where buildNamespace = ? and buildNumber = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 356 * 357 * @param buildNamespace the build namespace to search with 358 * @param buildNumber the build number to search with 359 * @return the matching service component, or <code>null</code> if a matching service component could not be found 360 * @throws SystemException if a system exception occurred 361 */ 362 public static com.liferay.portal.model.ServiceComponent fetchByBNS_BNU( 363 java.lang.String buildNamespace, long buildNumber, 364 boolean retrieveFromCache) 365 throws com.liferay.portal.kernel.exception.SystemException { 366 return getPersistence() 367 .fetchByBNS_BNU(buildNamespace, buildNumber, 368 retrieveFromCache); 369 } 370 371 /** 372 * Finds all the service components. 373 * 374 * @return the service components 375 * @throws SystemException if a system exception occurred 376 */ 377 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll() 378 throws com.liferay.portal.kernel.exception.SystemException { 379 return getPersistence().findAll(); 380 } 381 382 /** 383 * Finds a range of all the service components. 384 * 385 * <p> 386 * 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. 387 * </p> 388 * 389 * @param start the lower bound of the range of service components to return 390 * @param end the upper bound of the range of service components to return (not inclusive) 391 * @return the range of service components 392 * @throws SystemException if a system exception occurred 393 */ 394 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll( 395 int start, int end) 396 throws com.liferay.portal.kernel.exception.SystemException { 397 return getPersistence().findAll(start, end); 398 } 399 400 /** 401 * Finds an ordered range of all the service components. 402 * 403 * <p> 404 * 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. 405 * </p> 406 * 407 * @param start the lower bound of the range of service components to return 408 * @param end the upper bound of the range of service components to return (not inclusive) 409 * @param orderByComparator the comparator to order the results by 410 * @return the ordered range of service components 411 * @throws SystemException if a system exception occurred 412 */ 413 public static java.util.List<com.liferay.portal.model.ServiceComponent> findAll( 414 int start, int end, 415 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 416 throws com.liferay.portal.kernel.exception.SystemException { 417 return getPersistence().findAll(start, end, orderByComparator); 418 } 419 420 /** 421 * Removes all the service components where buildNamespace = ? from the database. 422 * 423 * @param buildNamespace the build namespace to search with 424 * @throws SystemException if a system exception occurred 425 */ 426 public static void removeByBuildNamespace(java.lang.String buildNamespace) 427 throws com.liferay.portal.kernel.exception.SystemException { 428 getPersistence().removeByBuildNamespace(buildNamespace); 429 } 430 431 /** 432 * Removes the service component where buildNamespace = ? and buildNumber = ? from the database. 433 * 434 * @param buildNamespace the build namespace to search with 435 * @param buildNumber the build number to search with 436 * @throws SystemException if a system exception occurred 437 */ 438 public static void removeByBNS_BNU(java.lang.String buildNamespace, 439 long buildNumber) 440 throws com.liferay.portal.NoSuchServiceComponentException, 441 com.liferay.portal.kernel.exception.SystemException { 442 getPersistence().removeByBNS_BNU(buildNamespace, buildNumber); 443 } 444 445 /** 446 * Removes all the service components from the database. 447 * 448 * @throws SystemException if a system exception occurred 449 */ 450 public static void removeAll() 451 throws com.liferay.portal.kernel.exception.SystemException { 452 getPersistence().removeAll(); 453 } 454 455 /** 456 * Counts all the service components where buildNamespace = ?. 457 * 458 * @param buildNamespace the build namespace to search with 459 * @return the number of matching service components 460 * @throws SystemException if a system exception occurred 461 */ 462 public static int countByBuildNamespace(java.lang.String buildNamespace) 463 throws com.liferay.portal.kernel.exception.SystemException { 464 return getPersistence().countByBuildNamespace(buildNamespace); 465 } 466 467 /** 468 * Counts all the service components where buildNamespace = ? and buildNumber = ?. 469 * 470 * @param buildNamespace the build namespace to search with 471 * @param buildNumber the build number to search with 472 * @return the number of matching service components 473 * @throws SystemException if a system exception occurred 474 */ 475 public static int countByBNS_BNU(java.lang.String buildNamespace, 476 long buildNumber) 477 throws com.liferay.portal.kernel.exception.SystemException { 478 return getPersistence().countByBNS_BNU(buildNamespace, buildNumber); 479 } 480 481 /** 482 * Counts all the service components. 483 * 484 * @return the number of service components 485 * @throws SystemException if a system exception occurred 486 */ 487 public static int countAll() 488 throws com.liferay.portal.kernel.exception.SystemException { 489 return getPersistence().countAll(); 490 } 491 492 public static ServiceComponentPersistence getPersistence() { 493 if (_persistence == null) { 494 _persistence = (ServiceComponentPersistence)PortalBeanLocatorUtil.locate(ServiceComponentPersistence.class.getName()); 495 496 ReferenceRegistry.registerReference(ServiceComponentUtil.class, 497 "_persistence"); 498 } 499 500 return _persistence; 501 } 502 503 public void setPersistence(ServiceComponentPersistence persistence) { 504 _persistence = persistence; 505 506 ReferenceRegistry.registerReference(ServiceComponentUtil.class, 507 "_persistence"); 508 } 509 510 private static ServiceComponentPersistence _persistence; 511 }