I use annotations for sleep mode, and for this in hibernate.cfg.xml I need to add annotated classes such as this <mapping class="p.Customer" /> here p is the package name and Client . annotated bean.
Suppose I have 20 such annotated classes, which means that I have to write 20 mapping lines for this class. In Spring, there is a packageToScan property that can be used to register / load all hibernate annotated classes into the specified package.
Since I do not use Spring, can we have the same functionality in Hibernate?
Also I found one tag in hibernate.cfg.xml <mapping package="" /> at first, I thought this would do the job for me, but that didn't work. I did not get what uses this property.
Anand source share