comparison 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
comparison
equal deleted inserted replaced
167:15d515fe15f5 168:86a1bd9cc50e
1 package de.intevation.flys; 1 package de.intevation.flys;
2 2
3 /** 3 import org.hibernate.cfg.Configuration;
4 * Hello world! 4
5 * 5 import org.hibernate.SessionFactory;
6 */ 6
7 import de.intevation.flys.model.River;
8
9 import org.hibernate.dialect.resolver.DialectFactory;
10
11 import org.hibernate.dialect.Dialect;
12
7 public class App 13 public class App
8 { 14 {
9 public static void main( String[] args ) 15 public static void main(String [] args)
16 throws Exception
10 { 17 {
11 System.out.println( "Hello World!" ); 18 Configuration cfg = new Configuration();
19
20 System.err.println(cfg);
21
22 cfg.addAnnotatedClass(River.class);
23
24 String [] setupScript = cfg.generateSchemaCreationScript(
25 DialectFactory.constructDialect(
26 "org.hibernate.dialect.PostgreSQLDialect"));
27
28 for (String line: setupScript) {
29 System.out.println(line);
30 }
31
32
33 //SessionFactory sessionFactory = cfg.buildSessionFactory();
34
12 } 35 }
13 } 36 }
37 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org