Reputation: 1
I am a biginner in NHibernate. I have already created Database tables using NHibernate mapping. Now I want change one of my Table Name and Column Name. I am unable to found the way to change the Table Name.
Please help me to resolve this issue.
Thanks in Advance.
Upvotes: 0
Views: 840
Reputation: 463
NHibernate itself can generate some schema creation SQL but it does not generate SQL to alter the schema from the current configuration. George's answer applies to where the database schema is required to remain the same and NHibernate is used to map to that schema.
If you are looking to modify the schema throughout development you are probably looking for a tool like Fluent Migrator.
Upvotes: 0
Reputation:
What you need is something like this:
public class MyClassMap : ClassMap<MyClass>
{
public MyClassMap()
{
Table("MyFancyClassTableName");
Id(x => x.MyClassId);
Map(x => x.MyClassType);
}
}
Upvotes: 1