geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ericp56 <>
Subject JPA issue
Date Wed, 03 Sep 2008 17:43:18 GMT


I have a large table with a varchar(16) PK field.  Using Geronimo JPA, the
query being generated by JPA is something like: 

declare @P0  nvarchar(4000)
select @P0 = '1234567890'
SELECT t0.field1 /*THE PK FIELD which is varchar(16)*/, 
FROM dbo.history t0  WHERE t0.field1 = @P0

Instead of using the index (seek) , the conversion of varchar(16) to
nvarchar(4000) causes a full index scan, which is painfully slow (2 seconds,
should be in milliseconds).

I tried using the @Column annotation, but that didn't change anything - @P0
is still nvarchar(4000)
I tried using a named query, but it only allows basic SQL.
I tried a native query, but the casting of the result  fails.

Any suggestions?
View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message