Joined: Fri Feb 08, 2008 7:14 am Posts: 4
|
I have this:
<hibernate-mapping> <class name="test.A" table="A" > <id name="a1" type="java.lang.String"> <column name="A1"/> </id> <many-to-one name="c" property-ref="c_id" class="test.C" update="false" insert="false" fetch="join" > <column name="b1" /> <column name="c1" /> </many-to-one> </class> </hibernate-mapping>
<hibernate-mapping> <class name="test.C" table="C" > <id name="c" type="java.lang.String"> <column name="C" /> </id> <properties name="c_id" > <property name="b1" insert="false" update="false" /> <property name="c1" insert="false" update="false" /> </properties> </class> </hibernate-mapping>
And i have a test whit this:
A a = (A) template.load(A.class, "1");
When in table A there is:
A1 | B1 | C1 1 null null
sql generated is: select ... from A a0_ left outer join C c1_ on a0_.b1=c1_.b1 and a0_.c1=c1_.c1 where a0_.A1=?;
When in table A there is:
A1 | B1 | C1 1 1 1
sql generated is: select ... from A a0_ left outer join C c1_ on a0_.b1=c1_.b1 and a0_.c1=c1_.c1 where a0_.A1=?;
BUT When I have:
A1 | B1 | C1 1 null 1
OR
A1 | B1 | C1 1 1 null
The sql is: select ... from A a0_ left outer join C c1_ on a0_.b1=c1_.b1 and a0_.c1=c1_.c1 where a0_.A1=? select ... from C c0_ where c0_.b1=? and c0_.c1=?
Why reason appears a query on C ?
I am using hibernate 3.2.5
|
|