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.
Empowered by the JPA 3.2
PersistenceConfigurationsupport (#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 asetPackagesToScanconfiguration method toLocalEntityManagerFactoryBeanas well - matching the common setup method onLocalContainerEntityManagerFactoryBeanandLocalSessionFactoryBean.This makes
LocalEntityManagerFactoryBeana sufficiently capable candidate for replacingLocalContainerEntityManagerFactoryBeanin 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 theLocalSessionFactoryBeanway of Hibernate bootstrapping, just under JPA conventions.