Hi, I'm writting hql querys by joining bits of Strings as in a puzzle.
The following hql query:
Code:
select typ0.codnum, inc0.id, typ1.id, inc0.state, inc0.originCode, inc0.priorCode from attend.entity.Typology as typ0 , attend.entity.Incident as inc0 left join inc0.type as typ1 where inc0.type.code = typ0.code order by typ0.codnum asc
it's beeing translated into SQL as:
Code:
select typology0_.typ_codnum as x0_0_, incident1_.inc_inccod as x1_0_, typology2_.typ_typcod as x2_0_, incident1_.inc_incstt as x3_0_, incident1_.inc_ogncod as x4_0_, incident1_.inc_prtcod as x5_0_ from hk_typology typology0_, hk_incident incident1_ left outer join hk_typology typology2_ on incident1_.inc_inctyp=typology2_.typ_typcod where (typology2_.typ_typcod=typology0_.typ_typcod and ) order by typology0_.typ_codnum asc
The where clause:
where (typology2_.typ_typcod=typology0_.typ_typcod and ) is obviously wrong. Gives me an error such as:
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Line 1: Incorrect syntax near ')'.Please, tell me wether this is my hql query's fault or an hibernate translation problem.
Note that i'm using SQLServer 2000 with the following hibernate.properties:
Code:
hibernate.dialect net.sf.hibernate.dialect.SybaseDialect
hibernate.connection.driver_class = com.microsoft.jdbc.sqlserver.SQLServerDriver
hibernate.connection.url = jdbc:microsoft:sqlserver://SINFW31:1433;database=attend;SelectMethod=cursor
hibernate.connection.username = ++++++
hibernate.connection.password = ++++++
hibernate.connection.pool_size = 2
hibernate.show_sql true
hibernate.jddbc.use_scrollable_resultset true
Thank you very much in advanced!