Date literals in Hibernate

2019-01-26 12:39发布

I wonder how to use date literals in Hibernate query language. I did as follows in my JPA project (as Eclipselink the provider) and it works.

SELECT m FROM Me m WHERE m.dob <= {d '1984-10-06'}

But this does not work when I change Hibernate (V 3.6.7) as the provider for my JPA project.

1条回答
Deceive 欺骗
2楼-- · 2019-01-26 13:08

The reference documentation says:

Expressions used in the where clause include the following:
[...]

  • SQL literals 'foo', 69, 6.66E+2, '1970-01-01 10:00:01.0'
查看更多
登录 后发表回答