Hi ,
I am facing some problem in mapping entity POJO using annotation in hibenrate 3.0 + spring 4.1 . ( i m using
java .persistence.* annotation package )
in my app-servlet.xml below is the mapping done .
in hibernate.cfg.xml below mapping are available
when i call session.save(object of subscriber ) it gives run time exception of " Unknown Entity : com.BlueClouds.form.Subscriber "
but if i uncomment <mapping class="com.BlueClouds.form.Subscriber"/> line in hibernate.cfg.xml the app gives exception while loading
org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="com.BlueClouds.form.Subscriber"/>
The thing is ShUsers table having POJO without annotation works fine .
Only subscriber table that is having annotation based POJO and no .hbm.xml file gives error.
I have few doubts
1) is it due to "packagesToScan" property being ignored in app-servlet.xml ?
2) is it mandatory to add <mapping class=""/> in hibernate.hbm.xml ?
Please help in rectifying this problem .
Thanks