• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate annotation configuration for multiple annotated classes

 
Anand Jain
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope to my knowledge this functionality does not exist without Spring.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!