- All Known Implementing Classes:
JpaTemplateImpl
public interface JpaTemplate
JpaTemplate relies on preview features of the Java platform:
JpaTemplaterefers to one or more preview APIs:StringTemplate.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A template backed by JPA.
-
Method Summary
Modifier and TypeMethodDescriptionstatic JpaTemplateof(jakarta.persistence.EntityManager entityManager) Creates a new JPA template for the given entity manager.static QueryTemplateORM(jakarta.persistence.EntityManager entityManager) Creates a new ORM template for the given entity manager.jakarta.persistence.Queryquery(StringTemplatePREVIEW template) Creates a query for the specified querytemplate.toORM()Returns an ORM template for this JPA template.withColumnNameResolver(ColumnNameResolver columnNameResolver) Returns a new JPA template with the specified column name resolver.withForeignKeyResolver(ForeignKeyResolver foreignKeyResolver) Returns a new JPA template with the specified foreign key resolver.withProviderFilter(Predicate<Provider> providerFilter) Returns a new JPA template with the specified provider filter.withTableAliasResolver(TableAliasResolver tableAliasResolver) Returns a new JPA template with the specified table alias resolver.withTableNameResolver(TableNameResolver tableNameResolver) Returns a new JPA template with the specified table name resolver.
-
Method Details
-
of
Creates a new JPA template for the given entity manager.- Parameters:
entityManager- the entity manager.- Returns:
- the JPA template.
-
ORM
Creates a new ORM template for the given entity manager.- Parameters:
entityManager- the entity manager.- Returns:
- the ORM template.
-
toORM
ORMTemplate toORM()Returns an ORM template for this JPA template. -
withTableNameResolver
Returns a new JPA template with the specified table name resolver.- Parameters:
tableNameResolver- the table name resolver.- Returns:
- a new JPA template.
-
withColumnNameResolver
Returns a new JPA template with the specified column name resolver.- Parameters:
columnNameResolver- the column name resolver.- Returns:
- a new JPA template.
-
withForeignKeyResolver
Returns a new JPA template with the specified foreign key resolver.- Parameters:
foreignKeyResolver- the foreign key resolver.- Returns:
- a new JPA template.
-
withTableAliasResolver
Returns a new JPA template with the specified table alias resolver.- Parameters:
tableAliasResolver- the table alias resolver.- Returns:
- a new JPA template.
-
withProviderFilter
Returns a new JPA template with the specified provider filter.- Parameters:
providerFilter- the provider filter.- Returns:
- a new JPA template.
-
query
Creates a query for the specified querytemplate.- Parameters:
template- the query template.- Returns:
- the query.
-
JpaTemplatewhen preview features are enabled.