문서의 이전 판입니다!
$CLASSPATH/META-INF/persistence.xml
파일이 존재한다고 가정한다.import java.util.HashMap; import org.hibernate.ejb.Ejb3Configuration; import org.hibernate.tool.hbm2ddl.SchemaExport; public class JPASchemaExport { public static void main(String[] args) { Ejb3Configuration cfg = new Ejb3Configuration(); HashMap<String, String> props = new HashMap<String, String>(); props.put("hibernate.format_sql", "true"); Ejb3Configuration configured = cfg.configure("퍼시스턴스유닛이름", props); SchemaExport se = new SchemaExport(configured.getHibernateConfiguration()); se.setDelimiter(";"); se.create(true, false); } }