nhibernate - reading from multiple databases in one class -
im newbee nhibernate , following.
i have 2 classes classa, classb, many-to-one relation table data classa not in same database table data classb.
classa { public int id {get; set;} public string name {get; set;} public int classb_id {get; set;} } classb { public int id {get; set;} public string somethingelse {get; set;} }
my mapping
<class name="classa" table="classatable"> <id name="id"> <generator class="native" /> </id> <property name="name" /> <many-to-one name="classb" column="classbid" /> </class>
is possible using nhibernate create mapping can readed selecting first databasea, after databaseb ? cannot find solution how set configuration, works.
if have helpfull links, please let me know !
thanks !
nhibernate not support cross-db object graphs. cannot create association between classs , b when , b live on different dbs. way this, define property on classa uniquely identifies object of classb, , use property load classb
Comments
Post a Comment