Hi,
Currently we have a working application running on PostgreSQL, we are trying to port the application to SQLServer and have run into some problems regarding composit primary keys.
It seems that the SQLServerDialect uses SQL syntax that SQLServer can not understand, following is two examples:
HQL:
--------------------------------------------------------------
select
cf
from
Classification as cf
where
cf.id in (:ids)
SQL:
--------------------------------------------------------------
select
cf.cfClassId as cfClassId61_,
cf.cfClassSchemeId as cfClassS6_61_,
cf.cfEndDate as cfEndDate61_,
cf.cfSeq as cfSeq61_,
cf.cfStartDate as cfStartD4_61_,
cf.cfURI as cfURI61_
from
cfClass cf
where
(cf.cfClassId, cf.cfClassSchemeId) in ( (10, 10) )
HQL:
--------------------------------------------------------------
select
count( cf )
from
Classification as cf
where
cf.uri in (:v1)
SQL:
--------------------------------------------------------------
select count((cf.cfClassId, cf.cfClassSchemeId)) as col_0_0_
from
cfClass cf
where
cf.cfURI in ( ? )
In both cases I get the following error from SQLServer:
SQL Error: 102, SQLState: S1000
Incorrect syntax near ','.
I was hoping that I was using an old SQLServer dialect, but I cannot seem to find any newer. Any ideas as to what is going wrong?
ps. Using Hibernate 3.2.2
_________________ --
Bo Gundersen
|