I have specified to scan all Entity and DAO classes in applicationContext.xml
Code:<context:component-scan base-package="net.bapco" />
I have specified to scan all Entity and DAO classes in applicationContext.xml
Code:<context:component-scan base-package="net.bapco" />
I strongly suggest a read of the reference guide (especially on what component-scan does and doesn't do) and rereading my post.
In short component-scan doesn't do anything for @Entities that is the responsiblitiy of the SessionFactory (and as such it needs to be configured).Originally Posted by mdeinum
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
Thanks for pointing that out. I have added the following
and that problem got resolved. Now next issue isCode:<bean id="SessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="DataSource" /> <property name="annotatedClasses"> <list> <value>net.test.model.Employees</value> </list> </property>
Code:SEVERE: org.hibernate.exception.GenericJDBCException: Missing IN or OUT parameter at index:: 1
I have resolved all my errors. Thanks a lot for your help and kindness. Very much appreciated.
I have one doubt though. If component-scan doesn't do anything for @Entities, then do we need to define all Entity classes in applicationContext.xml? Is this the best practice or are there better approaches to this?
Thanks again.