Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to use LocalDate and LocalDateTime in JPA
How to use LocalDate and LocalDateTime in JPA
@ Converter (Auto Apply = True)

The public class localdatetimeattributeconverter implements attributeconverter & ltlocaldatetime with timestamp & gt{

@ Overlay

public Timestamp convertToDatabaseColumn(local datetime loc datetime){

return (locDateTime == null? null:timestamp . value of(loc datetime));

}

@ Overlay

Public local datetime converttoentityattribute (SQL timestamp) (

return (sqlTimestamp == null? null:sqltimestamp . tolocaldatetime());

}

}