Class JPQLContext
- java.lang.Object
-
- org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext
-
- All Implemented Interfaces:
JPQLContextView
public abstract class JPQLContext extends Object implements JPQLContextView
The abstract class is a compilation of objects required for buildingJPQLStatement. 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:
JPQLStatement,JPQLContextType,JPQLBuilderFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJPQLContext.JPQLContextBuilderThe abstract class is extended by specific JPQLContext builder for building JPQLContexts.
-
Field Summary
Fields Modifier and Type Field Description protected StringjpaEntityAliasAn alias for Java Persistence Entityprotected StringjpaEntityNameJava Persistence Entity nameprotected booleanpagingRequestedprotected JPQLContextTypetypeThe type of JPQL context.
-
Constructor Summary
Constructors Constructor Description JPQLContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JPQLContext.JPQLContextBuildercreateBuilder(JPQLContextType contextType, Object resultsView)the method returns an instance of typeJPQLContext.JPQLContextBuilderbased on the JPQLContextType.static JPQLContext.JPQLContextBuildercreateBuilder(JPQLContextType contextType, Object resultsView, boolean withPaging)the method returns an instance of typeJPQLContext.JPQLContextBuilderbased on the JPQLContextType.StringgetJPAEntityAlias()gets the JPA entity alias name set into the contextStringgetJPAEntityName()gets the JPA entity name set into the contextJPQLContextTypegetType()gets the JPQL context type set into the contextprotected voidisPagingRequested(boolean pagingRequested)protected voidsetJPAEntityAlias(String jpaEntityAlias)sets JPA Entity alias name into the contextprotected voidsetJPAEntityName(String jpaEntityName)sets JPA Entity Name into the contextprotected voidsetType(JPQLContextType type)sets the JPQL context type into the context
-
-
-
Field Detail
-
jpaEntityAlias
protected String jpaEntityAlias
An alias for Java Persistence Entity
-
jpaEntityName
protected String jpaEntityName
Java Persistence Entity name
-
type
protected JPQLContextType type
The type of JPQL context. Based on the type JPQL statements can be built.
-
pagingRequested
protected boolean pagingRequested
-
-
Method Detail
-
setJPAEntityName
protected final void setJPAEntityName(String jpaEntityName)
sets JPA Entity Name into the context- Parameters:
jpaEntityName- is the name of JPA Entity
-
setJPAEntityAlias
protected final void setJPAEntityAlias(String jpaEntityAlias)
sets JPA Entity alias name into the context- Parameters:
jpaEntityAlias- is the JPA entity alias name
-
getJPAEntityAlias
public final String getJPAEntityAlias()
gets the JPA entity alias name set into the context- Specified by:
getJPAEntityAliasin interfaceJPQLContextView- Returns:
- JPA entity alias name
-
setType
protected final void setType(JPQLContextType type)
sets the JPQL context type into the context- Parameters:
type- is JPQLContextType
-
getJPAEntityName
public final String getJPAEntityName()
gets the JPA entity name set into the context- Specified by:
getJPAEntityNamein interfaceJPQLContextView- Returns:
- JPA entity name
-
getType
public final JPQLContextType 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
-
-