Package com.blazebit.persistence.spi
Interface JpaProvider
public interface JpaProvider
A JPA provider implementation provides information about which features are supported by a JPA implementation.
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The possible locations of a constraint. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsEntity
(javax.persistence.EntityManager em, Class<?> entityClass, Object id) Returns whether the entity with the id is contained in the entity managers persistence context.escapeCharacter
(char character) The given escape character for a LIKE predicate as string.getBooleanConditionalExpression
(boolean value) The JPQL conditional expression to use for the given literal boolean value.getBooleanExpression
(boolean value) The JPQL expression to use for the given literal boolean value.Normally returnsVALUE
, but since Hibernate does weird things when using that, it returnsnull
.String[]
getColumnNames
(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName) Returns the column names of the attribute of the given entity type.String[]
getColumnNames
(javax.persistence.metamodel.EntityType<?> ownerType, String elementCollectionPath, String attributeName) Returns the column names of the attribute of the given entity type within the element collection.String[]
getColumnTypes
(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName) Returns the SQL column type names of the given attribute of the given entity type.String[]
getColumnTypes
(javax.persistence.metamodel.EntityType<?> ownerType, String elementCollectionPath, String attributeName) Returns the SQL column type names of the given attribute of the given entity type within the element collection.getCustomFunctionInvocation
(String functionName, int argumentCount) Returns the start of a JPQL representation of a function invocation for the given function name and argument count.Class<?>
The default result type of a scalar query.String[]
getDiscriminatorColumnCheck
(javax.persistence.metamodel.EntityType<?> entityType) Returns an array with the column name of the discriminator of the given entity type and the discriminator value, or null.getIdentifier
(Object entity) Returns the identifier of the entity object.getIdentifierOrUniqueKeyEmbeddedPropertyNames
(javax.persistence.metamodel.EntityType<?> owner, String attributeName) Deprecated.getIdentifierOrUniqueKeyEmbeddedPropertyNames
(javax.persistence.metamodel.EntityType<?> owner, String elementCollectionPath, String attributeName) Deprecated.getJoinMappingPropertyNames
(javax.persistence.metamodel.EntityType<?> owner, String elementCollectionPath, String attributeName) Returns the join mapping property names of an association attribute.getJoinTable
(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName) If the given attribute is a collection that uses a join table, returns it's descriptor.Returns the JpaMetamodelAccessor for this JPA vendor.getMappedBy
(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName) If the given attribute is an inverse collection, the mapped by attribute name is returned.The JPQL expression to use for the NULL literal.The name of the clause that has the same semantics as the ON clause which was introduced in JPA 2.1.getWritableMappedByMappings
(javax.persistence.metamodel.EntityType<?> inverseType, javax.persistence.metamodel.EntityType<?> ownerType, String attributeName, String inverseAttribute) If the given attribute is insertable = false and updatable = false it returns the writable mappings for the inverse type.boolean
hasJoinCondition
(javax.persistence.metamodel.ManagedType<?> ownerType, String elementCollectionPath, String attributeName) Whether the given attribute has a join condition.boolean
Whether the given attribute is a non-indexed and non-ordered collection a.k.a. a bag.boolean
isColumnShared
(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName) Whether columns for the given attribute are shared between multiple subtypes or shared by occupying the same slot in the resulting SQL.boolean
isDeleteCascaded
(javax.persistence.metamodel.ManagedType<?> ownerType, String attributeName) Whether delete cascading is activated for the given attribute.boolean
isDeleteCascaded
(javax.persistence.metamodel.ManagedType<?> ownerType, String elementCollectionPath, String attributeName) Whether delete cascading is activated for the given attribute within the element collection.boolean
isForeignJoinColumn
(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName) Whether the join columns for the given attribute are in a foreign table.boolean
isOrphanRemoval
(javax.persistence.metamodel.ManagedType<?> ownerType, String attributeName) Whether orphan removal is activated for the given attribute.boolean
isOrphanRemoval
(javax.persistence.metamodel.ManagedType<?> ownerType, String elementCollectionPath, String attributeName) Whether orphan removal is activated for the given attribute within the element collection.boolean
Indicates if the provider needs associations in the ON clause to use their id.boolean
Whether brackets are needed around a list parameter.boolean
Indicates if the provider needs associations in the ON clause to use their id.boolean
Indicates whether the provider always requires an else branch in a case when expression.boolean
Indicates whether the provider supports correlating inverse associations.boolean
Indicates whether the provider needs to cutoff id properties when used as subpath of element collections.boolean
Returns whether key restricted left joins should be rewritten to subquery joins.boolean
Indicates if the provider does column sharing for same named columns in inheritance mappings and thus requires the use of a CASE WHEN expression for restricting casted accesses like e.g.boolean
Indicates whether the provider requires an unproxied entity for field access to work.void
renderNullPrecedence
(StringBuilder sb, String expression, String resolvedExpression, String order, String nulls) Renders the null precedence into the given string builder.requiresTreatFilter
(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName, JoinType joinType) Returns where to put treat filters for a treat joined association of this attribute.void
setCacheable
(javax.persistence.Query query) Enables query result caching for the given query.void
setSingularParameter
(javax.persistence.Query query, String name, Object value) Sets the given parameter as singular parameter on the given query.boolean
Indicates whether the provider clears collection table entries on bulk delete operations.boolean
Whether dereferencing a VALUE function expression is supported by the JPA provider.boolean
Whether theCOUNT(*)
syntax is supported.boolean
Whether cross joins are supported.boolean
Whether the custom functions are supported.boolean
Whether Entity Joins are supported.boolean
supportsEnumLiteral
(javax.persistence.metamodel.ManagedType<?> ownerType, String attributeName, boolean key) Whether the enum type of the given attribute supports being used as literal by it's FQN.boolean
Indicates if the provider supports the use of foreign associations in the ON clause.boolean
Indicates whether the provider supports group by entity alias properly.boolean
Whether Insert statements are supported.boolean
Indicates whether the provider clears join table entries on bulk delete operations.boolean
Whether JPA 2.1 specification is supported.boolean
Indicates whether the provider supports automatic like pattern escaping according to the database requirements.boolean
Whether listagg syntax is supported.boolean
Whether the JPA provider supports the use of an alias other than the driving alias in the ON clause.boolean
Whether the non scalar subqueries are supported.boolean
Whether the query language supports the null precedence clause.boolean
Whether the JPA provider supports the use of an entity proxy as parameter for a non primary key association.boolean
Whether treating a from/root alias is supported.boolean
Whether a root treat in a join is supported.boolean
Whether a root treat in a treat join is supported.boolean
Whether the JPA provider supports the use of an entity alias in a subquery for comparison predicates when the entity has an embedded/composite id.boolean
Whether set operations are supported by the JPA provider.boolean
Indicates if the provider supports expressions like doc.owner.id without generating an extra join.boolean
Indicates whether the provider supports optimized natural id access.boolean
Whether the subqueries alias shadowing is supported.boolean
Whether the subqueries in functions are supported.boolean
Whether the LIMIT and OFFSET clause in subqueries are supported by the JPA provider.boolean
Whether properties accessed of a from node are implicitly resolved to properties of a subtype of the from node.boolean
Whether relations of a from node in joins are implicitly resolved to the relations of a subtype of the from node.boolean
Whether the JPA provider supports the temporal literal.boolean
Indicates if the provider supports the use of transient entity objects as parameters.boolean
Whether a correlation path with a treat expression is supported.boolean
Whether a treat join is supported.boolean
Indicates whether an association id can be set via an update queries SET clause or if the association has to be set as a whole.boolean
Indicates whether an embeddable can be set via an update queries SET clause.<T> T
unproxy
(T entity) Returns the unproxied i.e. the real entity object.
-
Method Details
-
supportsJpa21
boolean supportsJpa21()Whether JPA 2.1 specification is supported.- Returns:
- True if JPA 2.1 is supported, false otherwise
-
supportsEntityJoin
boolean supportsEntityJoin()Whether Entity Joins are supported.- Returns:
- True if Entity Joins are supported, false otherwise
-
supportsCrossJoin
boolean supportsCrossJoin()Whether cross joins are supported.- Returns:
- True if cross joins are supported, false otherwise
- Since:
- 1.6.7
-
supportsInsertStatement
boolean supportsInsertStatement()Whether Insert statements are supported.- Returns:
- True if Insert statements are supported, false otherwise
-
needsBracketsForListParameter
boolean needsBracketsForListParameter()Whether brackets are needed around a list parameter.- Returns:
- True if brackets are needed, false otherwise
-
needsJoinSubqueryRewrite
boolean needsJoinSubqueryRewrite()Returns whether key restricted left joins should be rewritten to subquery joins. This is part of the workaround for https://hibernate.atlassian.net/browse/HHH-9329 which makes key restricted left joins wrong.- Returns:
- true if joins should be rewritten to subquery joins, false otherwise
-
getBooleanExpression
The JPQL expression to use for the given literal boolean value. This expression is used in contexts where an expression is assumed.- Parameters:
value
- The boolean value- Returns:
- The JPQL expression to use to reflect the boolean value
-
getBooleanConditionalExpression
The JPQL conditional expression to use for the given literal boolean value. This expression is used in contexts where a predicate is assumed.- Parameters:
value
- The boolean value- Returns:
- The JPQL conditional expression to use to reflect the boolean value
-
getNullExpression
String getNullExpression()The JPQL expression to use for the NULL literal.- Returns:
- The JPQL expression to use to reflect the NULL value
-
getOnClause
String getOnClause()The name of the clause that has the same semantics as the ON clause which was introduced in JPA 2.1.- Returns:
- The name of the ON clause
-
getCollectionValueFunction
String getCollectionValueFunction()Normally returnsVALUE
, but since Hibernate does weird things when using that, it returnsnull
. Returning null results in omittingVALUE
in the final query that is passed to the JPA provider.- Returns:
- The value function
-
supportsCollectionValueDereference
boolean supportsCollectionValueDereference()Whether dereferencing a VALUE function expression is supported by the JPA provider.- Returns:
- True if dereferencing is supported, false otherwise
-
supportsSubqueryLimitOffset
boolean supportsSubqueryLimitOffset()Whether the LIMIT and OFFSET clause in subqueries are supported by the JPA provider.- Returns:
- True if LIMIT/OFFSET in subqueries are supported, false otherwise
- Since:
- 1.6.7
-
supportsSetOperations
boolean supportsSetOperations()Whether set operations are supported by the JPA provider.- Returns:
- True if set operations are supported, false otherwise
- Since:
- 1.6.7
-
supportsListagg
boolean supportsListagg()Whether listagg syntax is supported.- Returns:
- True if listagg syntax is supported, false otherwise
- Since:
- 1.6.7
-
getDefaultQueryResultType
Class<?> getDefaultQueryResultType()The default result type of a scalar query.- Returns:
- The default result type
-
getCustomFunctionInvocation
Returns the start of a JPQL representation of a function invocation for the given function name and argument count. Normally this returnsFUNCTION('functionName',
but implementations may also allow to render the function name directly.- Parameters:
functionName
- The function nameargumentCount
- The number of the arguments that the function is invoked with- Returns:
- The start of the JPQL represenation for the function invocation
-
escapeCharacter
The given escape character for a LIKE predicate as string.- Parameters:
character
- The escape character- Returns:
- The string representation
-
supportsNullPrecedenceExpression
boolean supportsNullPrecedenceExpression()Whether the query language supports the null precedence clause.- Returns:
- True if the null precedence clause is supported, false otherwise
-
renderNullPrecedence
void renderNullPrecedence(StringBuilder sb, String expression, String resolvedExpression, String order, String nulls) Renders the null precedence into the given string builder.- Parameters:
sb
- The builder to which the null precedence should be appended toexpression
- The order by expression which might be a select aliasresolvedExpression
- The resolved expression for a possible select alias or the expressionorder
- The order as string (ASC
orDESC
)nulls
- The null precedence as string (NULLS FIRST
orNULLS LAST
)
-
supportsRootTreat
boolean supportsRootTreat()Whether treating a from/root alias is supported. For exampleSELECT TREAT(alias AS Subtype).property FROM ..
- Returns:
- True if treating a from alias is supported, false otherwise
-
supportsTreatJoin
boolean supportsTreatJoin()Whether a treat join is supported. For exampleSELECT ... FROM .. JOIN TREAT(alias.relation AS Subtype)
- Returns:
- True if a treat join is supported, false otherwise
-
supportsTreatCorrelation
boolean supportsTreatCorrelation()Whether a correlation path with a treat expression is supported. For exampleSELECT (SELECT .. FROM TREAT(parent AS Subtype).relation) FROM ..
- Returns:
- True if a treat in correlation expressions is supported, false otherwise
-
supportsRootTreatJoin
boolean supportsRootTreatJoin()Whether a root treat in a join is supported. For exampleSELECT ... FROM .. JOIN TREAT(alias AS Subtype).relation
- Returns:
- True if a root treat in a join is supported, false otherwise
-
supportsRootTreatTreatJoin
boolean supportsRootTreatTreatJoin()Whether a root treat in a treat join is supported. For exampleSELECT ... FROM .. JOIN TREAT(TREAT(alias AS Subtype).relation AS Subtype)
- Returns:
- True if a root treat in a treat join is supported, false otherwise
-
supportsSubtypePropertyResolving
boolean supportsSubtypePropertyResolving()Whether properties accessed of a from node are implicitly resolved to properties of a subtype of the from node.- Returns:
- True if subtype property resolving is supported, false otherwise
-
supportsSubtypeRelationResolving
boolean supportsSubtypeRelationResolving()Whether relations of a from node in joins are implicitly resolved to the relations of a subtype of the from node.- Returns:
- True if subtype relation resolving is supported, false otherwise
-
supportsCountStar
boolean supportsCountStar()Whether theCOUNT(*)
syntax is supported.- Returns:
- True if
COUNT(*)
syntax is supported, false otherwise
-
supportsCustomFunctions
boolean supportsCustomFunctions()Whether the custom functions are supported.- Returns:
- True if custom functions are supported, false otherwise
- Since:
- 1.4.0
-
supportsNonScalarSubquery
boolean supportsNonScalarSubquery()Whether the non scalar subqueries are supported.- Returns:
- True if non scalar subqueries are supported, false otherwise
- Since:
- 1.4.1
-
supportsSubqueryInFunction
boolean supportsSubqueryInFunction()Whether the subqueries in functions are supported.- Returns:
- True if subqueries in functions are supported, false otherwise
- Since:
- 1.4.1
-
supportsSubqueryAliasShadowing
boolean supportsSubqueryAliasShadowing()Whether the subqueries alias shadowing is supported.- Returns:
- True if subqueries alias shadowing is supported, false otherwise
- Since:
- 1.4.1
-
getDiscriminatorColumnCheck
Returns an array with the column name of the discriminator of the given entity type and the discriminator value, or null.- Parameters:
entityType
- The entity type- Returns:
- The column name of the discriminator and the discriminator value, or null
- Since:
- 1.3.0
-
isForeignJoinColumn
boolean isForeignJoinColumn(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName) Whether the join columns for the given attribute are in a foreign table.- Parameters:
ownerType
- The owner of the attributeattributeName
- The attribute name to check- Returns:
- True if join columns are in a foreign table, false otherwise
-
getColumnNames
Returns the column names of the attribute of the given entity type.- Parameters:
ownerType
- The owner of the attributeattributeName
- The attribute name- Returns:
- The column names of the attribute
-
getColumnNames
String[] getColumnNames(javax.persistence.metamodel.EntityType<?> ownerType, String elementCollectionPath, String attributeName) Returns the column names of the attribute of the given entity type within the element collection.- Parameters:
ownerType
- The owner of the attributeelementCollectionPath
- The path to the element collection within which the attribute is containedattributeName
- The attribute name- Returns:
- The column names of the attribute
- Since:
- 1.3.0
-
getColumnTypes
Returns the SQL column type names of the given attribute of the given entity type.- Parameters:
ownerType
- The owner of the attributeattributeName
- The attribute name- Returns:
- The SQL column type names for the attribute
-
getColumnTypes
String[] getColumnTypes(javax.persistence.metamodel.EntityType<?> ownerType, String elementCollectionPath, String attributeName) Returns the SQL column type names of the given attribute of the given entity type within the element collection.- Parameters:
ownerType
- The owner of the attributeelementCollectionPath
- The path to the element collection within which the attribute is containedattributeName
- The attribute name- Returns:
- The SQL column type names for the attribute
- Since:
- 1.3.0
-
requiresTreatFilter
JpaProvider.ConstraintType requiresTreatFilter(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName, JoinType joinType) Returns where to put treat filters for a treat joined association of this attribute. This is for JPA providers that don't correctly filter the types. Hibernate for example does not automatically add the type constraint to treat joins of a type that uses the table per class inheritance strategy.- Parameters:
ownerType
- The declaring type of the attribute to checkattributeName
- The attribute name for which to check the treat filter requirement or nulljoinType
- The join type used for the treat join- Returns:
- The constraint type for the treat filter
-
getMappedBy
If the given attribute is an inverse collection, the mapped by attribute name is returned. Otherwise returns null.- Parameters:
ownerType
- The declaring type of the attribute to checkattributeName
- The name of the inverse attribute for which to retrieve the mapped by value- Returns:
- The mapped by attribute name if the given attribute is an inverse collection, null otherwise
-
getWritableMappedByMappings
Map<String,String> getWritableMappedByMappings(javax.persistence.metamodel.EntityType<?> inverseType, javax.persistence.metamodel.EntityType<?> ownerType, String attributeName, String inverseAttribute) If the given attribute is insertable = false and updatable = false it returns the writable mappings for the inverse type. Otherwise returns null.- Parameters:
inverseType
- The type containing the inverse relationownerType
- The declaring type of the attribute to checkattributeName
- The name of the attribute for which to retrieve the writable mapped by mappinginverseAttribute
- The name of the inverse attribute for which to retrieve the writable mapped by mapping- Returns:
- The writable mappings for the inverse type if the attribute is not insertable or updatable, null otherwise
-
getJoinTable
If the given attribute is a collection that uses a join table, returns it's descriptor. Otherwise returns null.- Parameters:
ownerType
- The declaring type of the attribute to checkattributeName
- The name of the attribute for which to retrieve the join table name- Returns:
- The join table information if the attribute has one, null otherwise
-
isBag
Whether the given attribute is a non-indexed and non-ordered collection a.k.a. a bag.- Parameters:
ownerType
- The declaring type of the attribute to checkattributeName
- The name of the attribute to check- Returns:
- True if it is a bag, false otherwise
-
isOrphanRemoval
Whether orphan removal is activated for the given attribute.- Parameters:
ownerType
- The declaring type of the attribute to checkattributeName
- The name of the attribute to check- Returns:
- True if orphan removal is activated, else false
-
isOrphanRemoval
boolean isOrphanRemoval(javax.persistence.metamodel.ManagedType<?> ownerType, String elementCollectionPath, String attributeName) Whether orphan removal is activated for the given attribute within the element collection.- Parameters:
ownerType
- The declaring type of the attribute to checkelementCollectionPath
- The path to the element collection within which the attribute is containedattributeName
- The name of the attribute to check- Returns:
- True if orphan removal is activated, else false
- Since:
- 1.3.0
-
isDeleteCascaded
boolean isDeleteCascaded(javax.persistence.metamodel.ManagedType<?> ownerType, String attributeName) Whether delete cascading is activated for the given attribute.- Parameters:
ownerType
- The declaring type of the attribute to checkattributeName
- The name of the attribute to check- Returns:
- True if delete cascading is activated, else false
-
isDeleteCascaded
boolean isDeleteCascaded(javax.persistence.metamodel.ManagedType<?> ownerType, String elementCollectionPath, String attributeName) Whether delete cascading is activated for the given attribute within the element collection.- Parameters:
ownerType
- The declaring type of the attribute to checkelementCollectionPath
- The path to the element collection within which the attribute is containedattributeName
- The name of the attribute to check- Returns:
- True if delete cascading is activated, else false
- Since:
- 1.3.0
-
hasJoinCondition
boolean hasJoinCondition(javax.persistence.metamodel.ManagedType<?> ownerType, String elementCollectionPath, String attributeName) Whether the given attribute has a join condition.- Parameters:
ownerType
- The declaring type of the attribute to checkelementCollectionPath
- The nullable path to the element collection within which the attribute is containedattributeName
- The name of the attribute to check- Returns:
- True if it has a join condition, else false
-
containsEntity
Returns whether the entity with the id is contained in the entity managers persistence context.- Parameters:
em
- The entity managerentityClass
- The entity classid
- The entity id- Returns:
- True if it is contained, false otherwise
-
supportsSingleValuedAssociationIdExpressions
boolean supportsSingleValuedAssociationIdExpressions()Indicates if the provider supports expressions like doc.owner.id without generating an extra join.- Returns:
- true if supported, else false
-
supportsForeignAssociationInOnClause
boolean supportsForeignAssociationInOnClause()Indicates if the provider supports the use of foreign associations in the ON clause. This is the case when implicit joins in the ON clause are specially treated regarding SQL rendering. If an expression likealias.association.property
results in a subquery or table group join when used in the ON clause, the JPA provider supports this feature. Normally this silently fails with invalid SQL. By returning false, subqueries will be generated for such associations instead. The value is not yet used but will be in a future version. Also see: https://github.com/Blazebit/blaze-persistence/issues/402- Returns:
- true if supported, else false
-
supportsUpdateSetEmbeddable
boolean supportsUpdateSetEmbeddable()Indicates whether an embeddable can be set via an update queries SET clause. Although the JPA spec mandates this, it doesn't seem to be asserted so some providers don't support it.- Returns:
- true if supported, else false
-
supportsUpdateSetAssociationId
boolean supportsUpdateSetAssociationId()Indicates whether an association id can be set via an update queries SET clause or if the association has to be set as a whole.- Returns:
- true if supported, else false
- Since:
- 1.5.0
-
supportsTransientEntityAsParameter
boolean supportsTransientEntityAsParameter()Indicates if the provider supports the use of transient entity objects as parameters.- Returns:
- true if supported, else false
-
needsAssociationToIdRewriteInOnClause
boolean needsAssociationToIdRewriteInOnClause()Indicates if the provider needs associations in the ON clause to use their id. If needed, an expression likealias.association
in the ON clause is rewritten toalias.association.id
.- Returns:
- true if required, else false
-
needsBrokenAssociationToIdRewriteInOnClause
boolean needsBrokenAssociationToIdRewriteInOnClause()Indicates if the provider needs associations in the ON clause to use their id. If needed, an expression likealias.association
in the ON clause is rewritten toalias.association.id
which relies on a broken type check in older Hibernate versions.- Returns:
- true if required, else false
-
needsTypeConstraintForColumnSharing
boolean needsTypeConstraintForColumnSharing()Indicates if the provider does column sharing for same named columns in inheritance mappings and thus requires the use of a CASE WHEN expression for restricting casted accesses like e.g.TREAT(alias AS Subtype).property
to retain cast semantics.- Returns:
- true if required, else false
-
supportsCollectionTableCleanupOnDelete
boolean supportsCollectionTableCleanupOnDelete()Indicates whether the provider clears collection table entries on bulk delete operations.- Returns:
- true if supported, else false
-
supportsJoinTableCleanupOnDelete
boolean supportsJoinTableCleanupOnDelete()Indicates whether the provider clears join table entries on bulk delete operations.- Returns:
- true if supported, else false
-
needsCorrelationPredicateWhenCorrelatingWithWhereClause
boolean needsCorrelationPredicateWhenCorrelatingWithWhereClause()Indicates whether the provider supports correlating inverse associations.- Returns:
- true if needed, else false
- Since:
- 1.3.0
-
supportsSingleValuedAssociationNaturalIdExpressions
boolean supportsSingleValuedAssociationNaturalIdExpressions()Indicates whether the provider supports optimized natural id access.- Returns:
- true if supported, else false
- Since:
- 1.3.0
-
supportsGroupByEntityAlias
boolean supportsGroupByEntityAlias()Indicates whether the provider supports group by entity alias properly.- Returns:
- true if supported, else false
- Since:
- 1.3.0
-
needsElementCollectionIdCutoff
boolean needsElementCollectionIdCutoff()Indicates whether the provider needs to cutoff id properties when used as subpath of element collections. This is to be able to workaround https://hibernate.atlassian.net/browse/HHH-13045 .- Returns:
- true if needed, else false
- Since:
- 1.3.0
-
needsUnproxyForFieldAccess
boolean needsUnproxyForFieldAccess()Indicates whether the provider requires an unproxied entity for field access to work.- Returns:
- true if needed, else false
- Since:
- 1.4.1
-
needsCaseWhenElseBranch
boolean needsCaseWhenElseBranch()Indicates whether the provider always requires an else branch in a case when expression.- Returns:
- true if needed, else false
- Since:
- 1.6.0
-
supportsLikePatternEscape
boolean supportsLikePatternEscape()Indicates whether the provider supports automatic like pattern escaping according to the database requirements.- Returns:
- true if supported, else false
- Since:
- 1.6.3
-
setCacheable
void setCacheable(javax.persistence.Query query) Enables query result caching for the given query.- Parameters:
query
- Enables query result caching for the query- Since:
- 1.2.0
-
setSingularParameter
Sets the given parameter as singular parameter on the given query.- Parameters:
query
- The query to set the parameter onname
- The parameter namevalue
- The parameter value- Since:
- 1.6.8
-
getIdentifierOrUniqueKeyEmbeddedPropertyNames
List<String> getIdentifierOrUniqueKeyEmbeddedPropertyNames(javax.persistence.metamodel.EntityType<?> owner, String attributeName) Deprecated.Get the identifier or unique key inverse properties of an association attribute.- Parameters:
owner
- The owning entity typeattributeName
- The association attribute- Returns:
- the identifier or unique key inverse properties of the association attribute
- Since:
- 1.2.1
-
getIdentifierOrUniqueKeyEmbeddedPropertyNames
List<String> getIdentifierOrUniqueKeyEmbeddedPropertyNames(javax.persistence.metamodel.EntityType<?> owner, String elementCollectionPath, String attributeName) Deprecated.Get the identifier or unique key inverse properties of an association attribute within an element collection.- Parameters:
owner
- The owning entity typeelementCollectionPath
- The path to the element collection within which the attribute is containedattributeName
- The association attribute- Returns:
- the identifier or unique key inverse properties of the association attribute
- Since:
- 1.3.0
-
getJoinMappingPropertyNames
Map<String,String> getJoinMappingPropertyNames(javax.persistence.metamodel.EntityType<?> owner, String elementCollectionPath, String attributeName) Returns the join mapping property names of an association attribute. This is a mapping from target to source property names.- Parameters:
owner
- The owning entity typeelementCollectionPath
- The nullable path to the element collection within which the attribute is containedattributeName
- The association attribute- Returns:
- the property names from target type to the source type
- Since:
- 1.4.0
-
supportsEnumLiteral
boolean supportsEnumLiteral(javax.persistence.metamodel.ManagedType<?> ownerType, String attributeName, boolean key) Whether the enum type of the given attribute supports being used as literal by it's FQN.- Parameters:
ownerType
- The declaring type of the attribute to checkattributeName
- The name of the attribute to checkkey
- Whether the key part of a map attribute should be checked or the attribute element type- Returns:
true
if supported,false
otherwise- Since:
- 1.5.0
-
supportsTemporalLiteral
boolean supportsTemporalLiteral()Whether the JPA provider supports the temporal literal.- Returns:
true
if supported,false
otherwise- Since:
- 1.5.0
-
supportsNonDrivingAliasInOnClause
boolean supportsNonDrivingAliasInOnClause()Whether the JPA provider supports the use of an alias other than the driving alias in the ON clause.- Returns:
true
if supported,false
otherwise- Since:
- 1.5.0
-
supportsSelectCompositeIdEntityInSubquery
boolean supportsSelectCompositeIdEntityInSubquery()Whether the JPA provider supports the use of an entity alias in a subquery for comparison predicates when the entity has an embedded/composite id.- Returns:
true
if supported,false
otherwise- Since:
- 1.5.0
-
supportsProxyParameterForNonPkAssociation
boolean supportsProxyParameterForNonPkAssociation()Whether the JPA provider supports the use of an entity proxy as parameter for a non primary key association. See https://github.com/Blazebit/blaze-persistence/issues/1082 for details.- Returns:
true
if supported,false
otherwise- Since:
- 1.6.0
-
getIdentifier
Returns the identifier of the entity object.- Parameters:
entity
- The entity- Returns:
- the primary identifier of the entity
- Since:
- 1.3.0
-
unproxy
<T> T unproxy(T entity) Returns the unproxied i.e. the real entity object.- Type Parameters:
T
- The entity type- Parameters:
entity
- The entity, maybe a proxy- Returns:
- the real entity object
- Since:
- 1.3.0
-
getJpaMetamodelAccessor
JpaMetamodelAccessor getJpaMetamodelAccessor()Returns the JpaMetamodelAccessor for this JPA vendor.- Returns:
- the JpaMetamodelAccessor for this JPA vendor
- Since:
- 1.3.0
-
getJoinMappingPropertyNames(EntityType, String, String)
instead