From: <one...@us...> - 2003-01-20 18:45:27
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv9798/sf/hibernate/test Modified Files: Baz.hbm.xml Baz.java FooBarTest.java Log Message: refactorings to create SQL generation layer Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Baz.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Baz.hbm.xml 9 Jan 2003 12:24:51 -0000 1.4 --- Baz.hbm.xml 20 Jan 2003 18:45:18 -0000 1.5 *************** *** 113,116 **** --- 113,122 ---- </array> + <list name="fees" lazy="true" cascade="all"> + <key column="bazid"/> + <index column="bazind"/> + <one-to-many class="net.sf.hibernate.test.Fee"/> + </list> + <list name="customs"> <key column="id_"/> Index: Baz.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Baz.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Baz.java 5 Jan 2003 02:11:23 -0000 1.3 --- Baz.java 20 Jan 2003 18:45:18 -0000 1.4 *************** *** 27,30 **** --- 27,31 ---- private Map fooComponentToFoo; private Map glarchToFoo; + private List fees; Baz() {} *************** *** 228,231 **** --- 229,240 ---- } + public List getFees() { + return fees; + } + + public void setFees(List fees) { + this.fees = fees; + } + } Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FooBarTest.java 20 Jan 2003 12:48:14 -0000 1.12 --- FooBarTest.java 20 Jan 2003 18:45:18 -0000 1.13 *************** *** 161,164 **** --- 161,186 ---- } + public void testCascadeSave() throws Exception { + Session s = sessions.openSession(); + Transaction t = s.beginTransaction(); + Baz baz = new Baz(); + List list = new ArrayList(); + list.add( new Fee() ); + list.add( new Fee() ); [...4046 lines suppressed...] ! "Many.hbm.xml", ! "Immutable.hbm.xml", ! "Fee.hbm.xml", ! "Vetoer.hbm.xml", ! "Holder.hbm.xml", ! "Location.hbm.xml", ! "Stuff.hbm.xml", ! "Container.hbm.xml", ! "Simple.hbm.xml" ! } ); ! return new TestSuite(FooBarTest.class); ! } ! catch (Exception e) { ! e.printStackTrace(); ! throw e; ! } } ! } |