JpaPersistModule, Hibernate and URL Variables

2018-02-14 Thread Evan Ruff
Hey guys, I've got what I think is a pretty straightforward task but I'm having a little issue figuring out where to attach in my code. I've got an embedded H2 database being used in an installed application to manage state of some objects. I'm using Hibernate as my JPA implementation and

Re: JpaPersistModule, Hibernate and URL Variables

2018-02-14 Thread Stephan Classen
When are you passing this string? Is it part of you Giuce Module?? Could you read the environment variable before creating the string and than manually create the URL string? On 14.02.2018 11:38, Evan Ruff wrote: Hey guys, I've got what I think is a pretty straightforward task but I'm

Re: JpaPersistModule, Hibernate and URL Variables

2018-02-14 Thread Sondre Bjornebekk
If you always want to use h2, you could just simply build the string using https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#getenv--? If you wanted to inject different JPA providers, you could certainly use Guice for that (since you posted here) - I have a HibernateSessionFactory

Re: JpaPersistModule, Hibernate and URL Variables

2018-02-14 Thread Stephan Classen
Maybe you can make your path relative to the user directory as described here: http://www.h2database.com/html/faq.html#database_files Am 14. Februar 2018 21:06:34 MEZ schrieb Evan Ruff : >Hey guys, > >So I'm actually just letting Guice Persist pull it straight out of

Re: JpaPersistModule, Hibernate and URL Variables

2018-02-14 Thread Evan Ruff
Hey guys, So I'm actually just letting Guice Persist pull it straight out of META-INF/persistence.xml file. I'm wondering where I can either change the URL or set it explicitly, while still using Guice Persist. thanks! E On Wednesday, February 14, 2018 at 10:58:11 AM UTC-5, Sondre