0 Replies Latest reply on Feb 19, 2009 9:26 AM by domenico porto

    Hibernate query not smart!

    domenico porto Newbie

      Hi all.
      I have a query automatically generate by Hibernate derived from different classes often mapped on the same Oracle table.
      The problem is that I obtain something like this:

      select * from A action0_
      left outer join
      B action0_1_
      on action0_.TRANS_ID=action0_1_.TRANS_ID
      left outer join
      C action0_2_
      on action0_.TRANS_ID=action0_2_.TRANS_ID
      left outer join
      C action0_3_
      on action0_.TRANS_ID=action0_3_.TRANS_ID
      left outer join
      C action0_4_
      on action0_.TRANS_ID=action0_4_.TRANS_ID

      The same table is outer joined 3 times. This drammatically reduce the query performance.
      There is a way to indicate to Hibernate to generate better queries where different classes use the same Oracle tables or I have to work only on the mapping to avoid situation like this?
      Thank you.
      Best regards from Italy,