사용자 도구

사이트 도구


java:jpa:datetime

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
java:jpa:datetime [2019/01/14 17:19]
kwon37xi [DB DEFAULT 사용시]
java:jpa:datetime [2019/01/14 17:20]
kwon37xi
줄 34: 줄 34:
 </code> </code>
   * 해당 필드에 ''insertable=false, updatable=false'' 설정을 해준다.   * 해당 필드에 ''insertable=false, updatable=false'' 설정을 해준다.
-  * ''EntityManager.persist(), merge()'' 이후 다시 로드 하려면 ''EntityManager.refresh(entity)''를 사용한다.+  * ''EntityManager.persist(), merge()'' 이후 다시 로드 하려면 ''EntityManager.refresh(entity)''를 사용한다. 안그러면 엔티티 저장직후에 바로 사용하고자 할 때 생성/수정 시각 필드가 null이 된다.
   * [[https://www.logicbig.com/tutorials/java-ee-tutorial/jpa/refreshing.html|JPA + Hibernate - Refreshing an Entity Instance]]   * [[https://www.logicbig.com/tutorials/java-ee-tutorial/jpa/refreshing.html|JPA + Hibernate - Refreshing an Entity Instance]]
  
줄 46: 줄 46:
 ===== 참조 ===== ===== 참조 =====
   * [[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