aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate annotation configuration for multiple annotated classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate annotation configuration for multiple annotated classes" Watch "Hibernate annotation configuration for multiple annotated classes" New topic
Author

Hibernate annotation configuration for multiple annotated classes

Anand Jain
Greenhorn

Joined: Jul 27, 2009
Posts: 18

I am using hibernate annotations and for that in the hibernate.cfg.xml i need to add annotated classes like this here p is the package name and Customer is the annotated bean.

Suppose i have 20 such kind of annotated classes, it means I have to write 20 mapping lines for that class.In Spring there is a property packageToScan that can be used to register/load all hibernate annotated classes in the specified package.

Since I am not using Spring, do we have the same functionality in Hibernate?

Also I found one tag in hibernate.cfg.xml at first I thought this will do the job for me, but it didn't work. I didn't get what is the use of this property. Can somebody please let me know about it?
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1632
    
    7

Nope to my knowledge this functionality does not exist without Spring.


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate annotation configuration for multiple annotated classes
 
Similar Threads
Can we create a sessionFactory from a combination of Annotated Classes and Hbm files.
JBoss AS5 with Hibernate 3 annotations
Hibernate annotations gives me a NoSuchMethodError exception
configuration in hibernate problem
Hibernate cfg xml and Eclipse problem