Class JPAODataServiceContext.Builder
java.lang.Object
com.sap.olingo.jpa.processor.core.api.JPAODataServiceContext.Builder
- Enclosing class:
- JPAODataServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()setDatabaseProcessor(JPAODataDatabaseProcessor databaseProcessor)A database processor allows database specific implementations for search and odata function with function import that are implemented as database functions.
In case no database processor is provided and non could be determined via an data sourceJPADefaultDatabaseProcessoris used.setDataSource(DataSource ds)The data source is used to create an entity manager factory if not provided, seesetEntityManagerFactory(EntityManagerFactory), and to determine the type of database used to select an integrated database processor, in case the database processor was not set viasetDatabaseProcessor(JPAODataDatabaseProcessor)}.setEdmNameBuilder(com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder nameBuilder)Set a custom EDM name builderJPAEdmNameBuilder.setEntityManagerFactory(javax.persistence.EntityManagerFactory emf)Set an externally created entity manager factory.
This is necessary e.g. in case a spring based service shall run without apersistance.xml.setErrorProcessor(org.apache.olingo.server.api.processor.ErrorProcessor errorProcessor)Allows to provide an Olingo error processor.setMetadataPostProcessor(com.sap.olingo.jpa.metadata.api.JPAEdmMetadataPostProcessor postProcessor)setOperationConverter(JPAODataDatabaseOperations jpaOperationConverter)setPagingProvider(JPAODataPagingProvider provider)Register a provider that is able to decides based on a given query if the server like to return only a sub set of the requested results as well as a $skiptoken.The name of the persistence-unit to be used.setReferences(List<org.apache.olingo.commons.api.edmx.EdmxReference> references)setRequestMappingPath(String mappingPath)setTypePackage(String... packageName)Name of the top level package to look for Enumeration Types Java class based FunctionssetUseAbsoluteContextURL(boolean useAbsoluteContextURL)Some clients, like Excel, require context url's with an absolute path.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
- Throws:
org.apache.olingo.commons.api.ex.ODataException
-
setDatabaseProcessor
public JPAODataServiceContext.Builder setDatabaseProcessor(JPAODataDatabaseProcessor databaseProcessor)A database processor allows database specific implementations for search and odata function with function import that are implemented as database functions.
In case no database processor is provided and non could be determined via an data sourceJPADefaultDatabaseProcessoris used.- Parameters:
databaseProcessor-- Returns:
-
setDataSource
The data source is used to create an entity manager factory if not provided, seesetEntityManagerFactory(EntityManagerFactory), and to determine the type of database used to select an integrated database processor, in case the database processor was not set viasetDatabaseProcessor(JPAODataDatabaseProcessor)}.- Parameters:
ds-- Returns:
-
setErrorProcessor
public JPAODataServiceContext.Builder setErrorProcessor(org.apache.olingo.server.api.processor.ErrorProcessor errorProcessor)Allows to provide an Olingo error processor. The error processor allows to enrich an error response. See JSON Error Response or Atom Error Response.- Parameters:
errorProcessor-
-
setMetadataPostProcessor
public JPAODataServiceContext.Builder setMetadataPostProcessor(com.sap.olingo.jpa.metadata.api.JPAEdmMetadataPostProcessor postProcessor)- Parameters:
postProcessor-- Returns:
-
setOperationConverter
public JPAODataServiceContext.Builder setOperationConverter(JPAODataDatabaseOperations jpaOperationConverter)- Parameters:
jpaOperationConverter-- Returns:
-
setPagingProvider
Register a provider that is able to decides based on a given query if the server like to return only a sub set of the requested results as well as a $skiptoken.- Parameters:
provider-
-
setPUnit
The name of the persistence-unit to be used. It is taken to create a entity manager factory (setEntityManagerFactory(EntityManagerFactory)), if not provided and as namespace of the OData service, in case the default name builder shall be used.- Parameters:
pUnit-- Returns:
-
setReferences
public JPAODataServiceContext.Builder setReferences(List<org.apache.olingo.commons.api.edmx.EdmxReference> references)- Parameters:
references-- Returns:
-
setTypePackage
Name of the top level package to look for- Enumeration Types
- Java class based Functions
- Parameters:
packageName-
-
setRequestMappingPath
-
setEntityManagerFactory
public JPAODataServiceContext.Builder setEntityManagerFactory(javax.persistence.EntityManagerFactory emf)Set an externally created entity manager factory.
This is necessary e.g. in case a spring based service shall run without apersistance.xml.- Parameters:
emf-- Returns:
-
setEdmNameBuilder
public JPAODataServiceContext.Builder setEdmNameBuilder(com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEdmNameBuilder nameBuilder)Set a custom EDM name builderJPAEdmNameBuilder. If non is providedJPADefaultEdmNameBuilderis used, which uses the provided persistence-unit name (setPUnit(java.lang.String)) as namespace.- Parameters:
nameBuilder-- Returns:
-
setUseAbsoluteContextURL
Some clients, like Excel, require context url's with an absolute path. The default generation of relative paths can be overruled.- Parameters:
useAbsoluteContextURL-- Returns:
- See Also:
- Issue OLINGO-787
-