Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- */
- package br.com.dashboard.banco;
- import org.hibernate.cfg.AnnotationConfiguration;
- import org.hibernate.tool.hbm2ddl.SchemaExport;
- import br.com.dashboard.util.BancosDados;
- /**
- * @author David A. Pitanguy
- * @author Rogerio Santos
- *
- * @since 19/11/2009
- */
- public class GerarBanco {
- /**
- * Método utilizado para gerar todo o script estrutural do banco.
- *
- * @param args
- */
- public static void main(String[] args) {
- //cria uma configuração
- AnnotationConfiguration configuration = new AnnotationConfiguration();
- //lê hibernate.cfg.xml por padrão
- // configuration.configure();
- configuration.configure(BancosDados.DASH.getArquivo());
- SchemaExport se = new SchemaExport(configuration);
- //primeiro boolean indica se vc qr imprimir o sql gerado
- //segundo boolean indica se vc qr executa-lo
- se.create(true, false);
- }
- }
Add Comment
Please, Sign In to add comment