One of my Twitter followers asked me if there is any documentation for bootstrapping JPA programmatically so that we can replace the
persistence.xml configuration file with a Java configuration:
Hey @vlad_mihalcea is there a way in which persistence.xml file can be replaced with Java config class? Any documentation related to this would be really helpful.— Shyam Baitmangalkar (@SBaitmangalkar) November 28, 2017
Previously, I wrote an article about bootstrapping Hibernate without the
persistence.xml, but that solution was based on the Hibernate-specific
In this article, I’m going to give you a solution that works with any JPA provider since it’s based on standard Java Persistence API.