-->
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: Hibernate.cfg.xml
PostPosted: Mon Jul 31, 2006 7:46 pm 
Beginner
Beginner

Joined: Wed Mar 01, 2006 11:26 pm
Posts: 23
Hi

In the hibernate configuration xml document the <session-factorys> <mapping> tags have two elements associated with them. 'jar' and 'file'. Does anyone have any idea what they are used for or any example on how they should be used?

There seems to be no mention of this on the web, in the hibernate documentation or in the Manning book.


Thanks Chris


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 11:51 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
They're alternatives for resource="". There's also package and class attributes. jar and package and read all .hbm.xml files in the given jar or package. class reads mappings from the listed class' annotations. And file parses file just like resource, I think.

Note that these are all mutually exclusive. If a mapping line specifies resource, then none of the other attributes are used. All the relevant source code is in Configuration.java, and it's pretty easy to follow. I just glanced at it for this info, I haven't followed it in detail, so I may be making some incorrect assumptions.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 1:27 am 
Beginner
Beginner

Joined: Wed Mar 01, 2006 11:26 pm
Posts: 23
Hi tenwit

I have a look at the code and yes it is pretty easy to follw. thanks for pointing me in the right direction.

Thats a big help in solving an issue I have regarding an archticture issue. I notice the jar tag loops through the entire sourcxe structure in the jar an imports all of the mappings. This is a very neat trick.

Thanks

Chris


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 1:28 am 
Beginner
Beginner

Joined: Wed Mar 01, 2006 11:26 pm
Posts: 23
Hi tenwit

I hada look at the code and yes it is pretty easy to follw. thanks for pointing me in the right direction.

Thats a big help in solving an issue I have regarding an archticture issue. I notice the jar tag loops through the entire source structure in the jar an imports all of the mappings. This is a very neat trick.

Thanks

Chris


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.