From: <one...@us...> - 2003-03-16 03:36:11
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv19454/hibernate/test Modified Files: Multi.hbm.xml MultiTableTest.java Added Files: Mono.java Log Message: added a new test --- NEW FILE: Mono.java --- package cirrus.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. */ 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/Hibernate/cirrus/hibernate/test/Multi.hbm.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Multi.hbm.xml 25 Dec 2002 01:02:16 -0000 1.19 --- Multi.hbm.xml 16 Mar 2003 03:36:04 -0000 1.20 *************** *** 13,16 **** --- 13,24 ---- <property name="date" column="date_"/> + <joined-subclass name="cirrus.hibernate.test.Mono" table="mono"> + <key column="superid"/> + <set role="strings" table="monostrings"> + <key column="monoid"/> + <element type="string" column="str_"/> + </set> + </joined-subclass> + <joined-subclass name="cirrus.hibernate.test.LessSimple" table="leafsubclass"> <key column="id__"/> Index: MultiTableTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/MultiTableTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** MultiTableTest.java 6 Mar 2003 10:55:09 -0000 1.23 --- MultiTableTest.java 16 Mar 2003 03:36:04 -0000 1.24 *************** *** 11,14 **** --- 11,15 ---- import cirrus.hibernate.*; + import cirrus.hibernate.sql.SybaseDialect; import junit.framework.Test; *************** *** 21,24 **** --- 22,43 ---- } + 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 testConstraints() throws Exception { Session s = sessions.openSession(); *************** *** 26,30 **** SubMulti sm = new SubMulti(); sm.setAmount(66.5f); ! s.save( sm, new Long(2) ); t.commit(); s.close(); --- 45,54 ---- SubMulti sm = new SubMulti(); sm.setAmount(66.5f); ! if ( dialect instanceof SybaseDialect ) { ! s.save(sm); ! } ! else { ! s.save( sm, new Long(2) ); ! } t.commit(); s.close(); *************** *** 37,40 **** --- 61,67 ---- public void testMultiTable() throws Exception { + + if (dialect instanceof SybaseDialect) return; + Session s = sessions.openSession(); Transaction t = s.beginTransaction(); *************** *** 154,157 **** --- 181,187 ---- public void testMultiTableCollections() throws Exception { + + if (dialect instanceof SybaseDialect) return; + Session s = sessions.openSession(); Transaction t = s.beginTransaction(); |