티스토리 툴바



2007/12/26 14:55

Hibernate 기초 학습[6] - AccessType / fomula

2007. 12. 26 update.
기선형의 얘기를 듣고 다시 확인해 봄.
AccessType을 filed로 할 경우, 굳이 필드에 대한 getter/setter를 만들지 않아도 된다. 단, 만들지 않아도 된다는 것이지, getter/setter가 필요하냐는 논외의 문제이다. 해당 엔티티 개체의 활용 범위(용도)에 따라서 결정을 해야지, 옵션의 사용에 따라 결정할 문제는 아니라 생각한다.

# AccessType
   - 설정 방법
1. <hibernate-mapping default-access="field|property|ClassName" >

2. <property access="field|property|ClassName" >

3. (Annotation) @AccessType("field|property|ClassName")

   - "property" 옵션을 사용할 경우
the Access-Type("property") annotation on a field switches this particular attribute to
runtime access through property getter/setter methods.

   - "filed" 옵션을 사용할 경우
the AccessType("field") annotation on a getter method switches this particular attribute
to runtime access through a field of the same name.


# fomula
   - sub-element로 column element를 가질 수 없다.
   - INSERT, UPDATE할 수 없으며, 오로지 SELECT만 가능.
   - 프로젝트에서 사용하고 있는 DBMS에 종속된(vendor-specific)한 문법 사용 가능.
   - subselect 문 사용 가능    

example


크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 0