From: Wolfgang J. <w....@mi...> - 2002-11-06 15:18:42
|
On Wednesday 06 November 2002 15:19, Gavin King wrote: > > Currently I have another problem with the OuterJoinGenerator: > > The SQL created by the constructor of EntityLoader is always using ' = LEFT > > OUTER JOIN' > > > even if I use the OracleOuterJoinGenerator. I've added the a log > > statement in the constructor > > > and it tells me that the sql 'select .... from foo left outer join ba= r on > >....' was created withan OracleOuterJoinGenerator???!!!? > > I'm not following properly..... > > MultiTableEntityPersister produces some SQL with "left outer join" > hardcoded, as you noted. Some refactoring is needed to fix this. But I'= m > pretty sure the SQL generation for outerjoin fetching never produces "L= EFT > OUTER JOIN" when the SQL dialect is set for Oracle. Surely you aren't > seeing this when using EntityPersister? I've added the following logging code to the constructor of EntityLoader: log.info("Built select=3D" + sql + " via " + outerJoinGenerator.getClass().getName()); and get the following while running MultiTableTest: =2E... [junit] Nov 6, 2002 3:56:24 PM cirrus.hibernate.sql.Dialect <init> [junit] INFO: Using dialect: cirrus.hibernate.sql.OracleDialect =2E... [junit] Nov 6, 2002 3:56:24 PM cirrus.hibernate.loader.OuterJoinLoade= r=20 <init> [junit] INFO: Using JoinGenerator=20 cirrus.hibernate.loader.OracleOuterJoinGenerator [junit] Nov 6, 2002 3:56:24 PM cirrus.hibernate.loader.EntityLoader <= init> [junit] INFO: Built select=3DSELECT rootc0.id_ AS id_, rootc01.amount= as=20 amount10, rootc02.extraProp as extraProp8, rootc02.other2 as other29,=20 rootc0.count_ as count_0, rootc0.name as name1, rootc0.address as address= 2,=20 rootc0.date_ as date_3 FROM rootclass rootc0 left outer join submulti=20 rootc01 on rootc0.id_=3Drootc01.sid left outer join nuthasubclass rootc02= on=20 rootc0.id_=3Drootc02.sid WHERE rootc0.id_ =3D ? via=20 cirrus.hibernate.loader.OracleOuterJoinGenerator [junit] Nov 6, 2002 3:56:24 PM=20 cirrus.hibernate.persister.MultiTableEntityPersister generateSelectString [junit] INFO: Using select=3Dselect rootclass.id_, submulti.amount as= =20 amount10, nuthasubclass.extraProp as extraProp8, nuthasubclass.other2 as=20 other29, rootclass.count_ as count_0, rootclass.name as name1,=20 rootclass.address as address2, rootclass.date_ as date_3 from rootclass,=20 submulti, nuthasubclass where rootclass.id_ =3D ? and=20 rootclass.id_=3Dsubmulti.sid (+) and rootclass.id_=3Dnuthasubclass.sid (+= ) =2E.... Maybe the SQL-code from EntityLoader is never reached, but I have no clue= ,=20 where the sql-String from EntityLoader is comming from.=20 CU --=20 Wolfgang Jung, Softwareentwickler Micromata_Objects GmbH Tel: +49 561 316793-0 Marie-Calm Strasse 1, D-34131 Kassel Fax: +49 561 316793-11 mailto:W....@mi... http://www.micromata.de |