fix: wrong model package name [ BAEL-5987 ] (#13268)

* feat: add jpa - spring data difference examples

* fix: remove _ from package name

* fix: model package name
This commit is contained in:
lucaCambi77 2023-01-10 02:55:06 +01:00 committed by GitHub
parent c3a0a729db
commit 03778c8f21
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.baeldung.spring.data.persistence.springdatajpadifference.model.Employee;
import com.baeldung.spring.data.persistence.springdatajpadifference.springdata.repository.EmployeeRepository;
import com.querydsl.jpa.impl.JPAQueryFactory;
@ -28,7 +29,8 @@ public class SpringDataJpaConfig {
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource);
em.setPackagesToScan("com.baeldung.spring.data.persistence.springdata_jpa_difference.model");
em.setPackagesToScan(Employee.class.getPackage()
.getName());
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);