Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory sc8-pr-cvs1:/tmp/cvs-serv25620/hibernate/test
Modified Files:
LessSimple.java Multi.hbm.xml MultiTableTest.java
Log Message:
fixed a bug caching null one-to-one associations
Index: LessSimple.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/LessSimple.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** LessSimple.java 19 Dec 2002 10:47:50 -0000 1.5
--- LessSimple.java 25 Dec 2002 01:02:16 -0000 1.6
***************
*** 12,15 ****
--- 12,16 ----
private Simple another;
private LessSimple yetanother;
+ private Po mypo;
/**
* Returns the intprop.
***************
*** 106,109 ****
--- 107,126 ----
public void setBag(List bag) {
this.bag = bag;
+ }
+
+ /**
+ * Returns the mypo.
+ * @return Po
+ */
+ public Po getMypo() {
+ return mypo;
+ }
+
+ /**
+ * Sets the mypo.
+ * @param mypo The mypo to set
+ */
+ public void setMypo(Po mypo) {
+ this.mypo = mypo;
}
Index: Multi.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Multi.hbm.xml,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Multi.hbm.xml 19 Dec 2002 10:47:51 -0000 1.18
--- Multi.hbm.xml 25 Dec 2002 01:02:16 -0000 1.19
***************
*** 4,7 ****
--- 4,8 ----
<class name="cirrus.hibernate.test.Simple" table="rootclass">
+ <jcs-cache usage="read-write"/>
<id type="long" column="id_" >
<generator class="native"/>
***************
*** 27,30 ****
--- 28,32 ----
<many-to-many column="simple2" class="cirrus.hibernate.test.Simple"/>
</bag>
+ <one-to-one name="mypo"/>
</joined-subclass>
Index: MultiTableTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/MultiTableTest.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** MultiTableTest.java 19 Dec 2002 10:47:51 -0000 1.16
--- MultiTableTest.java 25 Dec 2002 01:02:16 -0000 1.17
***************
*** 221,224 ****
--- 221,240 ----
s.close();
}
+
+ public void testOneToOne() throws Exception {
+ Session s = sessions.openSession();
+ LessSimple ls = new LessSimple();
+ Serializable id = s.save(ls);
+ s.flush();
+ s.connection().commit();
+ s = sessions.openSession();
+ s.load(LessSimple.class, id);
+ s.connection().commit();
+ s.close();
+ s = sessions.openSession();
+ s.load(LessSimple.class, id);
+ s.connection().commit();
+ s.close();
+ }
|