readthefuckingmanual.net

[SOLVED] Initial SessionFactory creation failed.org.hibernate.MappingException: Association references unmapped class

Error added: 2008-02-27T14:04:52Z

1 people waiting for the answer...

4 answers found.

Answer 877 (60.0% helpful)

One mistake to get this Exception can be if the fullqualified name for the Java Class is not set properly for the class attribute. E.g. for a Class with the fullqualified name packg.name.SomeClass the correct mapping would look like this
<one-to-many class=\"packg.name.SomeClass\"/>
if the fullqualified name is not correct set (e.g. only ClassName without package, ...), this Exception occurs
Permalink

Answer 1982 (50.0% helpful)

@ManyToOne
    @JoinColumns({
        @JoinColumn(name="aaa", referencedColumnName = "bbb", insertable=false, updatable=false),
        @JoinColumn(name="ccc", referencedColumnName = "ddd", insertable=false, updatable=false)
    })
Permalink

Answer 1006 (36.363636% helpful)

also check to see if you have your seperate hbm.xml file defined in the master hbm.xml file
Permalink

Answer 1184 (33.333332% helpful)

It\'s a solution for NHibernate and Visual Studio, but maybe it could be helpful:

Look at the properties of YourClass.hbm.xml.
Set the \'Build Action\' property to \'Embedded Resource\'.
Permalink

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.


Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: