Commit b9694c89 by Anssi Kolehmainen

Attempt to add .sql autocreator in Maven test phase

mvn test-compile exec:java -Dexec.mainClass=fi.codecrew.moya.DBCreator -Dexec.classpathScope=test
1 parent 75ca5685
......@@ -15,7 +15,7 @@
<property name="eclipselink.target-server" value="Glassfish" />
<property name="eclipselink.session.customizer"
value="fi.codecrew.moya.database.eclipselink.MoyaSessionCustomizer" />
<property name="eclipselink.ddl-generation" value="none"/>
<property name="eclipselink.ddl-generation" value="create-tables"/>
<property name="eclipselink.ddl-generation.output-mode" value="sql-script"/>
</properties>
......
package fi.codecrew.moya;
import javax.persistence.Persistence;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;
// import org.springframework.context.support.ClassPathXmlApplicationContext;
public class DBCreator {
public static void main(String[] foo) {
generateSQLFiles();
}
public static void generateSQLFiles() {
EntityManagerFactory testEmf;
EntityManager testEm;
testEmf = Persistence.createEntityManagerFactory("MoyaDb");
testEm = testEmf.createEntityManager();
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!