From: <one...@us...> - 2003-01-24 13:07:24
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv9385/sf/hibernate/test Modified Files: Multi.hbm.xml MultiTableTest.java Log Message: fixed bug in generated SQL for loading <joined-subclass>es Index: Multi.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Multi.hbm.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Multi.hbm.xml 1 Jan 2003 13:57:11 -0000 1.1.1.1 --- Multi.hbm.xml 24 Jan 2003 13:07:17 -0000 1.2 *************** *** 1,4 **** <?xml version="1.0"?> ! <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-1.1.dtd" > <hibernate-mapping> --- 1,4 ---- <?xml version="1.0"?> ! <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> *************** *** 13,16 **** --- 13,20 ---- <property name="date" column="date_"/> + <joined-subclass name="net.sf.hibernate.test.TrivialClass"> + <key column="tcid"/> + </joined-subclass> + <joined-subclass name="net.sf.hibernate.test.LessSimple" table="leafsubclass"> <key column="id__"/> *************** *** 20,28 **** <many-to-one name="yetanother" column="other3" class="net.sf.hibernate.test.LessSimple"/> <property name="foo"/> ! <set role="set" lazy="false"> <key column="parent"/> <one-to-many class="net.sf.hibernate.test.Simple"/> </set> ! <bag role="bag" lazy="true" table="simple_simple"> <key column="simple1"/> <many-to-many column="simple2" class="net.sf.hibernate.test.Simple"/> --- 24,32 ---- <many-to-one name="yetanother" column="other3" class="net.sf.hibernate.test.LessSimple"/> <property name="foo"/> ! <set name="set" lazy="false"> <key column="parent"/> <one-to-many class="net.sf.hibernate.test.Simple"/> </set> ! <bag name="bag" lazy="true" table="simple_simple"> <key column="simple1"/> <many-to-many column="simple2" class="net.sf.hibernate.test.Simple"/> *************** *** 45,49 **** <key column="sid"/> <property name="amount"/> ! <bag role="children" lazy="true" readonly="true"> <key column="parent"/> <one-to-many class="net.sf.hibernate.test.SubMulti"/> --- 49,53 ---- <key column="sid"/> <property name="amount"/> ! <bag name="children" lazy="true" inverse="true"> <key column="parent"/> <one-to-many class="net.sf.hibernate.test.SubMulti"/> *************** *** 61,70 **** </id> <property name="value"/> ! <list role="list" cascade="all"> <key column="list_po"/> <index column="i"/> <one-to-many class="net.sf.hibernate.test.SubMulti"/> </list> ! <set role="set" readonly="true" cascade="all"> <key column="po"/> <one-to-many class="net.sf.hibernate.test.Multi"/> --- 65,74 ---- </id> <property name="value"/> ! <list name="list" cascade="all"> <key column="list_po"/> <index column="i"/> <one-to-many class="net.sf.hibernate.test.SubMulti"/> </list> ! <set name="set" inverse="true" cascade="all"> <key column="po"/> <one-to-many class="net.sf.hibernate.test.Multi"/> Index: MultiTableTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/MultiTableTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MultiTableTest.java 20 Jan 2003 12:48:14 -0000 1.4 --- MultiTableTest.java 24 Jan 2003 13:07:17 -0000 1.5 *************** *** 24,27 **** --- 24,34 ---- public void testQueries() throws Exception { Session s = sessions.openSession(); + s.save( new TrivialClass(), new Long(1) ); + s.flush(); + s.connection().commit(); + s.close(); + s = sessions.openSession(); + TrivialClass tc = (TrivialClass) s.load( TrivialClass.class, new Long(1) ); + s.find("from s in class TrivialClass where s.id = 2"); s.find("select s.count from s in class Simple"); s.find("from s in class LessSimple where s.another.name='name'"); *************** *** 32,35 **** --- 39,45 ---- s.iterate("from s in class LessSimple"); s.iterate("from s in class Simple"); + s.delete(tc); + s.flush(); + s.connection().commit(); s.close(); } |