作业帮 > 英语 > 作业

JPA中,field-based和property-based有什么区别啊?

来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:英语作业 时间:2024/04/28 11:54:04
JPA中,field-based和property-based有什么区别啊?
JPA中,field-based和property-based有什么区别?
请详细点!
顺便请说说这些是什么意思:
If the entity has field-based access, the persistence provider runtime accesses instance variables
directly. All non-transient instance variables that are not annotated with the Transient
annotation are persistent. When field-based access is used, the object/relational mapping annotations
for the entity class annotate the instance variables.
If the entity has property-based access, the persistence provider runtime accesses persistent
state via the property accessor methods. All properties not annotated with the Transient
annotation are persistent. The property accessor methods must be public or protected. When
property-based access is used, the object/relational mapping annotations for the entity class
annotate the getter property accessors[2].
JPA中,field-based和property-based有什么区别啊?
如果是数据库的话,好像没啥区别.