An association from the table X refers to an unmapped class, but class is mapped

30 views
Skip to first unread message

Konstantin Tkachenko

unread,
Feb 27, 2020, 10:53:40 AM2/27/20
to nhusers
I have issues mapping a class hierarchy:

namespace Tasks{
public class CapacityRequirement : DomainBase
    {
        public virtual Guid Id { get; set; }
...
        public virtual Resslist Resource { get; set; }
    }

public class PartRequirement: DomainBase
    {
        public virtual Guid Id { get; set; }

                public virtual Matart Part { get; set; }

        public virtual Mapark Machine { get; set; }
...
    }


public class WorkPackage : DomainBase
    {
        public virtual Guid Id { get; set; }

        public virtual IList<CapacityRequirement> CapacityRequirements { get; set; } = new List<CapacityRequirement>();

        public virtual IList<PartRequirement> Parts { get; set; } = new List<PartRequirement>();
...
    }
}


The Classes Resslist, Matart and Mapark are already mapped.
I'm trying to make two indexed lists in uni-directional one-to-many.

For some reason I'm getting An association from the table fst_Part_Requirements refers to an unmapped class:
Mapark
but class is mapped.


What does work:
 * Removing mapping for second collection (PartRequirements) from WorkPackage-Mapping.
 * Removing all many-to-ones from PartRequirement and CapacityRequirement. (If I only remove all many-to-ones from PartRequirement, then the CapacityRequirement class wont compile).

It looks for me as a bug...

Did someone had such an issue?

Should I start debugging NHibernate?

Best regards,

Konstantin
Reply all
Reply to author
Forward
0 new messages