I tried this using session.find()
Quote:
select band from AreaSet a join fetch a.bands band where a.id=1
and it seemed to execute the correct SQL query using
Code:
select bands1_.bnd_id as bnd_id0_, bands1_.bnd_id as bnd_id1_, bands1_.ast_id as ast_id0_, bands1_.bdt_id as bdt_id0_, bands1_.bnd_delete_fl as bnd_dele4_0_, bands1_.bnd_external_reference as bnd_exte5_0_, bands1_.bnd_name as bnd_name0_, bands1_.bnd_point_to_point_fl as bnd_poin7_0_, bands1_.cmp_id as cmp_id0_, bands1_.ets_code as ets_code0_, bands1_.trb_id as trb_id0_, bands1_.ast_id as ast_id1_, bands1_.bdt_id as bdt_id1_, bands1_.bnd_delete_fl as bnd_dele4_1_, bands1_.bnd_external_reference as bnd_exte5_1_, bands1_.bnd_name as bnd_name1_, bands1_.bnd_point_to_point_fl as bnd_poin7_1_, bands1_.cmp_id as cmp_id1_, bands1_.ets_code as ets_code1_, bands1_.trb_id as trb_id1_, bands1_.bnd_id as bnd_id__, bands1_.ast_id as ast_id__ from area_set areaset0_ inner join band bands1_ on areaset0_.ast_id=bands1_.ast_id where (areaset0_.ast_id=1 )
but this returned an array of empty array objects.
ie an ArrayList containing 516 java.lang.Object[ 0 ]
which is obviously not the correct result.
and then when I call tx.commit() to commit my transaction I get the following in the console output:
Code:
update band set ast_id=null where ast_id=?
Any ideas why this is happening?
Cheers.
Myk.