I have an object with a field mapped many-to-one e.g :
Code:
Course {
User user ;
...
}
<class name="com.pkg.Course" table="COURSE" polymorphism="implicit">
<id name="id" type="long" column="ID" unsaved-value="0">
<generator class="identity"/>
</id>
<many-to-one name="user"
class="com.pkg.User"
column="USER_ID"
not-null="true"
cascade="none"/>
......
</class>
When I save a new object of course, session.save(Course), in the logs I see an extra select query on User, before every insert. I looked around in the forums but cant find a way to avoid it. Is there a way to avoid this query ?