nhibernate - Component referencing an Entity. not being loaded -


i have following mapping, issue emailtemplate not being loaded eagerly , being set null when retreiving user. can guide me or perhaps refer me material. spent long hours searching , nothing yeilded.

usermap

    public usermap()     {         id(x => x.id);          component(x => x.state, y =>         {             y.map(x => x.name);             y.map(x => x.surname);             y.references(x => x.emailtemplate).not.lazyload();         });     } 

edit: emailtemplate

    public  class emailtemplate:entity     {              public virtual string subject { get; set; }         public virtual string body { get; set; }         public virtual icollection<user> users { get; set; }     }   

emailtemplatemap

    public emailtemplatemap()     {         id(x => x.id);         map(x => x.subject);         map(x => x.body);         hasmany(x => x.users).inverse();     } 

state

    public class state : valueobject<state>     {         public virtual string state { get; set; }         public virtual emailtemplate emailtemplate { get; set; }     } 

user

    public class user:entity     {         public virtual string name  { get; set; }         public virtual string surname { get; set; }         public virtual state state { get; protected set; }     } 


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -