사용자 도구

사이트 도구


java:hibernate:annotations

문서의 이전 판입니다!


Hibernate Annotations

하이버네이트 전용 어노테이션들

@org.hibernate.annotations.ForeignKey

  • JPA 2.1 에서 부터 @JoinColumn(foreinKey=@ForeinKey…) 표준이 생겨서 더이상 이 애노테이션은 불필요하다.
  • @org.hibernate.annotations.ForeignKey(name=“fk_parent_id_child”) : 객체간의 연과을 맺을 때 FK 인덱스의 이름을 명시해준다.
  • 이를 명시하지 않으면 FK숫자여러개지정으로 된다.
  • @org.hibernate.annotations.ForeignKey(name=“none”) : name=“none”은 FK를 강제로 못 맺게 한다. Forcing hbm2ddl to not generate an FK

@org.hibernate.annotations.ColumnTransformer

@Column
@ColumnTransformer(read = “pgp_sym_decrypt(creditCardNumber, ‘mySecretKey’)”, write = “pgp_sym_encrypt(?, ‘mySecretKey’))
private String creditCardNumber;

@org.hibernate.annotations.DynamicInsert

@org.hibernate.annotations.DynamicUpdate

@org.hibernate.annotations.Immutable

  • Entity나 immutable로 지정하면 수정이 작동하지 않게 된다.
  • Collection을 immutable로 지정하면 추가나 삭제가 작동하지 않게 된다.

@org.hibernate.annotations.OptimisticLocking

@org.hibernate.annotations.Persister

@org.hibernate.annotations.Polymorphism

@org.hibernate.annotations.SelectBeforeUpdate

java/hibernate/annotations.1530228237.txt.gz · 마지막으로 수정됨: 2018/06/29 08:23 저자 kwon37xi