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
Nested Classes Modifier and Type Interface Description static class
JpaProvider.ConstraintType
The possible locations of a constraint. -
Method Summary
Modifier and Type Method Description boolean
containsEntity(javax.persistence.EntityManager em, Class<?> entityClass, Object id)
Returns whether the entity with the id is contained in the entity managers persistence context.String
escapeCharacter(char character)
The given escape character for a LIKE predicate as string.String
getBooleanConditionalExpression(boolean value)
The JPQL conditional expression to use for the given literal boolean value.String
getBooleanExpression(boolean value)
The JPQL expression to use for the given literal boolean value.String
getCollectionValueFunction()
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.String
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<?>
getDefaultQueryResultType()
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.Object
getIdentifier(Object entity)
Returns the identifier of the entity object.List<String>
getIdentifierOrUniqueKeyEmbeddedPropertyNames(javax.persistence.metamodel.EntityType<?> owner, String attributeName)
Deprecated.List<String>
getIdentifierOrUniqueKeyEmbeddedPropertyNames(javax.persistence.metamodel.EntityType<?> owner, String elementCollectionPath, String attributeName)
Deprecated.Map<String,String>
getJoinMappingPropertyNames(javax.persistence.metamodel.EntityType<?> owner, String elementCollectionPath, String attributeName)
Returns the join mapping property names of an association attribute.JoinTable
getJoinTable(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName)
If the given attribute is a collection that uses a join table, returns it's descriptor.JpaMetamodelAccessor
getJpaMetamodelAccessor()
Returns the JpaMetamodelAccessor for this JPA vendor.String
getMappedBy(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName)
If the given attribute is an inverse collection, the mapped by attribute name is returned.String
getNullExpression()
The JPQL expression to use for the NULL literal.String
getOnClause()
The name of the clause that has the same semantics as the ON clause which was introduced in JPA 2.1.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.boolean
hasJoinCondition(javax.persistence.metamodel.ManagedType<?> ownerType, String elementCollectionPath, String attributeName)
Whether the given attribute has a join condition.boolean
isBag(javax.persistence.metamodel.EntityType<?> ownerType, String attributeName)
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
needsAssociationToIdRewriteInOnClause()
Indicates if the provider needs associations in the ON clause to use their id.boolean
needsBracketsForListParameter()
Whether brackets are needed around a list parameter.boolean
needsBrokenAssociationToIdRewriteInOnClause()
Indicates if the provider needs associations in the ON clause to use their id.boolean
needsCaseWhenElseBranch()
Indicates whether the provider always requires an else branch in a case when expression.boolean
needsCorrelationPredicateWhenCorrelatingWithWhereClause()
Indicates whether the provider supports correlating inverse associations.boolean
needsElementCollectionIdCutoff()
Indicates whether the provider needs to cutoff id properties when used as subpath of element collections.boolean
needsJoinSubqueryRewrite()
Returns whether key restricted left joins should be rewritten to subquery joins.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.boolean
needsUnproxyForFieldAccess()
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.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.void
setCacheable(javax.persistence.Query query)
Enables query result caching for the given query.boolean
supportsCollectionTableCleanupOnDelete()
Indicates whether the provider clears collection table entries on bulk delete operations.boolean
supportsCollectionValueDereference()
Whether dereferencing a VALUE function expression is supported by the JPA provider.boolean
supportsCountStar()
Whether theCOUNT(*)
syntax is supported.boolean
supportsCustomFunctions()
Whether the custom functions are supported.boolean
supportsEntityJoin()
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
supportsForeignAssociationInOnClause()
Indicates if the provider supports the use of foreign associations in the ON clause.boolean
supportsGroupByEntityAlias()
Indicates whether the provider supports group by entity alias properly.boolean
supportsInsertStatement()
Whether Insert statements are supported.boolean
supportsJoinTableCleanupOnDelete()
Indicates whether the provider clears join table entries on bulk delete operations.boolean
supportsJpa21()
Whether JPA 2.1 specification is supported.boolean
supportsNonDrivingAliasInOnClause()
Whether the JPA provider supports the use of an alias other than the driving alias in the ON clause.boolean
supportsNonScalarSubquery()
Whether the non scalar subqueries are supported.boolean
supportsNullPrecedenceExpression()
Whether the query language supports the null precedence clause.boolean
supportsProxyParameterForNonPkAssociation()
Whether the JPA provider supports the use of an entity proxy as parameter for a non primary key association.boolean
supportsRootTreat()
Whether treating a from/root alias is supported.boolean
supportsRootTreatJoin()
Whether a root treat in a join is supported.boolean
supportsRootTreatTreatJoin()
Whether a root treat in a treat join is supported.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.boolean
supportsSingleValuedAssociationIdExpressions()
Indicates if the provider supports expressions like doc.owner.id without generating an extra join.boolean
supportsSingleValuedAssociationNaturalIdExpressions()
Indicates whether the provider supports optimized natural id access.boolean
supportsSubqueryAliasShadowing()
Whether the subqueries alias shadowing is supported.boolean
supportsSubqueryInFunction()
Whether the subqueries in functions are supported.boolean
supportsSubtypePropertyResolving()
Whether properties accessed of a from node are implicitly resolved to properties of a subtype of the from node.boolean
supportsSubtypeRelationResolving()
Whether relations of a from node in joins are implicitly resolved to the relations of a subtype of the from node.boolean
supportsTemporalLiteral()
Whether the JPA provider supports the temporal literal.boolean
supportsTransientEntityAsParameter()
Indicates if the provider supports the use of transient entity objects as parameters.boolean
supportsTreatCorrelation()
Whether a correlation path with a treat expression is supported.boolean
supportsTreatJoin()
Whether a treat join is supported.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.boolean
supportsUpdateSetEmbeddable()
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
-
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
-
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
-
isColumnShared
Whether columns for the given attribute are shared between multiple subtypes or shared by occupying the same slot in the resulting SQL.- Parameters:
ownerType
- The owner of the attributeattributeName
- The attribute name to check- Returns:
- True if columns of the attribute are shared, 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
boolean isOrphanRemoval(javax.persistence.metamodel.ManagedType<?> ownerType, String attributeName)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
-
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
-
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
-