I\'m working with Hibernate. How can I configure my persistence.xml to have an H2 in-memory database?
My persistence.xml is:
You should set hibernate.hbm2ddl.auto property to "create" the first time you run your application, to create the tables
and then (if you don't want the tables to be recreated and emptied every time you start) set it to "validate".
To create the schema automatically, add if-not-exists to your connection url like this: