I'm in a legacy context.
I have an abstract unmapped class Az that define a composite-id KAz
(with 2 columns KAz1 and KAz2).
I have two descendant from Az: Lz and Sz. Lz and Sz have different
mapping because I can't apply any of the 3 mapping inheritance strategies.
The table of Lz instances is called TableLz and the table of Sz entities
is called TableSz.
I haved mapped the composite-id of Lz as:

            Table("TableLz");           
            ComponentAsId(x => x.Id, pk =>
            {
                pk.Class<KAz>();
                pk.Property(x => x.KAz1, m => m.Column("KAz1"));
                pk.Property(x => x.KAz1, m => m.Column("KAz2"));
            });

I haved mapped the composite-id of Sz as:
            Table("TableSz");   
            ComponentAsId(x => x.Id, pk =>
            {
                pk.Class<KAz>();
                pk.Property(x => x.KAz1, m => m.Column("KAz1"));
                pk.Property(x => x.KAz1, m => m.Column("KSz"));
            });

The behavior that I have encountered is that when NH retrieve instances
of type Sz I see this wrong sql statement:

select t.KAz1 as id1, t.KAz2 as id2,... from TableSz ...

It's seems that the mapping of composite-id is cached by class type.
It's this intended behavior or as bug?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to