사용자 도구

사이트 도구


java:hibernate:usertype

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
java:hibernate:usertype [2016/09/18 17:18]
kwon37xi [Hibernate User Type]
java:hibernate:usertype [2018/10/24 10:26] (현재)
kwon37xi
줄 1: 줄 1:
 ====== Hibernate User Type ====== ====== Hibernate User Type ======
   * ''UserType'', ''ParameterizedType'' 을 통해 사용자 정의 타입을 만들 수 있다.   * ''UserType'', ''ParameterizedType'' 을 통해 사용자 정의 타입을 만들 수 있다.
 +  * [[https://github.com/vladmihalcea/hibernate-types|vladmihalcea/hibernate-types: The Hibernate Types repository gives you extra types that are not supported by the Hibernate ORM core.]]
   * [[java:hibernate:usertype:generic_enum|Hibernate Generic Enum UserType]]   * [[java:hibernate:usertype:generic_enum|Hibernate Generic Enum UserType]]
   * [[java:hibernate:usertype:stringdate|StringDate Hibernate UserType]]   * [[java:hibernate:usertype:stringdate|StringDate Hibernate UserType]]
줄 41: 줄 42:
  
 </code> </code>
 +
 ===== Primary Key ===== ===== Primary Key =====
   * Primary Key(Identifier)나  Descriminator(상속관계에서 구분자?)로 사용할 Custom Type은 ''org.hibernate.usertype.EnhancedUserType''를 구현해야 한다.   * Primary Key(Identifier)나  Descriminator(상속관계에서 구분자?)로 사용할 Custom Type은 ''org.hibernate.usertype.EnhancedUserType''를 구현해야 한다.
 +
 +===== java.time.Year, java.time.Month =====
 +  * [[https://vladmihalcea.com/java-time-year-month-jpa-hibernate/|How to map java.time.Year and java.time.Month with JPA and Hibernate - Vlad Mihalcea]]
 +  * 기본적으로는 JPA ''AttributeConverter''를 사용한다.
 +  * Hibernate 사용시에는 ''AbstractSingleColumnStandardBasicType''와 ''AbstractTypeDescriptor''로 처리 가능하다. 이에 관한 예제.
 +
 +===== 참고 =====
 +  * [[https://www.baeldung.com/hibernate-custom-types|Custom Types in Hibernate | Baeldung]]
  
java/hibernate/usertype.1474188512.txt.gz · 마지막으로 수정됨: 2016/09/18 17:18 저자 kwon37xi