From: <one...@us...> - 2003-01-03 13:36:04
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv2643/src/net/sf/hibernate/test Modified Files: Baz.hbm.xml FooBarTest.java FooComponent.java Log Message: removed exceptions that occur if an object is saved or deleted multiple times in a session added <parent> subelement to <composite-element> and <nested-composite-element> Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Baz.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Baz.hbm.xml 2 Jan 2003 11:01:49 -0000 1.2 --- Baz.hbm.xml 3 Jan 2003 13:36:01 -0000 1.3 *************** *** 37,40 **** --- 37,41 ---- <index column="i"/> <composite-element class="net.sf.hibernate.test.FooComponent"> + <parent name="baz"/> <property name="name"> <column name="name" length="56"/> Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FooBarTest.java 2 Jan 2003 11:01:49 -0000 1.2 --- FooBarTest.java 3 Jan 2003 13:36:01 -0000 1.3 *************** *** 286,289 **** --- 286,290 ---- assertTrue( baz.getCustoms().size()==4 && baz.getCustoms().get(0)!=null, "collection of custom types - added element" ); assertTrue ( baz.getComponents()[1].getSubcomponent()!=null, "component of component in collection" ); + assertTrue( baz.getComponents()[1].getBaz()==baz ); assertTrue( ( (FooProxy) baz.getFooSet().iterator().next() ).getKey().equals( foo.getKey() ), "set of objects"); assertTrue( baz.getStringArray().length==0, "collection removed" ); *************** *** 362,367 **** s.delete( baz.getTopGlarchez().get( new Character('G') ) ); s.delete( baz.getTopGlarchez().get( new Character('H') ) ); ! System.out.println( ">>>" + s.delete("from bar in class net.sf.hibernate.test.Bar") ); ! //assertTrue( s.delete("from bar in class net.sf.hibernate.test.Bar")==2 ); FooProxy[] arr = baz.getFooArray(); assertTrue( arr.length==4 && arr[1].getKey().equals( foo.getKey() ), "new array of objects" ); --- 363,367 ---- s.delete( baz.getTopGlarchez().get( new Character('G') ) ); s.delete( baz.getTopGlarchez().get( new Character('H') ) ); ! assertTrue( s.delete("from bar in class net.sf.hibernate.test.Bar")==1 ); FooProxy[] arr = baz.getFooArray(); assertTrue( arr.length==4 && arr[1].getKey().equals( foo.getKey() ), "new array of objects" ); Index: FooComponent.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooComponent.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** FooComponent.java 1 Jan 2003 13:57:04 -0000 1.1.1.1 --- FooComponent.java 3 Jan 2003 13:36:01 -0000 1.2 *************** *** 13,16 **** --- 13,17 ---- GlarchProxy glarch; private Foo parent; + private Baz baz; public String toString() { *************** *** 102,105 **** --- 103,114 ---- public void setParent(Foo parent) { this.parent = parent; + } + + public Baz getBaz() { + return baz; + } + + public void setBaz(Baz baz) { + this.baz = baz; } |