Class ServiceComponentUtil
com.liferay.portal.service.persistence.impl.ServiceComponentPersistenceImpl and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
Caching information and settings can be found in portal.properties
- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcacheResult(ServiceComponent serviceComponent) Caches the service component in the entity cache if it is enabled.static voidcacheResult(List<ServiceComponent> serviceComponents) Caches the service components in the entity cache if it is enabled.static voidstatic voidclearCache(ServiceComponent serviceComponent) static intcountAll()Returns the number of service components.static intcountByBNS_BNU(String buildNamespace, long buildNumber) Returns the number of service components where buildNamespace = ? and buildNumber = ?.static intcountByBuildNamespace(String buildNamespace) Returns the number of service components where buildNamespace = ?.static longcountWithDynamicQuery(DynamicQuery dynamicQuery) static ServiceComponentcreate(long serviceComponentId) Creates a new service component with the primary key.static ServiceComponentfetchByBNS_BNU(String buildNamespace, long buildNumber) Returns the service component where buildNamespace = ? and buildNumber = ? or returnsnullif it could not be found.static ServiceComponentfetchByBNS_BNU(String buildNamespace, long buildNumber, boolean useFinderCache) Returns the service component where buildNamespace = ? and buildNumber = ? or returnsnullif it could not be found, optionally using the finder cache.static ServiceComponentfetchByBuildNamespace_First(String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) Returns the first service component in the ordered set where buildNamespace = ?.static ServiceComponentfetchByBuildNamespace_Last(String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) Returns the last service component in the ordered set where buildNamespace = ?.static ServiceComponentfetchByPrimaryKey(long serviceComponentId) Returns the service component with the primary key or returnsnullif it could not be found.static Map<Serializable,ServiceComponent> fetchByPrimaryKeys(Set<Serializable> primaryKeys) static List<ServiceComponent>findAll()Returns all the service components.static List<ServiceComponent>findAll(int start, int end) Returns a range of all the service components.static List<ServiceComponent>findAll(int start, int end, OrderByComparator<ServiceComponent> orderByComparator) Returns an ordered range of all the service components.static List<ServiceComponent>findAll(int start, int end, OrderByComparator<ServiceComponent> orderByComparator, boolean useFinderCache) Returns an ordered range of all the service components.static ServiceComponentfindByBNS_BNU(String buildNamespace, long buildNumber) Returns the service component where buildNamespace = ? and buildNumber = ? or throws aNoSuchServiceComponentExceptionif it could not be found.static List<ServiceComponent>findByBuildNamespace(String buildNamespace) Returns all the service components where buildNamespace = ?.static List<ServiceComponent>findByBuildNamespace(String buildNamespace, int start, int end) Returns a range of all the service components where buildNamespace = ?.static List<ServiceComponent>findByBuildNamespace(String buildNamespace, int start, int end, OrderByComparator<ServiceComponent> orderByComparator) Returns an ordered range of all the service components where buildNamespace = ?.static List<ServiceComponent>findByBuildNamespace(String buildNamespace, int start, int end, OrderByComparator<ServiceComponent> orderByComparator, boolean useFinderCache) Returns an ordered range of all the service components where buildNamespace = ?.static ServiceComponentfindByBuildNamespace_First(String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) Returns the first service component in the ordered set where buildNamespace = ?.static ServiceComponentfindByBuildNamespace_Last(String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) Returns the last service component in the ordered set where buildNamespace = ?.static ServiceComponent[]findByBuildNamespace_PrevAndNext(long serviceComponentId, String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) Returns the service components before and after the current service component in the ordered set where buildNamespace = ?.static ServiceComponentfindByPrimaryKey(long serviceComponentId) Returns the service component with the primary key or throws aNoSuchServiceComponentExceptionif it could not be found.static List<ServiceComponent>findWithDynamicQuery(DynamicQuery dynamicQuery) static List<ServiceComponent>findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) static List<ServiceComponent>findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<ServiceComponent> orderByComparator) static ServiceComponentPersistencestatic ServiceComponentremove(long serviceComponentId) Removes the service component with the primary key from the database.static voidRemoves all the service components from the database.static ServiceComponentremoveByBNS_BNU(String buildNamespace, long buildNumber) Removes the service component where buildNamespace = ? and buildNumber = ? from the database.static voidremoveByBuildNamespace(String buildNamespace) Removes all the service components where buildNamespace = ? from the database.static voidsetPersistence(ServiceComponentPersistence persistence) static ServiceComponentupdate(ServiceComponent serviceComponent) static ServiceComponentupdate(ServiceComponent serviceComponent, ServiceContext serviceContext) static ServiceComponentupdateImpl(ServiceComponent serviceComponent)
-
Constructor Details
-
ServiceComponentUtil
public ServiceComponentUtil()
-
-
Method Details
-
clearCache
public static void clearCache()- See Also:
-
clearCache
-
countWithDynamicQuery
-
fetchByPrimaryKeys
- See Also:
-
findWithDynamicQuery
-
findWithDynamicQuery
public static List<ServiceComponent> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) -
findWithDynamicQuery
public static List<ServiceComponent> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<ServiceComponent> orderByComparator) -
update
-
update
public static ServiceComponent update(ServiceComponent serviceComponent, ServiceContext serviceContext) -
findByBuildNamespace
Returns all the service components where buildNamespace = ?.- Parameters:
buildNamespace- the build namespace- Returns:
- the matching service components
-
findByBuildNamespace
public static List<ServiceComponent> findByBuildNamespace(String buildNamespace, int start, int end) Returns a range of all the service components where buildNamespace = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromServiceComponentModelImpl.- Parameters:
buildNamespace- the build namespacestart- the lower bound of the range of service componentsend- the upper bound of the range of service components (not inclusive)- Returns:
- the range of matching service components
-
findByBuildNamespace
public static List<ServiceComponent> findByBuildNamespace(String buildNamespace, int start, int end, OrderByComparator<ServiceComponent> orderByComparator) Returns an ordered range of all the service components where buildNamespace = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromServiceComponentModelImpl.- Parameters:
buildNamespace- the build namespacestart- the lower bound of the range of service componentsend- the upper bound of the range of service components (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of matching service components
-
findByBuildNamespace
public static List<ServiceComponent> findByBuildNamespace(String buildNamespace, int start, int end, OrderByComparator<ServiceComponent> orderByComparator, boolean useFinderCache) Returns an ordered range of all the service components where buildNamespace = ?.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromServiceComponentModelImpl.- Parameters:
buildNamespace- the build namespacestart- the lower bound of the range of service componentsend- the upper bound of the range of service components (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)useFinderCache- whether to use the finder cache- Returns:
- the ordered range of matching service components
-
findByBuildNamespace_First
public static ServiceComponent findByBuildNamespace_First(String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) throws NoSuchServiceComponentException Returns the first service component in the ordered set where buildNamespace = ?.- Parameters:
buildNamespace- the build namespaceorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching service component
- Throws:
NoSuchServiceComponentException- if a matching service component could not be foundNoSuchServiceComponentException
-
fetchByBuildNamespace_First
public static ServiceComponent fetchByBuildNamespace_First(String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) Returns the first service component in the ordered set where buildNamespace = ?.- Parameters:
buildNamespace- the build namespaceorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching service component, or
nullif a matching service component could not be found
-
findByBuildNamespace_Last
public static ServiceComponent findByBuildNamespace_Last(String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) throws NoSuchServiceComponentException Returns the last service component in the ordered set where buildNamespace = ?.- Parameters:
buildNamespace- the build namespaceorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching service component
- Throws:
NoSuchServiceComponentException- if a matching service component could not be foundNoSuchServiceComponentException
-
fetchByBuildNamespace_Last
public static ServiceComponent fetchByBuildNamespace_Last(String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) Returns the last service component in the ordered set where buildNamespace = ?.- Parameters:
buildNamespace- the build namespaceorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching service component, or
nullif a matching service component could not be found
-
findByBuildNamespace_PrevAndNext
public static ServiceComponent[] findByBuildNamespace_PrevAndNext(long serviceComponentId, String buildNamespace, OrderByComparator<ServiceComponent> orderByComparator) throws NoSuchServiceComponentException Returns the service components before and after the current service component in the ordered set where buildNamespace = ?.- Parameters:
serviceComponentId- the primary key of the current service componentbuildNamespace- the build namespaceorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the previous, current, and next service component
- Throws:
NoSuchServiceComponentException- if a service component with the primary key could not be foundNoSuchServiceComponentException
-
removeByBuildNamespace
Removes all the service components where buildNamespace = ? from the database.- Parameters:
buildNamespace- the build namespace
-
countByBuildNamespace
Returns the number of service components where buildNamespace = ?.- Parameters:
buildNamespace- the build namespace- Returns:
- the number of matching service components
-
findByBNS_BNU
public static ServiceComponent findByBNS_BNU(String buildNamespace, long buildNumber) throws NoSuchServiceComponentException Returns the service component where buildNamespace = ? and buildNumber = ? or throws aNoSuchServiceComponentExceptionif it could not be found.- Parameters:
buildNamespace- the build namespacebuildNumber- the build number- Returns:
- the matching service component
- Throws:
NoSuchServiceComponentException- if a matching service component could not be foundNoSuchServiceComponentException
-
fetchByBNS_BNU
Returns the service component where buildNamespace = ? and buildNumber = ? or returnsnullif it could not be found. Uses the finder cache.- Parameters:
buildNamespace- the build namespacebuildNumber- the build number- Returns:
- the matching service component, or
nullif a matching service component could not be found
-
fetchByBNS_BNU
public static ServiceComponent fetchByBNS_BNU(String buildNamespace, long buildNumber, boolean useFinderCache) Returns the service component where buildNamespace = ? and buildNumber = ? or returnsnullif it could not be found, optionally using the finder cache.- Parameters:
buildNamespace- the build namespacebuildNumber- the build numberuseFinderCache- whether to use the finder cache- Returns:
- the matching service component, or
nullif a matching service component could not be found
-
removeByBNS_BNU
public static ServiceComponent removeByBNS_BNU(String buildNamespace, long buildNumber) throws NoSuchServiceComponentException Removes the service component where buildNamespace = ? and buildNumber = ? from the database.- Parameters:
buildNamespace- the build namespacebuildNumber- the build number- Returns:
- the service component that was removed
- Throws:
NoSuchServiceComponentException
-
countByBNS_BNU
Returns the number of service components where buildNamespace = ? and buildNumber = ?.- Parameters:
buildNamespace- the build namespacebuildNumber- the build number- Returns:
- the number of matching service components
-
cacheResult
Caches the service component in the entity cache if it is enabled.- Parameters:
serviceComponent- the service component
-
cacheResult
Caches the service components in the entity cache if it is enabled.- Parameters:
serviceComponents- the service components
-
create
Creates a new service component with the primary key. Does not add the service component to the database.- Parameters:
serviceComponentId- the primary key for the new service component- Returns:
- the new service component
-
remove
public static ServiceComponent remove(long serviceComponentId) throws NoSuchServiceComponentException Removes the service component with the primary key from the database. Also notifies the appropriate model listeners.- Parameters:
serviceComponentId- the primary key of the service component- Returns:
- the service component that was removed
- Throws:
NoSuchServiceComponentException- if a service component with the primary key could not be foundNoSuchServiceComponentException
-
updateImpl
-
findByPrimaryKey
public static ServiceComponent findByPrimaryKey(long serviceComponentId) throws NoSuchServiceComponentException Returns the service component with the primary key or throws aNoSuchServiceComponentExceptionif it could not be found.- Parameters:
serviceComponentId- the primary key of the service component- Returns:
- the service component
- Throws:
NoSuchServiceComponentException- if a service component with the primary key could not be foundNoSuchServiceComponentException
-
fetchByPrimaryKey
Returns the service component with the primary key or returnsnullif it could not be found.- Parameters:
serviceComponentId- the primary key of the service component- Returns:
- the service component, or
nullif a service component with the primary key could not be found
-
findAll
Returns all the service components.- Returns:
- the service components
-
findAll
Returns a range of all the service components.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromServiceComponentModelImpl.- Parameters:
start- the lower bound of the range of service componentsend- the upper bound of the range of service components (not inclusive)- Returns:
- the range of service components
-
findAll
public static List<ServiceComponent> findAll(int start, int end, OrderByComparator<ServiceComponent> orderByComparator) Returns an ordered range of all the service components.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromServiceComponentModelImpl.- Parameters:
start- the lower bound of the range of service componentsend- the upper bound of the range of service components (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- Returns:
- the ordered range of service components
-
findAll
public static List<ServiceComponent> findAll(int start, int end, OrderByComparator<ServiceComponent> orderByComparator, boolean useFinderCache) Returns an ordered range of all the service components.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromServiceComponentModelImpl.- Parameters:
start- the lower bound of the range of service componentsend- the upper bound of the range of service components (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)useFinderCache- whether to use the finder cache- Returns:
- the ordered range of service components
-
removeAll
public static void removeAll()Removes all the service components from the database. -
countAll
public static int countAll()Returns the number of service components.- Returns:
- the number of service components
-
getPersistence
-
setPersistence
-