When I switch the HQL to the 2.* format I get an error that I did not get when I used the Hibernate 1.* style HQL.
The (2.*) HQL:
Code:
select CDB_PORTFOLIO
from com.kbcam.core.entity.Portfolio CDB_PORTFOLIO
join CDB_PORTFOLIO.portfoliotocustomers portfoliotocustomers
where portfoliotocustomers.customerid = ?
order by CDB_PORTFOLIO.description asc
The resultant SQL (from show_sql=true in hibernate.properties)
Code:
select portfoli0_.portfolioid as portfolioid,
portfoli0_.currencyid as currencyid,
portfoli0_.managerstaffid as managers3_,
portfoli0_.portfoliostructureid as portfoli4_,
portfoli0_.schemetypeid as schemety5_,
portfoli0_.portfoliotypeid as portfoli6_,
portfoli0_.schememandatetypeid as schemema7_,
portfoli0_.portfoliostatusid as portfoli8_,
portfoli0_.description as descript9_
from CDB_PORTFOLIO portfoli0_
inner join CDB_PORTFOLIO_TO_CUSTOMER portfoli1_ on portfoli0_.portfolioid=portfoli1_.portfolioid
where (portfoli1_.customerid=? )
order by portfoli0_.description asc
The error:
Code:
Incorrect syntax near 'inner'.
I'm using the JConnect driver for Sybase against a Sybase 11.9.2 database on NT.
Should the SQL syntax above work with most JDBC2 drivers (or have I ballsed it up)??
I'm not familiar with using the "inner join" mechanism in the SQL above.. this was not being produced when I used the old 1.* style HQL.