사용자 도구

사이트 도구


java:jpa:datetime

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
java:jpa:datetime [2019/01/14 17:19]
kwon37xi [DB DEFAULT 사용시]
java:jpa:datetime [2019/08/13 09:55]
kwon37xi [Hibernate 의 CreationTimestamp, UpdateTimestamp]
줄 16: 줄 16:
   * [[https://thoughts-on-java.org/persist-creation-update-timestamps-hibernate/|How to persist creation and update timestamps with Hibernate]]   * [[https://thoughts-on-java.org/persist-creation-update-timestamps-hibernate/|How to persist creation and update timestamps with Hibernate]]
   * [[java:hibernate|Hibernate]]의 [[https://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/annotations/CreationTimestamp.html|@CreationTimestamp]], [[https://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/annotations/UpdateTimestamp.html|@UpdateTimestamp]]를 사용하는 것이 좋겠다.   * [[java:hibernate|Hibernate]]의 [[https://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/annotations/CreationTimestamp.html|@CreationTimestamp]], [[https://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/annotations/UpdateTimestamp.html|@UpdateTimestamp]]를 사용하는 것이 좋겠다.
 +  * [[https://hibernate.atlassian.net/browse/HHH-11096|[HHH-11096] @CreationTimestamp doesn't works with @Column(nullable=false) - Hibernate JIRA]] ''nullable=false''일때 오류 발생하는 버그 있음. 5.4에서 해결된 듯.
 <code java> <code java>
 @Column @Column
줄 43: 줄 43:
   * https://bitbucket.org/montanajava/jpaattributeconverters   * https://bitbucket.org/montanajava/jpaattributeconverters
   * [[http://jadira.sourceforge.net/usertype-userguide.html|Jadira Java 8 DateTime/JodaTime Hibernate  usertype]]   * [[http://jadira.sourceforge.net/usertype-userguide.html|Jadira Java 8 DateTime/JodaTime Hibernate  usertype]]
 +
 +===== Java 8 Year Month =====
 +  * [[https://vladmihalcea.com/java-yearmonth-jpa-hibernate/|How to map the Java YearMonth type with JPA and Hibernate]]
 +  * [[https://vladmihalcea.com/java-time-year-month-jpa-hibernate/|How to map java.time.Year and java.time.Month with JPA and Hibernate]]
 +  * [[https://thoughts-on-java.org/hibernate-tips-how-to-map-java-time-year-with-jpa-and-hibernate/|Hibernate Tips: How to Map java.time.Year with JPA and Hibernate]]
 +  * ''YearMonth'', ''Year'', ''Month'' 는 ''AttributeConverter'' 만들어야 함.
  
 ===== 참조 ===== ===== 참조 =====
   * [[https://www.baeldung.com/hibernate-date-time|Hibernate – Mapping Date and Time | Baeldung]]   * [[https://www.baeldung.com/hibernate-date-time|Hibernate – Mapping Date and Time | Baeldung]]
 +  * [[https://vladmihalcea.com/how-to-store-date-time-and-timestamps-in-utc-time-zone-with-jdbc-and-hibernate/|How to store date, time, and timestamps in UTC time zone with JDBC and Hibernate - Vlad Mihalcea]]
java/jpa/datetime.txt · 마지막으로 수정됨: 2021/10/07 21:59 저자 kwon37xi