I am setting up a SeedStack batch application and I am trying to use JPA without persistence.xml, but automatic JPA detection classes.
However, I had theses exceptions:
HHH000318: Could not find any META-INF/persistence.xml file in the classpath
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named myUnit
I have this properties in application.yaml:
# This configuration file can override main configuration for integration tests
jdbc:
datasources:
myDatasource:
provider: org.seedstack.jdbc.internal.datasource.HikariDataSourceProvider
url: jdbc:postgresql://localhost:5432/CNVT
user: postgres
password : admin
jpa:
units:
myUnit:
properties:
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
hibernate.hbm2ddl.auto: update
classes:
org:
generated:
project:
domain:
model:
jpaUnit: myUnit
Also, when I add a persistence.xml, the JPA unit is created:
o.h.e.t.j.p.i.JtaPlatformInitiator HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
org.seedstack.jpa.internal.JpaPlugin Creating JPA unit myUnit from persistence.xml
org.seedstack.jpa.internal.JpaPlugin Created 1 JPA unit(s)
But, I had this exception:
org.seedstack.seed.SeedException: [SPRING] No spring entitymanager
I would like to use JPA with SeedStack properly without having to do a persistence.xml.