Re: MySQL 4.0 => 5.0 - strange...
I have a similar problem (migrating from 4.0 to 5.0), but the query looks like it already uses an explicit INNER JOIN between ENUMERATEDTYPE and TYPE. The error message was:
Unknown column 'this_.TYPE_ID' in 'on clause'
Where "this_" aliases ENUMERATEDTYPE. The query below was generated using Hibernate 3.0:
select this_.TYPE_ID as TYPE1_0_, this_1_.version as version5_0_, this_1_.NAME as NAME5_0_, this_1_.description as descript4_5_0_, ( select count(*) from COMPLEXTYPE ctype where ctype.TYPE_ID = this_1_.TYPE_ID ) as formula0_0_, ( select count(*) from SIMPLETYPE stype where stype.TYPE_ID = this_1_.TYPE_ID ) as formula1_0_, ( select count(*) from ENUMERATEDTYPE etype where etype.TYPE_ID = this_1_.TYPE_ID ) as formula2_0_, ( select min(ENUMERATION.REPRESENTATION) from ENUMERATEDTYPE left join ENUMERATION on ENUMERATION.CONTAINING_ENUMERATION_ID = this_.TYPE_ID ) as formula3_0_ from ENUMERATEDTYPE this_ inner join TYPE this_1_ on this_.TYPE_ID=this_1_.TYPE_ID
Both ENUMERATEDTYPE and TYPE have TYPE_ID columns.
Thanks,
Tim Rozmajzl
tim.rozmajzl@lmco.com