I've been looking at the docs, but it seems like you have to use java-tools to create schemata. I've also tried searching this forum, but couldn't find a post dealing with this.
I'm writing a blog and would like to do this (Pseudo-code):
Code:
ISession session = NHibernateHelper.GetCurrentSession();
ITransaction tx = session.BeginTransaction();
Blog blog = new Blog();
blog.Name = "My Own Blog";
blog.TablePrefix = "blog_";
...
blog.AnotherProperty = "this and that";
session.Save( blog );
try {
//creates a couple of new tables based on the prefix - how do I make it create these tables?
//Perhaps I could write the mapping xml files and somehow make them give the meta data needed to create this new blog in the database?
tx.Commit();
}
catch {
trans.Rollback();
}
finally {
NHibernateHelper.CloseSession();
}
Hence, my question is; How do I make NHibernate create the tables for me? Either being able to create tables with customized naming, or create tables after the mapping files?
Hibernate version:
1.2.x.x
Mapping documents:
Entry, IPerson, Category, Comment, MembershipUser, Profile etc...
Name and version of the database you are using:
MySQL, but it should just be a setting in the web.config.