Skip to content

Add setPackagesToScan configuration method to LocalEntityManagerFactoryBean #36270

@jhoeller

Description

@jhoeller

Empowered by the JPA 3.2 PersistenceConfiguration support (#35662; see #31157 (comment)) and inspired by recent efforts in JPA 4.0 around the discoverability of provider-annotated types and packages (see 05ffe82 within #35705), we can add a setPackagesToScan configuration method to LocalEntityManagerFactoryBean as well - matching the common setup method on LocalContainerEntityManagerFactoryBean and LocalSessionFactoryBean.

This makes LocalEntityManagerFactoryBean a sufficiently capable candidate for replacing LocalContainerEntityManagerFactoryBean in common setups. It lacks load-time weaving support (which is only available in the JPA container bootstrap contract, not the "Java SE" standalone bootstrap mode) but is notably closely aligned with the LocalSessionFactoryBean way of Hibernate bootstrapping, just under JPA conventions.

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions