Code example for SchemaExport

Methods: createsetOutputFile

0
	@Override 
	public void createTables(final String persistenceUnitName, final Map<String, Object> configOverwrites)
	{ 
		final Ejb3Configuration cfg = new Ejb3Configuration();
		cfg.configure(persistenceUnitName, configOverwrites);
		final SchemaExport schemaExport = new SchemaExport(cfg.getHibernateConfiguration());
		schemaExport.setOutputFile("schema.sql");
		schemaExport.create(true, true);
	} 
 
	@Override 
	public void updateTables(String persistenceUnitName, final Map<String, Object> configOverwrites)
	{ 
		final Ejb3Configuration cfg = new Ejb3Configuration();
		cfg.configure(persistenceUnitName, configOverwrites);
		final SchemaUpdate schemaUpdate = new SchemaUpdate(cfg.getHibernateConfiguration());
		schemaUpdate.setOutputFile("schema.sql");
		schemaUpdate.execute(true, true);
	} 
 
Connect your IDE to all the code out there  Get Codota for Java