Is it possible to create a database schema from nHibernate where I provided the nHibernate configuration to the database, but I did not write any mappings.
I want to get database metadata / schema programmatically.
I am using an Oracle database. I tried two approaches:
Approach one:
public DatabaseMetadata GetMetadata(DbConnection connectionIn)
{
return new DatabaseMetadata(connectionIn, _dialect);
}
Problem: It seems to me that this is really what I need, although it connects correctly, it does not pick up any of my tables. All I provided was an nHibernate configuration object that was populated with the contents of my nHibernate.xml.config file (connection string, driver client, etc.).
Question: Why not return table data to him? It is connected correctly, but finds nothing!
Approach to two:
public void DatabaseSchema()
{
var schema = new SchemaExport(nHibernateConfiguration);
schema.SetOutputFile("schema.dll");
schema.Create(true, true);
}
nHibernateConfiguration - ( ) nHibernate, nHibernate.xml.config.
: . :
NHibernate.MappingException:
, ? . , , , .
: , , ? , ?
, , , .
.
: , , .