-->
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.  [ 3 posts ] 
Author Message
 Post subject: Auto discovery of annotated classes?
PostPosted: Tue Mar 27, 2007 7:27 am 
Newbie

Joined: Tue Mar 27, 2007 7:17 am
Posts: 2
Do I have to create a <mapping.../> for each class within <session-factory...> in my hibernate.cfg.xml or is there a way to specify a directory tree that will be scanned for annotated classes automatically?


Also,

While googling for a possible answer I came across AnnotationSessionFactoryBean (part of the Spring 2 framework) is it essential to use this when using annotated classes with Spring, and if not, is it advisable and why?


Cheers,

Ciaron.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 9:44 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
To get the discovery mechanism, you need to use Hibernate EntityManager which implements the Java Persistence standard discovery mechanism.
Otherwise you need to list your classes.

As for Spring, I don't know, I work without it.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 9:58 am 
Newbie

Joined: Tue Mar 27, 2007 7:17 am
Posts: 2
Cheers for the reply!

emmanuel wrote:
To get the discovery mechanism, you need to use
Hibernate EntityManager


Has the SessionFactory been superceded by the EntityManager? i.e. should I be using the latter on new projects?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.