Hi
I'm having problems with what I expected would be an absolutely trivial mapping. I have two classes, Methodology and Decision. For each methodology there can be many decisions, and decisions can't exist without a corresponding Methodology.
The problem is that for my simple test I have a Methodology which I know has 3 Decisions. But when I load the methodology I only find a single decision in the List. Using MySQL's query log I can look at the query that gets executed by Hibernate to fetch the decisions, and I find that the query when executed in the mysql client does in fact return 3 decisions. So what's going on?!
Hibernate version:
3.1.2
Mapping documents:
Code:
<hibernate-mapping package="domain">
<class name="Decision" table="pro_methodology_decision">
<id name="id" column="decision_id">
<generator class="native"/>
</id>
<property name="grade" column="grade"/>
<property name="date" column="date"/>
<property name="meeting" column="meeting"/>
<many-to-one name="methodology" class="Methodology" column="methodology_id" not-null="true"/>
</class>
</hibernate-mapping>
<hibernate-mapping package="domain">
<class name="Methodology" table="pro_methodology">
<id name="id" column="methodology_id">
<generator class="native"/>
</id>
<property name="name" column="methodology_name"/>
<property name="doeId" column="doe_id"/>
<property name="lastChange" column="last_change"/>
<property name="lastChangeUser" column="last_change_user"/>
<property name="ebType" column="eb_type"/>
<property name="ebId" column="eb_id"/>
<property name="rev" column="rev"/>
<many-to-one name="exampleProject" class="Project" column="example_project"/>
<bag name="decisions" inverse="true">
<key column="methodology_id"/>
<one-to-many class="Decision"/>
</bag>
</class>
</hibernate-mapping>
Name and version of the database you are using:
MySQL 4.1