Timestamped 클래스에 있는 createAt이 LocalDate 타임으로 되어 있어서
날짜만 표시되고 시간이 표시가 안됐다 그래서
LocalDate 에서 LocalDateTime으로 변경했는데
h2 db에 데이터를 지우고 계속 등록해도 LocalDate 으로 반영이 됐다.
이유는
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
datasource:
#url: jdbc:h2:mem:testdb
url: jdbc:h2:./myselectdb;AUTO_SERVER=TRUE
driver-class-name: org.h2.Driver
username: sa
password:
h2:
console:
enabled: true
settings:
web-allow-others: true # h2 config
jpa:
show-sql: true
hibernate:
ddl-auto: update
properties:
hibernate:
format_sql: true
generate-ddl: true
output:
ansi:
enabled: always
logging:
level:
org.hibernate.type: trace
application.yml 파일에서
ddl-auto가 update 였는데 create-drop 으로 변경했다.
그리고 데이터를 등록하면 LocalDate가 LocaDateTime으로 변경되어있다.
하지만 ddl-auto를 create-drop으로 하면
프로그램을 재실행하면 데이터가 날아간다
그러므로 프로그램을 재실행해도 데이터를 유지하려면
다시 ddl-auto를 update로 변경했다.