[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3388) Problem mixing implicit and explicit joins - Ok in Hib2 not in Hib3

Philippe Chaléat (JIRA) noreply at atlassian.com
Tue Jul 15 04:20:42 EDT 2008


Problem mixing implicit and explicit joins - Ok in Hib2 not in Hib3
-------------------------------------------------------------------

                 Key: HHH-3388
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3388
             Project: Hibernate3
          Issue Type: Bug
            Reporter: Philippe Chaléat


Trying to migrate a rather large app from Hibernate 2.1 to Hibernate, we face a blocking problem. With Hibernate 3, some of our queries generate invalid SQL. I found in the forum that this problem has been noticed by someone else (but no answer) :
http://forum.hibernate.org/viewtopic.php?t=963196&highlight=join+ora00904

We manage to reproduce the problem with the following query. With Hibernate 2, mixing explicit and implicit joins produced an SQL query with all "theta style" joins at the end of the query. In Hibernate 3, ANSI and "theta style" are mixed, which Oracle doesn't like.

HBM:
select a.description, a.seller, b.item.description " +
               "from org.hibernate.auction.AuctionItem a inner join a.bids b

    [java] SQL:
    [java]     select
    [java]         auctionite0_.description as col_0_0_,
    [java]         auctionite0_.seller as col_1_0_,
    [java]         auctionite3_.description as col_2_0_,
    [java]         user2_.id as id2_,
    [java]         user2_.userName as userName2_,
    [java]         user2_."password" as password3_2_,
    [java]         user2_.email as email2_,
    [java]         user2_.firstName as firstName2_,
    [java]         user2_."initial" as initial6_2_,
    [java]         user2_.lastName as lastName2_
    [java]     from
    [java]         AuctionItem auctionite0_
    [java]     inner join
    [java]         Bid bids1_
    [java]             on auctionite0_.id=bids1_.item,
    [java]         AuctionItem auctionite3_
    [java]     inner join
    [java]         AuctionUser user2_
    [java]             on auctionite0_.seller=user2_.id
    [java]     where
    [java]         bids1_.item=auctionite3_.id

Erreur:


    [java] org.hibernate.exception.SQLGrammarException: could not execute query

    [java]     at org.hibernate.exception.SQLStateConverter.convert(SQLStateCon
verter.java:67)
    [java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExcep
tionHelper.java:43)
    [java]     at org.hibernate.loader.Loader.doList(Loader.java:2216)
    [java]     at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:
2104)
    [java]     at org.hibernate.loader.Loader.list(Loader.java:2099)
    [java]     at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:37
8)
    [java]     at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslato
rImpl.java:338)
    [java]     at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryP
lan.java:172)
    [java]     at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
    [java]     at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
    [java]     at org.hibernate.auction.Main.testOracleJoins(Main.java:359)




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       




More information about the hibernate-issues mailing list