Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory sc8-pr-cvs1:/tmp/cvs-serv6163/cirrus/hibernate/test
Modified Files:
ABCProxyTest.java ABCTest.java Bar.java FooBar.hbm.xml
FooBarTest.java Holder.java MultiTableTest.java
Log Message:
load(id, lockMode) now working for MultiTableEntityPersister
some new tests
Index: ABCProxyTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/ABCProxyTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ABCProxyTest.java 25 Oct 2002 19:10:39 -0000 1.2
--- ABCProxyTest.java 20 Nov 2002 10:30:45 -0000 1.3
***************
*** 15,19 ****
}
! public void testCollectionQuery() throws Exception {
Session s = sessions.openSession();
Transaction t = s.beginTransaction();
--- 15,19 ----
}
! public void testSubclassing() throws Exception {
Session s = sessions.openSession();
Transaction t = s.beginTransaction();
Index: ABCTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/ABCTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ABCTest.java 18 Oct 2002 15:16:11 -0000 1.1
--- ABCTest.java 20 Nov 2002 10:30:45 -0000 1.2
***************
*** 15,19 ****
}
! public void testCollectionQuery() throws Exception {
Session s = sessions.openSession();
Transaction t = s.beginTransaction();
--- 15,19 ----
}
! public void testSubclassing() throws Exception {
Session s = sessions.openSession();
Transaction t = s.beginTransaction();
***************
*** 28,31 ****
--- 28,34 ----
d.setId( c1.getId() );
s.save(d);
+
+ assertTrue( s.find("from c in class C2 where 1=1 or 1=1").size()==0 );
+
t.commit();
s.close();
Index: Bar.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Bar.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Bar.java 10 Jun 2002 15:31:25 -0000 1.10
--- Bar.java 20 Nov 2002 10:30:45 -0000 1.11
***************
*** 2,6 ****
package cirrus.hibernate.test;
! public class Bar extends Abstract implements BarProxy {
private String barString;
private FooComponent barComponent = new FooComponent("bar", 69, null, null);
--- 2,6 ----
package cirrus.hibernate.test;
! public class Bar extends Abstract implements BarProxy, Named {
private String barString;
private FooComponent barComponent = new FooComponent("bar", 69, null, null);
***************
*** 29,32 ****
--- 29,42 ----
public void setBaz(Baz baz) {
this.baz = baz;
+ }
+
+ public String name = "bar";
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
}
Index: FooBar.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBar.hbm.xml,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** FooBar.hbm.xml 29 Oct 2002 16:09:05 -0000 1.16
--- FooBar.hbm.xml 20 Nov 2002 10:30:45 -0000 1.17
***************
*** 121,124 ****
--- 121,125 ----
<column name="bar_string" length="24"/>
</property>
+ <property name="name" column="name_name"/>
<component name="barComponent" class="cirrus.hibernate.test.FooComponent">
<parent name="parent"/>
Index: FooBarTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v
retrieving revision 1.222
retrieving revision 1.223
diff -C2 -d -r1.222 -r1.223
*** FooBarTest.java 19 Nov 2002 15:28:07 -0000 1.222
--- FooBarTest.java 20 Nov 2002 10:30:45 -0000 1.223
***************
*** 513,516 ****
--- 513,517 ----
baz.getOnes().remove(o);
s.delete("from o in class cirrus.hibernate.test.One");
+ s.delete(h);
s.flush();
s.connection().commit();
***************
*** 820,828 ****
assertTrue( !rs.hasNext() );
! System.out.println( s.find("from o in class java.lang.Object") );
! System.out.println( s.find("from n0 in class Named, n1 in class Named where n0.name = n1.name") );
iter = s.iterate("from o in class java.lang.Object");
! while ( iter.hasNext() ) System.out.print( ":" + iter.next() );
! System.out.println();
s.iterate("select baz.code, min(baz.count) from baz in class Baz group by baz.code");
--- 821,853 ----
assertTrue( !rs.hasNext() );
! s.save( new Holder("ice T") );
! s.save( new Holder("ice cube") );
!
! assertTrue( s.find("from o in class java.lang.Object").size()==15 );
! System.out.println( s.find("from n in class Named") );
! assertTrue( s.find("from n in class Named").size()==7 );
! assertTrue( s.find("from n in class Named where n.name is not null").size()==4 );
! iter = s.iterate("from n in class Named");
! while ( iter.hasNext() ) {
! assertTrue( iter.next() instanceof Named );
! }
!
! s.save( new Holder("bar") );
! iter = s.iterate("from n0 in class Named, n1 in class Named where n0.name = n1.name");
! int cnt = 0;
! while ( iter.hasNext() ) {
! Object[] row = (Object[]) iter.next();
! if ( row[0]!=row[1] ) cnt++;
! }
! assertTrue(cnt==2);
! assertTrue( s.find("from n0 in class Named, n1 in class Named where n0.name = n1.name").size()==7 );
!
iter = s.iterate("from o in class java.lang.Object");
! int c = 0;
! while ( iter.hasNext() ) {
! iter.next();
! c++;
! }
! assertTrue(c==16);
s.iterate("select baz.code, min(baz.count) from baz in class Baz group by baz.code");
***************
*** 837,841 ****
s.delete(other);
s.delete(foo);
!
s.flush();
s.connection().commit();
--- 862,866 ----
s.delete(other);
s.delete(foo);
! s.delete("from h in class Holder");
s.flush();
s.connection().commit();
Index: Holder.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Holder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Holder.java 15 Oct 2002 03:36:10 -0000 1.2
--- Holder.java 20 Nov 2002 10:30:45 -0000 1.3
***************
*** 10,13 ****
--- 10,20 ----
private Set foos;
private String name;
+
+ public Holder() {
+ }
+ public Holder(String name) {
+ this.name=name;
+ }
+
/**
* Returns the fooArray.
Index: MultiTableTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/MultiTableTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** MultiTableTest.java 5 Nov 2002 10:42:52 -0000 1.10
--- MultiTableTest.java 20 Nov 2002 10:30:45 -0000 1.11
***************
*** 98,101 ****
--- 98,109 ----
s = sessions.openSession();
t = s.beginTransaction();
+ multi = (Multi) s.load( Simple.class, new Long(123), LockMode.UPGRADE );
+ simp = (Simple) s.load( Simple.class, new Long(1234) );
+ s.lock(simp, LockMode.UPGRADE_NOWAIT);
+ t.commit();
+ s.close();
+
+ s = sessions.openSession();
+ t = s.beginTransaction();
s.update( multi, new Long(123) );
s.delete(multi);
|