Tuesday, 15 February 2011

hibernate - An association from the table refers to an unmapped class: System.Decimal -



hibernate - An association from the table refers to an unmapped class: System.Decimal -

there linkvalues accociated decimal value.

public class { public int id { get; set; } public list<decimal> linkvalues { get; set; } } public class amap : classmap<a> { public amap() { id(x => x.id).column("a_id"); hasmanytomany<decimal>(x => x.links) .table("a_link_value_map") .parentkeycolumn("a_id") .childkeycolumn("link_value") .cascade.saveupdate(); } }

i getting issue "an association table a_link_value_map refers unmapped class: system.decimal". have thought or please give thoughts same.

the mapping hasmanytomany expect have entity/object not valuetype - on other side of many-to-many. many-to-many reuires pairing table.

the mapping need here hasmany , valuetype decimal need .element() mapping:

hasmany(x => x.links) .table("a_link_value_map") .keycolumn("a_id") .element("link_value") // value type element .cascade.saveupdate();

hibernate nhibernate orm fluent-nhibernate fluent-nhibernate-mapping

No comments:

Post a Comment