Reputation: 43053
JPA gurus, let say I have the following entity :
@Entity
class MyEntity {
@Id
private Long id;
// setters and getters here
}
through JPA on an Oracle database something similar would be generated :
CREATE TABLE MyEntity {
-- table definition generated by JPA provider goes here
}
How can I get the code generated by the JPA provider ?
If it's not possible to get the sql code in a standard way defined by JPA,
how can I achieve this with Hibernate 3.6.8.Final
or greater ?
Upvotes: 0
Views: 516
Reputation: 15086
Look at classes in hbm2ddl package
http://docs.jboss.org/hibernate/orm/3.6/javadocs/org/hibernate/tool/hbm2ddl/package-summary.html
Especially SchemaExport class.
Upvotes: 1
Reputation: 47300
<property name="show_sql">true</property>
In hibernate config
Upvotes: 0