-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Can't use additional mapping files in hibernate config
PostPosted: Tue Mar 17, 2009 10:46 pm 
Newbie

Joined: Mon Mar 15, 2004 5:48 am
Posts: 9
I am using Hibernate Tools 3.4.CR2. I am using Hibernate annotations in my code but I have the class "<mapping resource=..." in two separate files so that the main hibernate.cfg.xml has no classes listed.

When I add the additional files to the configuration on the Mappings tab, I end up with no classes listed under the session factory. However when I create a consolidated hibernate.cfg.xml with all the annotated classes identified in the same file it works like a charm.

I really would like to use the separate mapping files so I don't have to maintain an additional file just for hibernate tools. Is this possible?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 19, 2009 9:11 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
sorry I don't follow - are you saying that none of the mapping files added on the mappings tab shows up or ?

btw. why do you spread out the two files - just curious ?

if you used Hibernate Entitymanager you would not need to list anything since it supports auto scanning of entities and hbm.xml.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 22, 2009 11:52 pm 
Newbie

Joined: Mon Mar 15, 2004 5:48 am
Posts: 9
max wrote:
sorry I don't follow - are you saying that none of the mapping files added on the mappings tab shows up or ?

btw. why do you spread out the two files - just curious ?

if you used Hibernate Entitymanager you would not need to list anything since it supports auto scanning of entities and hbm.xml.


There are three parts to this:
- application war file
- application model jar file
- common muli-application model jar file

Each of the two jar files has its own hbm.xml that just lists the classes it provides.

I can add these files in the hibernate tools but it just doesn't seem to use them. I end up with no entity classes available in the list. Yet when we load these files from application code it all works fine.

The only way I have been able to get it to work is to combine the lists of classes into one hibernate.cfg.xml and then hibernate tools is happy.


Top
 Profile  
 
 Post subject: Re: Can't use additional mapping files in hibernate config
PostPosted: Tue May 05, 2009 7:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
please report a bug with the simplest example that makes this fail.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.