@Override public void exec(CLIContext cli, String[] args) throws Exception { String filename = "-"; // defaults to stdout ' String configModifier = null; boolean create = false; if (args.length > 1) filename = args[1]; if (args.length > 2) create = "yes".equalsIgnoreCase(args[2]) || "true".equalsIgnoreCase(args[2]); if (args.length > 3) configModifier = args[3]; try (DB db = new DB(configModifier)) { db.open(); db.beginTransaction(); db.createSchema(filename, create); } } }
private void createSchema () throws HibernateException, DocumentException { DB db = new DB(); db.open(); db.beginTransaction(); db.createSchema(null, true); db.commit(); db.close(); }
@BeforeClass public static void setUp() throws DocumentException { try (DB db = new DB()) { db.createSchema(null, true); } }
@Before public void setUp() throws Exception { db = new DB(); db.createSchema("schema.sql", true); db.open(); }