Hello,

What I have to change in the mapping below to have a bidirectionnal 
relation ? I'd like when I have a "ProductDetail" object have access to 
"Product" at this time Product properties is always null when I get a 
ProductDetail.

Thanks,


public class ProductMap : ClassMap<Product>
{
public ProductMap()
{
Id(x => x.Id).GeneratedBy.Native();
Map(x => x.Code)
.Length(20)
.Unique()
.Not.Nullable();
Map(x => x.CreationDate).Not.Nullable();

HasManyToMany(x => x.Details)
.AsSet()
.Cascade
.SaveUpdate()
.Table("ProductsProductsDetails");
}
}

class ProductDetailMap : ClassMap<ProductDetailDb>
{
public ProductDetailMap()
{
Table("ProductDetail");
Id(x => x.Id).GeneratedBy.Native();
Map(x => x.Name)
.Length(150)
.Not.Nullable();
References(x => x.Language)
.Columns("LanguageId")
.Not.Nullable();
 HasManyToMany(x => x.Products)
.AsSet()
.Inverse()
.Table("ProductsProductsDetails");
}
}

-- 
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.


Reply via email to