How to force Hibernate to return dates as java.util.Date instead of Timestamp?

前端 未结 7 919
天涯浪人
天涯浪人 2020-12-04 08:13

Situation:

I have a persistable class with variable of java.util.Date type:

import java.util.Date;

@Entity
@Table(name = \"prd_peri         


        
7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 08:58

    Just add the this annotation @Temporal(TemporalType.DATE) for a java.util.Date field in your entity class.

    More information available in this stackoverflow answer.

提交回复
热议问题