You can use the embedded conventional automapping engine to define mappings for
your domain by giving it domain classes.
Then you can export it to hbm files as xml:
var model = new ModelMapper();
model.AddMappings(assembly.GetTypes());
var mappingsAsXmlString =
model.CompileMappingForAllExplicitlyAddedEntities().AsString();
Then you can write it to a file.
To export the ddl (database schema definition) you can use SchemaExport class:
var configuration = // build your NHibernate Configuration class
new SchemaExport(configuration).SetOutputFile("file.ddl").Execute(false,
true, false);
This will get you the DDL definition.
Hope this helps...
- Valeriu Caraulean
From: Murali Mohan
Sent: Friday, May 17, 2013 5:36 AM
To: [email protected]
Subject: [nhusers] Is there a tool to generate Map file using a Domain file
I have a domain class file. It has many child classes to define the complex
types. I don't have a database schema or tables. I want to store the objects
created using the domain class in to database. I was able to do this for single
class by creating the mapping file manually. I have nearly 100 child classes to
define the complex types. It is very hard to manually create the mappings for
each of the class. Is there any tool available to generate the map file and
database schema using Domain file? I have tried to use "NHibernate Mapping
Generator" But it needs the DB schema to generate the map file.
Thanks for reading the post..!!!
Murali
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.