on-internet
← Community

Cast field in JPA Query

Stack Overflow ·

In my sql-server, the field DATE are saved in float format (es: DATADOC = 42155) I want to import the field in mysql DB as DATETIME. I try on sql-server to cast the field with this query: SELECT CAST(DATDOC as DATETIME) -2 FROM FATTURE where id=25460; And the result is correct. Now, I want to translate it in JPA Query: TypedQuery<DateTime> convFattura = emI24.createQuery(" SELECT CAST(dataFattura as DATETIME) -2 FROM FatturaI24 f where f.id = :idFattura", DateTime.class); But I obtained this error: 09-06-2015 14:32:00 ERROR: org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler

Comments

Sign in or sign up to comment and upvote.

No comments yet.