Package org.hibernate.cfg

Examples of org.hibernate.cfg.AnnotationConfiguration.generateDropSchemaScript()


      // Configure with our current persistence unit
      final Ejb3Configuration ejb3Configuration = new Ejb3Configuration().configure("ejbca-pu", null);
      final AnnotationConfiguration hibernateConfiguration = ejb3Configuration.getHibernateConfiguration();
    try {
      // Create drop script
        final String[] dropScript = hibernateConfiguration.generateDropSchemaScript(Dialect.getDialect(ejb3Configuration.getProperties()));
      StringBuilder sb = new StringBuilder();
      for (String line : dropScript) {
        sb.append(line);
        sb.append(";\n");
      }
View Full Code Here


        } catch (SQLException e) {
          throw new HibernateException(e);
        }
      } else {
        writer.println("/* full drop-and-create script */");
        printSQL(writer, hibernateConfig.generateDropSchemaScript(settings.getDialect()));
        printSQL(writer, hibernateConfig.generateSchemaCreationScript(settings.getDialect()));
      }
    } catch (HibernateException e) {
      writer.println("Error: unable to connect to the database.\n");
      e.printStackTrace(writer);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.