Free subclass of nhibernate map in rc

I compiled a free nhibernate 1.0 rc with nhibernate 2.1 and had a few warnings after fixing the errors.

Fluent nhibernate tells me to use a separate subclass table instead of JoinSubclass.

Current mapping:

 public class ClientMap : ClassMap<Client>
{
    public ClientMap()
    {
        LazyLoad();
        Id(x => x.Id);

    //some boring stuff in between

     JoinedSubClass<Company>("Id", m =>
            {
                m.LazyLoad();
                m.Map(x => x.Name);
                m.Map(x => x.Form);
            });
}

      

Classes are inherited (company: customer).

I tried a new mapping like this:

    public class CompanyMap : SubclassMap<Company>
{
    CompanyMap()
    {
        LazyLoad();
        Map(x => x.Name);
        Map(x => x.Form);
    }
}

      

After this change I have no companies, I am not sure how hibernate knows correctly what to do. Before I say "look, I have this class and subclass that I give you right now in your mapping" and now: "Here are two views, draw yourself, thanks" :)

Any advice on how to adjust the fix for the new subclass?

Update: Now I figured out that this works for persisting data, but the fk id is not being written to the child. How do I match FK? The field name is Client_id as nhibernate expects fk .. field names.

+2
nhibernate fluent-nhibernate


source to share


No one has answered this question yet

Check out similar questions:

26
Inheritance using free NHibernate
24
Programming Interfaces When Mapped to Fluent NHibernate
eleven
Fluent NHibernate generates additional columns
4
What is the difference between Fluent Mapping and Auto mapping in Fluent NHibernate
3
Free NHibernate table for subclass inheritance mapping
2
Free NHibernate repository with subclasses
2
Free NHibernate inheritance mapping issue
2
Subclass Automation in Fluent NHibernate
0
How to quote field names in Fluent NHibernate 1.1
0
Finding the source of duplicate mappings in Fluent NHibernate



All Articles
Loading...
X
Show
Funny
Dev
Pics