I have a database table consisting of countries. In my DAO which extends HibernateDAOSupport the following method...
public List<Country> getCountries() {
return getHibernateTemplate().loadAll(Country.class);
}
...generates the following activity:
Hibernate: update countries set name=?, iso_alpha_2=?, iso_alpha_3=? where id=?
Hibernate: update countries set name=?, iso_alpha_2=?, iso_alpha_3=? where id=?
Hibernate: update countries set name=?, iso_alpha_2=?, iso_alpha_3=? where id=?
...
once for each row
The method works, however. I get my list of countries, but what's with all the updates?
My mapping for this class isn't terribly exotic:
<class name="Country" table="countries">
<id name="id" column="id">
<generator class="identity"/>
</id>
<property name="name" column="name"/>
<property name="alpha2" column="iso_alpha_2" />
<property name="alpha3" column="iso_alpha_3" />
</class>
Can anyone point me in the right direction? Why would loadAll be triggering updates?