Mercurial > dive4elements > river
diff flys-backend/src/main/java/de/intevation/flys/App.java @ 168:86a1bd9cc50e
More Hibernate/JPA stuff
flys-backend/trunk@1458 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 11 Mar 2011 14:41:18 +0000 |
parents | a69b8494fcac |
children | 7929f4144d2f |
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/App.java Thu Mar 10 13:44:51 2011 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/App.java Fri Mar 11 14:41:18 2011 +0000 @@ -1,13 +1,37 @@ package de.intevation.flys; -/** - * Hello world! - * - */ +import org.hibernate.cfg.Configuration; + +import org.hibernate.SessionFactory; + +import de.intevation.flys.model.River; + +import org.hibernate.dialect.resolver.DialectFactory; + +import org.hibernate.dialect.Dialect; + public class App { - public static void main( String[] args ) + public static void main(String [] args) + throws Exception { - System.out.println( "Hello World!" ); + Configuration cfg = new Configuration(); + + System.err.println(cfg); + + cfg.addAnnotatedClass(River.class); + + String [] setupScript = cfg.generateSchemaCreationScript( + DialectFactory.constructDialect( + "org.hibernate.dialect.PostgreSQLDialect")); + + for (String line: setupScript) { + System.out.println(line); + } + + + //SessionFactory sessionFactory = cfg.buildSessionFactory(); + } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :