Creating JPA objects with IntelliJ without persistence.xml or orm.xml

Is there a way to create JPA objects with IntelliJ without the persistence.xml file? Or, basically, does IntelliJ recognize a persistance device from Java Config? I have an existing (deprecated) schema and the project is being overwritten, now using Java Config in Spring Boot. In the Spring Boot documents, the save block will be created by code:

@Bean public LocalContainerEntityManagerFactoryBean customerEntityManagerFactory( EntityManagerFactoryBuilder builder) { return builder .dataSource(dataSource()) .packages(com.abc.DomainThing.class) .persistenceUnit("abc") .build(); } 
+6
source share
1 answer

I solved this by having the persistence.xml file in the project and did not use the code or checked. It just makes the IDE happy, and I can bind the data source to it to get the help of the DB schema in JPA Entity classes.

+1
source

All Articles