Class JPQLContext
java.lang.Object
org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext
- All Implemented Interfaces:
JPQLContextView
The abstract class is a compilation of objects required for building
A default implementation is provided by the library.
JPQLStatement. Extend this
class to implement specific implementations of JPQL context types (Select,
Join). A JPQL Context is constructed from an OData
request. Depending on OData CRUD operation performed on an Entity, a
corresponding JPQL context object is built. The JPQL context object thus
built can be used for constructing JPQL statements. A default implementation is provided by the library.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe abstract class is extended by specific JPQLContext builder for building JPQLContexts. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringAn alias for Java Persistence Entityprotected StringJava Persistence Entity nameprotected booleanprotected JPQLContextTypeThe type of JPQL context. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final JPQLContext.JPQLContextBuildercreateBuilder(JPQLContextType contextType, Object resultsView) the method returns an instance of typeJPQLContext.JPQLContextBuilderbased on the JPQLContextType.static final JPQLContext.JPQLContextBuildercreateBuilder(JPQLContextType contextType, Object resultsView, boolean withPaging) the method returns an instance of typeJPQLContext.JPQLContextBuilderbased on the JPQLContextType.final Stringgets the JPA entity alias name set into the contextfinal Stringgets the JPA entity name set into the contextfinal JPQLContextTypegetType()gets the JPQL context type set into the contextprotected voidisPagingRequested(boolean pagingRequested) protected final voidsetJPAEntityAlias(String jpaEntityAlias) sets JPA Entity alias name into the contextprotected final voidsetJPAEntityName(String jpaEntityName) sets JPA Entity Name into the contextprotected final voidsetType(JPQLContextType type) sets the JPQL context type into the context
-
Field Details
-
jpaEntityAlias
An alias for Java Persistence Entity -
jpaEntityName
Java Persistence Entity name -
type
The type of JPQL context. Based on the type JPQL statements can be built. -
pagingRequested
protected boolean pagingRequested
-
-
Constructor Details
-
JPQLContext
public JPQLContext()
-
-
Method Details
-
setJPAEntityName
sets JPA Entity Name into the context- Parameters:
jpaEntityName- is the name of JPA Entity
-
setJPAEntityAlias
sets JPA Entity alias name into the context- Parameters:
jpaEntityAlias- is the JPA entity alias name
-
getJPAEntityAlias
gets the JPA entity alias name set into the context- Specified by:
getJPAEntityAliasin interfaceJPQLContextView- Returns:
- JPA entity alias name
-
setType
sets the JPQL context type into the context- Parameters:
type- is JPQLContextType
-
getJPAEntityName
gets the JPA entity name set into the context- Specified by:
getJPAEntityNamein interfaceJPQLContextView- Returns:
- JPA entity name
-
getType
gets the JPQL context type set into the context- Specified by:
getTypein interfaceJPQLContextView- Returns:
- an instance of type
JPQLContextType
-
isPagingRequested
protected void isPagingRequested(boolean pagingRequested) -
createBuilder
public static final JPQLContext.JPQLContextBuilder createBuilder(JPQLContextType contextType, Object resultsView) throws ODataJPARuntimeException the method returns an instance of typeJPQLContext.JPQLContextBuilderbased on the JPQLContextType. The context builder can be used for building different JPQL contexts.- Parameters:
contextType- is the JPQLContextTyperesultsView- is the OData request view- Returns:
- an instance of type
JPQLContext.JPQLContextBuilder - Throws:
ODataJPARuntimeException- Caso ocorra exceção
-
createBuilder
public static final JPQLContext.JPQLContextBuilder createBuilder(JPQLContextType contextType, Object resultsView, boolean withPaging) throws ODataJPARuntimeException the method returns an instance of typeJPQLContext.JPQLContextBuilderbased on the JPQLContextType. The context builder can be used for building different JPQL contexts.- Parameters:
contextType- is the JPQLContextTyperesultsView- is the OData request viewwithPaging- indicates whether to build the context with paging- Returns:
- an instance of type
JPQLContext.JPQLContextBuilder - Throws:
ODataJPARuntimeException- Caso ocorra exceção
-