geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay D. McHugh" <jaydmch...@gmail.com>
Subject Re: JPA issue
Date Wed, 03 Sep 2008 18:57:47 GMT
What database are you using and can we see the code for your entity class?

Also, what version of Geronimo are you running?

Jay

ericp56 wrote:
> Hello,
> 
> 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)*/, 
> t0.field2 
> 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?

Mime
View raw message