Hi,
there are several ways to do that, depending on what you are trying to achieve.
You can add the property
hbm2ddl.auto to your hibernate configuration file and set it to
create. This way the schema gets generated whenever Hibernate starts.
You can also do it programmatically:
Code:
AnnotationConfiguration config = new AnnotationConfiguration();
config.addAnnotatedClass(Foo.class);
...
config.buildSessionFactory();
String[] schema = config.generateSchemaCreationScript(new MyDialect());
Last but not least you can generate the schema as part of the build using ant or some Eclipse Hibernate plugin.
--Hardy