I've recently upgraded hibernate version from 3.0 to 4.0 and most of the things were working fine except when I tried to save list of entities. If I save each entity separately I'm not getting any exception but when I try to save the entire list, getting the following exception:
org.springframework.orm.hibernate4.HibernateSystemException: Unknown entity: java.util.ArrayList; nested exception is org.hibernate.MappingException: Unknown entity: java.util.ArrayList
code:
this.getHibernateTemplate().saveOrUpdate(entityObject) // Results in exception
Session configuration:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="packagesToScan" value="domain">
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.dialect">${jdbc.dialect}</prop>
</props>
</property>
</bean>
Your help is appreciated.