DB initialization: Where to put java class that salts password?
I've got a web application deployed as a WAR. I'm using hibernate. My SQL DDL populates the database upon web application startup via persistence.xml e.g.
<property name="javax.persistence.sql-load-script-source" value="01_bootstrap.sql"/>
Next, I will need to salt the passwords. I assume that I should create a simple Java utility class that is run with the web app's compiled classes in its class path so that I can use the web application's code to salt the passwords. How should I proceed in Intellij to do this? Should I create a new module or a new project altogether? I'm attaching three files: BootstrapAdminPassword.java, HibernateUtil.java, and hibernate.cfg.xml that I used in the past to salt the passwords from the command line. I would like to do it in Intellij by right clicking BootstrapAdminPassword and selecting "Run BootstrapAdminPassword."
Attachment(s):
hibernate.cfg.xml
HibernateUtil.java.zip
BootstrapAdminPassword.java.zip
Please sign in to leave a comment.