|
From: <one...@us...> - 2002-11-05 16:58:18
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory usw-pr-cvs1:/tmp/cvs-serv12927/cirrus/hibernate/test
Modified Files:
FooBarTest.java Fum.java MasterDetailTest.java Qux.java
Log Message:
removed deprecated methods in preparation for version 1.2
Index: FooBarTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v
retrieving revision 1.216
retrieving revision 1.217
diff -C2 -d -r1.216 -r1.217
*** FooBarTest.java 28 Oct 2002 19:27:49 -0000 1.216
--- FooBarTest.java 5 Nov 2002 16:58:14 -0000 1.217
***************
*** 161,165 ****
public void testPersistCollections() throws Exception {
Session s = sessions.openSession();
! Baz baz = (Baz) s.create(Baz.class);
baz.setDefaults();
//System.out.println( s.print(baz) );
--- 161,166 ----
public void testPersistCollections() throws Exception {
Session s = sessions.openSession();
! Baz baz = new Baz();
! s.save(baz);
baz.setDefaults();
//System.out.println( s.print(baz) );
***************
*** 171,176 ****
baz = (Baz) ( (Object[]) s.find("select baz, baz from baz in class cirrus.hibernate.test.Baz").get(0) )[1];
//System.out.println( s.print(baz) );
! Foo foo = (Foo) s.create(Foo.class);
! baz.setFooArray( new Foo[] { foo, foo, null, (Foo) s.create(Foo.class) } );
baz.getFooSet().add(foo);
baz.getCustoms().add( new String[] { "new", "custom" } );
--- 172,180 ----
baz = (Baz) ( (Object[]) s.find("select baz, baz from baz in class cirrus.hibernate.test.Baz").get(0) )[1];
//System.out.println( s.print(baz) );
! Foo foo = new Foo();
! s.save(foo);
! Foo foo2 = new Foo() ;
! s.save(foo2);
! baz.setFooArray( new Foo[] { foo, foo, null, foo2 } );
baz.getFooSet().add(foo);
baz.getCustoms().add( new String[] { "new", "custom" } );
***************
*** 332,336 ****
public void testCreateUpdate() throws Exception {
Session s = sessions.openSession();
! Foo foo = (Foo) s.create(Foo.class);
foo.setString("dirty");
s.flush();
--- 336,341 ----
public void testCreateUpdate() throws Exception {
Session s = sessions.openSession();
! Foo foo = new Foo();
! s.save(foo);
foo.setString("dirty");
s.flush();
***************
*** 349,353 ****
s = sessions.openSession();
! foo = (Foo) s.create( Foo.class, "assignedid");
foo.setString("dirty");
s.flush();
--- 354,359 ----
s = sessions.openSession();
! foo = new Foo();
! s.save(foo, "assignedid");
foo.setString("dirty");
s.flush();
***************
*** 366,370 ****
public void testUpdate() throws Exception {
Session s = sessions.openSession();
! Foo foo = (Foo) s.create(Foo.class);
s.flush();
s.connection().commit();
--- 372,377 ----
public void testUpdate() throws Exception {
Session s = sessions.openSession();
! Foo foo = new Foo();
! s.save(foo);
s.flush();
s.connection().commit();
***************
*** 454,459 ****
public void testLoad() throws Exception {
Session s = sessions.openSession();
! Qux q = (Qux) s.create(Qux.class);
! BarProxy b = (Bar) s.create(Bar.class);
s.flush();
s.connection().commit();
--- 461,468 ----
public void testLoad() throws Exception {
Session s = sessions.openSession();
! Qux q = new Qux();
! s.save(q);
! BarProxy b = new Bar();
! s.save(b);
s.flush();
s.connection().commit();
***************
*** 475,479 ****
public void testCreate() throws Exception {
Session s = sessions.openSession();
! Foo foo = (Foo) s.create(Foo.class);
s.flush();
s.connection().commit();
--- 484,489 ----
public void testCreate() throws Exception {
Session s = sessions.openSession();
! Foo foo = new Foo();
! s.save(foo);
s.flush();
s.connection().commit();
***************
*** 523,527 ****
public void testPolymorphism() throws Exception {
Session s = sessions.openSession();
! Bar bar = (Bar) s.create(Bar.class);
bar.setBarString("bar bar");
s.flush();
--- 533,538 ----
public void testPolymorphism() throws Exception {
Session s = sessions.openSession();
! Bar bar = new Bar();
! s.save(bar);
bar.setBarString("bar bar");
s.flush();
***************
*** 541,545 ****
public void testCollectionOfSelf() throws Exception {
Session s = sessions.openSession();
! Bar bar = (Bar) s.create(Bar.class);
bar.setAbstracts( new HashSet() );
bar.getAbstracts().add(bar);
--- 552,557 ----
public void testCollectionOfSelf() throws Exception {
Session s = sessions.openSession();
! Bar bar = new Bar();
! s.save(bar);
bar.setAbstracts( new HashSet() );
bar.getAbstracts().add(bar);
***************
*** 567,577 ****
public void testFind() throws Exception {
Session s = sessions.openSession();
! Bar bar = (Bar) s.create(Bar.class);
bar.setBarString("bar bar");
bar.setString("xxx");
! Foo foo = (Foo) s.create(Foo.class);
foo.setString("foo bar");
! s.create(Foo.class);
! s.create(Bar.class);
List list1 = s.find("select foo from foo in class cirrus.hibernate.test.Foo where foo.string='foo bar'");
assertTrue( list1.size()==1, "find size" );
--- 579,591 ----
public void testFind() throws Exception {
Session s = sessions.openSession();
! Bar bar = new Bar();
! s.save(bar);
bar.setBarString("bar bar");
bar.setString("xxx");
! Foo foo = new Foo();
! s.save(foo);
foo.setString("foo bar");
! s.save( new Foo() );
! s.save( new Bar() );
List list1 = s.find("select foo from foo in class cirrus.hibernate.test.Foo where foo.string='foo bar'");
assertTrue( list1.size()==1, "find size" );
***************
*** 622,627 ****
public void testQuery() throws Exception {
Session s = sessions.openSession();
! Foo foo = (Foo) s.create(Foo.class);
! foo.setFoo( (Foo) s.create(Foo.class) );
List list = s.find("from foo in class cirrus.hibernate.test.Foo where foo.string='osama bin laden' and foo.boolean = true order by foo.string asc, foo.component.count desc");
assertTrue( list.size()==0, "empty query" );
--- 636,644 ----
public void testQuery() throws Exception {
Session s = sessions.openSession();
! Foo foo = new Foo();
! s.save(foo);
! Foo foo2 = new Foo();
! s.save(foo2);
! foo.setFoo(foo2);
List list = s.find("from foo in class cirrus.hibernate.test.Foo where foo.string='osama bin laden' and foo.boolean = true order by foo.string asc, foo.component.count desc");
assertTrue( list.size()==0, "empty query" );
***************
*** 753,757 ****
public void testSubcollections() throws Exception {
Session s = sessions.openSession();
! Baz baz = (Baz) s.create(Baz.class);
baz.setDefaults();
s.flush();
--- 770,775 ----
public void testSubcollections() throws Exception {
Session s = sessions.openSession();
! Baz baz = new Baz();
! s.save(baz);
baz.setDefaults();
s.flush();
***************
*** 785,793 ****
//first for unkeyed collections
Session s = sessions.openSession();
! Baz baz1 = (Baz) s.create(Baz.class);
! Baz baz2 = (Baz) s.create(Baz.class);
baz1.setIntArray( new int[] {1 ,2, 3, 4} );
baz1.setFooSet( new HashSet() );
! baz1.getFooSet().add( s.create(Foo.class) );
s.flush();
s.connection().commit();
--- 803,815 ----
//first for unkeyed collections
Session s = sessions.openSession();
! Baz baz1 = new Baz();
! s.save(baz1);
! Baz baz2 = new Baz();
! s.save(baz2);
baz1.setIntArray( new int[] {1 ,2, 3, 4} );
baz1.setFooSet( new HashSet() );
! Foo foo = new Foo();
! s.save(foo);
! baz1.getFooSet().add(foo);
s.flush();
s.connection().commit();
***************
*** 818,823 ****
//now for collections of collections
s = sessions.openSession();
! baz1 = (Baz) s.create(Baz.class);
! baz2 = (Baz) s.create(Baz.class);
Set set1 = new TreeSet();
Set set2 = new TreeSet();
--- 840,847 ----
//now for collections of collections
s = sessions.openSession();
! baz1 = new Baz();
! s.save(baz1);
! baz2 = new Baz();
! s.save(baz2);
Set set1 = new TreeSet();
Set set2 = new TreeSet();
***************
*** 863,869 ****
//now for keyed collections
s = sessions.openSession();
! baz1 = (Baz) s.create(Baz.class);
! baz2 = (Baz) s.create(Baz.class);
! baz1.setFooArray( new Foo[] { (Foo) s.create(Foo.class), null, (Foo) s.create(Foo.class) } );
baz1.setStringDateMap( new TreeMap() );
baz1.getStringDateMap().put("today", new Date( System.currentTimeMillis() ) );
--- 887,898 ----
//now for keyed collections
s = sessions.openSession();
! baz1 = new Baz();
! s.save(baz1);
! baz2 = new Baz();
! s.save(baz2);
! Foo foo1 = new Foo();
! Foo foo2 = new Foo();
! s.save(foo1); s.save(foo2);
! baz1.setFooArray( new Foo[] { foo1, null, foo2 } );
baz1.setStringDateMap( new TreeMap() );
baz1.getStringDateMap().put("today", new Date( System.currentTimeMillis() ) );
***************
*** 903,907 ****
public void testPersistentLifecycle() throws Exception {
Session s = sessions.openSession();
! Qux q = (Qux) s.create(Qux.class);
q.setStuff("foo bar baz qux");
s.flush();
--- 932,937 ----
public void testPersistentLifecycle() throws Exception {
Session s = sessions.openSession();
! Qux q = new Qux();
! s.save(q);
q.setStuff("foo bar baz qux");
s.flush();
***************
*** 928,933 ****
Session s = sessions.openSession();
for ( int i=0; i<10; i++ ) {
! Qux q = (Qux) s.create(Qux.class);
! assertTrue(q!=null, "not null");
}
s.flush();
--- 958,964 ----
Session s = sessions.openSession();
for ( int i=0; i<10; i++ ) {
! Qux q = new Qux();
! Object qid = s.save(q);
! assertTrue(q!=null && qid!=null, "not null");
}
s.flush();
***************
*** 965,970 ****
public void testVersioning() throws Exception {
Session s = sessions.openSession();
! GlarchProxy g = (GlarchProxy) s.create(Glarch.class);
! GlarchProxy g2 = (GlarchProxy) s.create(Glarch.class);
Serializable gid = s.getIdentifier(g);
Serializable g2id = s.getIdentifier(g2);
--- 996,1003 ----
public void testVersioning() throws Exception {
Session s = sessions.openSession();
! GlarchProxy g = new Glarch();
! s.save(g);
! GlarchProxy g2 = new Glarch();
! s.save(g2);
Serializable gid = s.getIdentifier(g);
Serializable g2id = s.getIdentifier(g2);
***************
*** 975,979 ****
s = sessions.openSession();
g = (GlarchProxy) s.load( Glarch.class, gid );
! s.lock(g);
g2 = (GlarchProxy) s.load( Glarch.class, g2id );
assertTrue( g.getVersion()==1, "version" );
--- 1008,1012 ----
s = sessions.openSession();
g = (GlarchProxy) s.load( Glarch.class, gid );
! s.lock(g, LockMode.UPGRADE);
g2 = (GlarchProxy) s.load( Glarch.class, g2id );
assertTrue( g.getVersion()==1, "version" );
***************
*** 1004,1008 ****
public void testVersionedCollections() throws Exception {
Session s = sessions.openSession();
! GlarchProxy g = (GlarchProxy) s.create(Glarch.class);
g.setProxyArray( new GlarchProxy[] { g } );
String gid = (String) s.getIdentifier(g);
--- 1037,1042 ----
public void testVersionedCollections() throws Exception {
Session s = sessions.openSession();
! GlarchProxy g = new Glarch();
! s.save(g);
g.setProxyArray( new GlarchProxy[] { g } );
String gid = (String) s.getIdentifier(g);
***************
*** 1059,1063 ****
assertTrue( !s.iterate("from fee in class Fee").hasNext() );
! GlarchProxy g = (GlarchProxy) s.create(Glarch.class);
String gid = (String) s.getIdentifier(g);
HashMap map = new HashMap();
--- 1093,1098 ----
assertTrue( !s.iterate("from fee in class Fee").hasNext() );
! GlarchProxy g = new Glarch();
! s.save(g);
String gid = (String) s.getIdentifier(g);
HashMap map = new HashMap();
***************
*** 1136,1143 ****
//being tested here)
Session s = sessions.openSession();
! Glarch last = (Glarch) s.create(Glarch.class);
last.setOrder( (short) 0 );
for (int i=0; i<5; i++) {
! Glarch next = (Glarch) s.create(Glarch.class);
last.setNext(next);
last = next;
--- 1171,1180 ----
//being tested here)
Session s = sessions.openSession();
! GlarchProxy last = new Glarch();
! s.save(last);
last.setOrder( (short) 0 );
for (int i=0; i<5; i++) {
! GlarchProxy next = new Glarch();
! s.save(next);
last.setNext(next);
last = next;
***************
*** 1176,1183 ****
//Same thing but using polymorphic class (no optimisation possible):
s = sessions.openSession();
! FooProxy flast = (FooProxy) s.create(Bar.class);
flast.setString( "foo0" );
for (int i=0; i<5; i++) {
! flast.setFoo( (FooProxy) s.create(Bar.class) );
flast = flast.getFoo();
flast.setString( "foo" + (i+1) );
--- 1213,1223 ----
//Same thing but using polymorphic class (no optimisation possible):
s = sessions.openSession();
! FooProxy flast = new Bar();
! s.save(flast);
flast.setString( "foo0" );
for (int i=0; i<5; i++) {
! FooProxy foo = new Bar();
! s.save(foo);
! flast.setFoo(foo);
flast = flast.getFoo();
flast.setString( "foo" + (i+1) );
***************
*** 1255,1259 ****
s = sessions.openSession();
! fum = (Fum) s.loadWithLock( Fum.class, fumKey("fum") );
assertTrue( fum!=null, "load by composite key" );
--- 1295,1299 ----
s = sessions.openSession();
! fum = (Fum) s.load( Fum.class, fumKey("fum"), LockMode.UPGRADE );
assertTrue( fum!=null, "load by composite key" );
***************
*** 1431,1437 ****
fum1.setFum("fee fo fi");
fum2.setFum("fee fo fi");
! s.insert(fum1);
! s.insert(fum2);
! Qux q = (Qux) s.create(Qux.class);
Set set = new HashSet();
List list = new ArrayList();
--- 1471,1478 ----
fum1.setFum("fee fo fi");
fum2.setFum("fee fo fi");
! s.save(fum1);
! s.save(fum2);
! Qux q = new Qux();
! s.save(q);
Set set = new HashSet();
List list = new ArrayList();
***************
*** 1462,1467 ****
public void testMultiColumnQueries() throws Exception {
Session s = sessions.openSession();
! Foo foo = (Foo) s.create(Foo.class);
! foo.setFoo( (Foo) s.create(Foo.class) );
List l = s.find("select parent, child from parent in class cirrus.hibernate.test.Foo, child in class cirrus.hibernate.test.Foo where parent.foo = child");
assertTrue( l.size()==1, "multi-column find" );
--- 1503,1511 ----
public void testMultiColumnQueries() throws Exception {
Session s = sessions.openSession();
! Foo foo = new Foo();
! s.save(foo);
! Foo foo1 = new Foo();
! s.save(foo1);
! foo.setFoo(foo1);
List l = s.find("select parent, child from parent in class cirrus.hibernate.test.Foo, child in class cirrus.hibernate.test.Foo where parent.foo = child");
assertTrue( l.size()==1, "multi-column find" );
***************
*** 1533,1537 ****
public void testUpdateFromTransient() throws Exception {
Session s = sessions.openSession();
! Fee fee1 = (Fee) s.create(Fee.class);
Fee fee2 = new Fee();
fee1.setFee(fee2);
--- 1577,1582 ----
public void testUpdateFromTransient() throws Exception {
Session s = sessions.openSession();
! Fee fee1 = new Fee();
! s.save(fee1);
Fee fee2 = new Fee();
fee1.setFee(fee2);
***************
*** 1648,1656 ****
public void testDatabinder() throws Exception {
Session s = sessions.openSession();
! BarProxy bar = (Bar) s.create(Bar.class);
! FooProxy foo = (Foo) s.create(Foo.class);
! FooProxy foo2 = (Foo) s.create(Foo.class);
foo2.setFoo(foo);
! Baz baz = (Baz) s.create(Baz.class);
baz.setDefaults();
baz.setFooArray( new FooProxy[] { foo, foo2, bar, null } );
--- 1693,1705 ----
public void testDatabinder() throws Exception {
Session s = sessions.openSession();
! BarProxy bar = new Bar();
! s.save(bar);
! FooProxy foo = new Foo();
! s.save(foo);
! FooProxy foo2 = new Foo();
! s.save(foo2);
foo2.setFoo(foo);
! Baz baz = new Baz();
! s.save(baz);
baz.setDefaults();
baz.setFooArray( new FooProxy[] { foo, foo2, bar, null } );
***************
*** 1685,1689 ****
public void testArraysOfTimes() throws Exception {
Session s = sessions.openSession();
! Baz baz = (Baz) s.create(Baz.class);
baz.setDefaults();
s.flush();
--- 1734,1739 ----
public void testArraysOfTimes() throws Exception {
Session s = sessions.openSession();
! Baz baz = new Baz() ;
! s.save(baz);
baz.setDefaults();
s.flush();
***************
*** 1788,1792 ****
public void testLazyCollections() throws Exception {
Session s = sessions.openSession();
! Qux q = (Qux) s.create(Qux.class);
s.flush();
s.connection().commit();
--- 1838,1843 ----
public void testLazyCollections() throws Exception {
Session s = sessions.openSession();
! Qux q = new Qux();
! s.save(q);
s.flush();
s.connection().commit();
***************
*** 1828,1832 ****
public void testDeleteOwner() throws Exception {
Session s = sessions.openSession();
! Qux q = (Qux) s.create(Qux.class);
Fum f1 = new Fum( fumKey("f1") );
Fum f2 = new Fum( fumKey("f2") );
--- 1879,1884 ----
public void testDeleteOwner() throws Exception {
Session s = sessions.openSession();
! Qux q = new Qux();
! s.save(q);
Fum f1 = new Fum( fumKey("f1") );
Fum f2 = new Fum( fumKey("f2") );
***************
*** 1841,1846 ****
q.setFums(set);
q.setMoreFums(list);
! s.insert(f1);
! s.insert(f2);
s.flush();
s.connection().commit();
--- 1893,1898 ----
q.setFums(set);
q.setMoreFums(list);
! s.save(f1);
! s.save(f2);
s.flush();
s.connection().commit();
***************
*** 1848,1853 ****
s = sessions.openSession();
! q = (Qux) s.loadWithLock( Qux.class, q.getKey() );
! s.lock(q);
s.delete(q);
s.flush();
--- 1900,1905 ----
s = sessions.openSession();
! q = (Qux) s.load( Qux.class, q.getKey(), LockMode.UPGRADE );
! s.lock( q, LockMode.UPGRADE );
s.delete(q);
s.flush();
***************
*** 1858,1863 ****
list = s.find("from fum in class cirrus.hibernate.test.Fum where not fum.fum='FRIEND'");
assertTrue( list.size()==2, "deleted owner" );
! s.lock( list.get(0) );
! s.lock( list.get(1) );
Iterator iter = list.iterator();
while ( iter.hasNext() ) {
--- 1910,1915 ----
list = s.find("from fum in class cirrus.hibernate.test.Fum where not fum.fum='FRIEND'");
assertTrue( list.size()==2, "deleted owner" );
! s.lock( list.get(0), LockMode.UPGRADE );
! s.lock( list.get(1), LockMode.UPGRADE );
Iterator iter = list.iterator();
while ( iter.hasNext() ) {
***************
*** 1901,1905 ****
s = sessions.openSession();
try {
! Foo f = (Foo) s.loadWithLock(Foo.class, fid);
s.delete(f);
s.flush();
--- 1953,1957 ----
s = sessions.openSession();
try {
! Foo f = (Foo) s.load(Foo.class, fid, LockMode.UPGRADE);
s.delete(f);
s.flush();
***************
*** 1961,1970 ****
s = sessions.openSession();
! Many manyB = (Many) s.create(Many.class);
! One oneB = (One) s.create(One.class);
oneB.setValue("b");
manyB.setOne(oneB);
! Many manyA = (Many) s.create(Many.class);
! One oneA = (One) s.create(One.class);
oneA.setValue("a");
manyA.setOne(oneA);
--- 2013,2026 ----
s = sessions.openSession();
! Many manyB = new Many();
! s.save(manyB);
! One oneB = new One();
! s.save(oneB);
oneB.setValue("b");
manyB.setOne(oneB);
! Many manyA = new Many();
! s.save(manyA);
! One oneA = new One();
! s.save(oneA);
oneA.setValue("a");
manyA.setOne(oneA);
***************
*** 2182,2186 ****
public void testFindLoad() throws Exception {
Session s = sessions.openSession();
! FooProxy foo = (FooProxy) s.create(Foo.class);
s.flush();
s.connection().commit();
--- 2238,2243 ----
public void testFindLoad() throws Exception {
Session s = sessions.openSession();
! FooProxy foo = new Foo();
! s.save(foo);
s.flush();
s.connection().commit();
***************
*** 2205,2209 ****
public void testAutoFlush() throws Exception {
Session s = sessions.openSession();
! FooProxy foo = (FooProxy) s.create(Foo.class);
assertTrue( s.find("from foo in class cirrus.hibernate.test.Foo").size()==1, "autoflush create" );
foo.setChar( new Character('X') );
--- 2262,2267 ----
public void testAutoFlush() throws Exception {
Session s = sessions.openSession();
! FooProxy foo = new Foo();
! s.save(foo);
assertTrue( s.find("from foo in class cirrus.hibernate.test.Foo").size()==1, "autoflush create" );
foo.setChar( new Character('X') );
***************
*** 2231,2240 ****
Fum fum = new Fum( fumKey("fum") );
fum.setFum("fo fee fi");
! s.insert(fum);
fum = new Fum( fumKey("fi") );
fum.setFum("fee fi fo");
! s.insert(fum);
List list = s.findIdentifiers("from fum in class cirrus.hibernate.test.Fum where not fum.fum='FRIEND'");
assertTrue( list.size()==2, "list identifiers");
s.delete( s.load(Fum.class, (Serializable) list.get(0) ) );
s.delete( s.load(Fum.class, (Serializable) list.get(1) ) );
--- 2289,2305 ----
Fum fum = new Fum( fumKey("fum") );
fum.setFum("fo fee fi");
! s.save(fum);
fum = new Fum( fumKey("fi") );
fum.setFum("fee fi fo");
! s.save(fum);
List list = s.findIdentifiers("from fum in class cirrus.hibernate.test.Fum where not fum.fum='FRIEND'");
assertTrue( list.size()==2, "list identifiers");
+ Iterator iter = s.iterate("select fum.id from fum in class cirrus.hibernate.test.Fum where not fum.fum='FRIEND'");
+ int i=0;
+ while ( iter.hasNext() ) {
+ assertTrue( iter.next() instanceof FumCompositeID, "iterate identifiers");
+ i++;
+ }
+ assertTrue(i==2);
s.delete( s.load(Fum.class, (Serializable) list.get(0) ) );
s.delete( s.load(Fum.class, (Serializable) list.get(1) ) );
***************
*** 2351,2355 ****
fo.setSerial(props);
fo.setBuf( "abcdefghij1`23%$*^*$*\n\t".getBytes() );
! s.insert( fo, fumKey("an instance of fo") );
s.flush();
props.setProperty("x", "y");
--- 2416,2420 ----
fo.setSerial(props);
fo.setBuf( "abcdefghij1`23%$*^*$*\n\t".getBytes() );
! s.save( fo, fumKey("an instance of fo") );
s.flush();
props.setProperty("x", "y");
Index: Fum.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Fum.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Fum.java 13 Aug 2002 16:20:23 -0000 1.7
--- Fum.java 5 Nov 2002 16:58:14 -0000 1.8
***************
*** 94,98 ****
Iterator iter = friends.iterator();
while ( iter.hasNext() ) {
! s.insert( iter.next() );
}
}
--- 94,98 ----
Iterator iter = friends.iterator();
while ( iter.hasNext() ) {
! s.save( iter.next() );
}
}
Index: MasterDetailTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/MasterDetailTest.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** MasterDetailTest.java 30 Oct 2002 13:34:25 -0000 1.37
--- MasterDetailTest.java 5 Nov 2002 16:58:14 -0000 1.38
***************
*** 42,46 ****
Master master = new Master();
assertTrue( s.save(master)!=null, "save returned native id" );
! Serializable mid = s.getID(master);
Detail d1 = new Detail();
d1.setMaster(master);
--- 42,46 ----
Master master = new Master();
assertTrue( s.save(master)!=null, "save returned native id" );
! Serializable mid = s.getIdentifier(master);
Detail d1 = new Detail();
d1.setMaster(master);
***************
*** 108,114 ****
public void testIncomingOutgoing() throws Exception {
Session s = sessions.openSession();
! Master master1 = (Master) s.create(Master.class);
! Master master2 = (Master) s.create(Master.class);
! Master master3 = (Master) s.create(Master.class);
master1.addIncoming(master2);
master2.addOutgoing(master1);
--- 108,117 ----
public void testIncomingOutgoing() throws Exception {
Session s = sessions.openSession();
! Master master1 = new Master();
! Master master2 = new Master();
! Master master3 = new Master();
! s.save(master1);
! s.save(master2);
! s.save(master3);
master1.addIncoming(master2);
master2.addOutgoing(master1);
***************
*** 209,216 ****
}
else if (dialect instanceof HSQLDialect ) {
! s.insert( d1, new Integer(666) );
}
else {
! s.insert( d1, new Long(666) );
}
//s.save(d2);
--- 212,219 ----
}
else if (dialect instanceof HSQLDialect ) {
! s.save( d1, new Integer(666) );
}
else {
! s.save( d1, new Long(666) );
}
//s.save(d2);
***************
*** 230,234 ****
Detail d = (Detail) iter.next();
assertTrue( d.getMaster()==m2, "deserialization" );
! if ( s.getID(d)!=null ) s.delete(d);
}
s.delete(m2);
--- 233,241 ----
Detail d = (Detail) iter.next();
assertTrue( d.getMaster()==m2, "deserialization" );
! try {
! s.getIdentifier(d);
! s.delete(d);
! }
! catch (Exception e) {}
}
s.delete(m2);
***************
*** 286,295 ****
}
else if (dialect instanceof HSQLDialect ) {
! s.insert( d1, new Integer(666) );
! s.insert( d2, new Integer(667) );
}
else {
! s.insert( d1, new Long(666) );
! s.insert( d2, new Long(667) );
}
s.flush();
--- 293,302 ----
}
else if (dialect instanceof HSQLDialect ) {
! s.save( d1, new Integer(666) );
! s.save( d2, new Integer(667) );
}
else {
! s.save( d1, new Long(666) );
! s.save( d2, new Long(667) );
}
s.flush();
Index: Qux.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Qux.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Qux.java 5 Nov 2002 03:44:02 -0000 1.13
--- Qux.java 5 Nov 2002 16:58:14 -0000 1.14
***************
*** 36,40 ****
created=true;
try {
! foo = (Foo) session.create(Foo.class);
}
catch (Exception e) {
--- 36,41 ----
created=true;
try {
! foo = new Foo();
! session.save(foo);
}
catch (Exception e) {
|