Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test
In directory sc8-pr-cvs1:/tmp/cvs-serv19750/sf/hibernate/test
Modified Files:
Multi.hbm.xml MultiTableTest.java
Added Files:
Mono.java
Log Message:
added a new test
--- NEW FILE: Mono.java ---
package net.sf.hibernate.test;
import java.util.Set;
/**
* @author Administrator
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
public class Mono extends Simple {
private Set strings;
/**
* Constructor for Mono.
* @param c
*/
public Mono(int c) {
super(c);
}
/**
* Constructor for Mono.
*/
public Mono() {
super();
}
/**
* Returns the strings.
* @return Set
*/
public Set getStrings() {
return strings;
}
/**
* Sets the strings.
* @param strings The strings to set
*/
public void setStrings(Set strings) {
this.strings = strings;
}
}
Index: Multi.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Multi.hbm.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Multi.hbm.xml 27 Jan 2003 12:12:41 -0000 1.4
--- Multi.hbm.xml 16 Mar 2003 03:37:01 -0000 1.5
***************
*** 13,16 ****
--- 13,24 ----
<property name="date" column="date_"/>
+ <joined-subclass name="net.sf.hibernate.test.Mono" table="mono">
+ <key column="superid"/>
+ <set name="strings" table="monostrings">
+ <key column="monoid"/>
+ <element type="string" column="str_"/>
+ </set>
+ </joined-subclass>
+
<joined-subclass name="net.sf.hibernate.test.TrivialClass">
<key column="tcid"/>
Index: MultiTableTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/MultiTableTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** MultiTableTest.java 9 Mar 2003 04:04:09 -0000 1.10
--- MultiTableTest.java 16 Mar 2003 03:37:01 -0000 1.11
***************
*** 34,37 ****
--- 34,55 ----
}
+ public void testCollectionOnly() throws Exception {
+ Session s = sessions.openSession();
+ Transaction t = s.beginTransaction();
+ Mono m = new Mono();
+ Long id = (Long) s.save(m);
+ t.commit();
+ s.close();
+ s = sessions.openSession();
+ t = s.beginTransaction();
+ s.update(m, id);
+ s.flush();
+ m.setAddress("foo bar");
+ s.flush();
+ s.delete(m);
+ t.commit();
+ s.close();
+ }
+
public void testQueries() throws Exception {
|