Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
715 views
in Technique[技术] by (71.8m points)

jpa - Date literals in Hibernate

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...