tags:

views:

212

answers:

1

Hello All,

I am new to NHibernate.I created a database in my sqlserver and want to export the schema using Nhibernate in c#.I have two classes called Customer and Address. customer.cs
public class Customer { public int ID {get; set;} public Address Address1 { get; set; } public Address Address2{get;set;} }

Address.cs public class Address { public string City{get;set;} public string Postcode{get;set;}

}

and I have written customer.hbm.xml .In that i defined addresses as Component.

can anybody tell me how to export the schema when my classes are like this?

Thanks in advance

A: 

You can use SchemaExport class to export SQL schema.

new SchemaExport(cfg).create(false, true);
idursun
I used SchemExport for this to be done.But i am not getting the component (address) values as fields
then there is a problem with the mapping file. it could help if you have included your mapping file as well.
idursun