当我尝试保留 LocalDate 列时出现以下错误。该错误仅在字段为空时发生。publish_date 列在数据库中属于 Date 类型。
我检查了Bug 535431和Bug 546312,显然这个问题应该已经在 2.7.6 版本中得到解决,但它仍然在发生。
错误:
Caused by: org.postgresql.util.PSQLException: ERROR: column "publish_date" is of type date but expression is of type character varying
实体:
@Entity
@Table(name = "book")
public class Book {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "publish_date")
private LocalDate publishDate;
...