Hi,
I'm migrating my app made with Java + Spring + Hibernate + Mysql to H2. 
Unfortunally the first problem I noticed is this:

24/07/2014 09:36:30 ERROR SqlExceptionHelper:146 - Function "DATE" not 
found; SQL statement:
select comunicazi2_.id as col_0_0_ from Campagna campagna0_ left outer join 
Campagna_Comunicazione listacomun1_ on 
campagna0_.id=listacomun1_.Campagna_id left outer join Comunicazione 
comunicazi2_ on listacomun1_.listaComunicazioni_id=comunicazi2_.id where 
comunicazi2_.statoTelefonata=? and comunicazi2_.preferenzaTelefonata<>? or 
comunicazi2_.statoSms=? and comunicazi2_.preferenzaSms<>? or 
comunicazi2_.statoEmail=? and comunicazi2_.preferenzaEmail<>? and 
DATE(dataProgrammata)<=DATE(now()) order by 
comunicazi2_.tentativiTelefonata ASC [90022-180]

I'm using a typed query:

String sql = "SELECT msg.id FROM Campagna c LEFT JOIN c.listaComunicazioni 
msg WHERE (msg.statoTelefonata=:statoTelefonata AND 
msg.preferenzaTelefonata <> :preferenzaTelefonata) OR 
(msg.statoSms=:statoSms AND msg.preferenzaSms <> :preferenzaSms) OR 
(msg.statoEmail=:statoEmail AND msg.preferenzaEmail <> :preferenzaEmail) 
AND DATE(dataProgrammata)<=DATE(NOW()) ORDER BY msg.tentativiTelefonata 
ASC";
        TypedQuery<Long> query = entityManager.createQuery(sql, Long.class);

I tought that using Hsql this kind of problems was managed by Hibernate.

Any hint?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to