sql - Nhibernate map several concrete classes from abstract class -
i'm new nhibernate , in project i'm working i'm using .hbm mappings.
as project itself, have several concrete classes based on single abstract class, below:
public mustinherit class networkbase property name string property id long ... end class public class networktype1 inherits networkbase property specificpropertytonetworktype1 string ... end class public class networktype2 inherits networkbase property specificpropertytonetworktype2 integer ... end class
the abstract class networkbase table on sql db, specificpropertytonetworktype1 , specificpropertytonetworktype2 properties in concrete classes should records, not fields, in table, each record identified specific code, along lines
networkid | propertyid | value 1001 1 lorem 1002 53 11
networkid 1001 should of concrete type networktype1, , 'lorem' value should loaded on specificpropertytonetworktype1, while networkid 1002 of concrete type networktype2 , 11 should point specificpropertytonetworktype2. propertyid values have reference table have 1 = 'specificpropertytonetworktype1' , 53 'specificpropertytonetworktype2'
now, big question comes to, how make mapping? know basics of mapping abstract class, not how make records reflect properties. ideas?
Comments
Post a Comment