1 package ejava.examples.schemagen;
2
3 import javax.persistence.Persistence;
4
5 public class JPASchemaGen {
6 public static void main(String args[]) {
7 if (args!=null && args.length==1) {
8 System.out.println("Generating schema for persistence-unit: " + args[0]);
9
10 Persistence.createEntityManagerFactory(args[0]);
11 System.exit(0);
12 } else {
13 System.err.println("usage: " + JPASchemaGen.class.getName() + " (persistenceUnit name)");
14 throw new RuntimeException("incorrect usage");
15 }
16 }
17 }