Philippe Gioseffi
Philippe Gioseffi

Reputation: 1658

How to reference java.time.LocalDate in hbm file?

How to reference java.time.LocalDate type in a *hbm.xml file? I tried type="localdate" and it didn't work. Unfortunatelly it is not allowed to use annotations in this project to map entities.

The question How to persist LocalDate into Hibernate as a Date type does not answer my question because when I use type="date" hibernate maps it to java.util.Date instead.

Upvotes: 1

Views: 546

Answers (1)

Ryuzaki L
Ryuzaki L

Reputation: 39998

From docs and if you are using 5.2 you should able to map using LocalDate or java.time.LocalDate

<property name="date" column="tb_date" type="LocalDate" /> 

Upvotes: 1

Related Questions