---
title: "hibernate AccessType"
author: "wangbing9577"
date: "2014-12-26T17:58:37Z"
tags: []
categories: ["开源软件"]
slug: "hibernate-accesstype"
draft: false
lastmod: "2014-12-26T17:58:37Z"
id: 2170449
url: "https://wangbing9577.iteye.com/blog/2170449"
---

hibernate的AccessType表示hibernate怎样访问域对象中的属性值。

取值有：field ¦property ¦ClassName"  
field：即绕过get/set方法，直接使用反射访问字段属性;getter和setter的话，就可以不用写了。 这时，可以设置属性为不可变，可以不用执行脏检查。
默认使用property：即使用get/set 方法访问属性；这种方式可以在getter和setter中做额外的处理。
ClassName：是指使用实现了org.hibernate.property.PropertyAccessor接口的类的具体策略来访问字段属性