Home  >  Article  >  Database  >  Hibernate持久化类的原则

Hibernate持久化类的原则

WBOY
WBOYOriginal
2016-06-07 16:06:301138browse

持久化java类必须遵循的原则: 1.通常这个类需要一个id.建议一般使用封装类型 2.这个类不能是final修饰的 3.需要给这个类提供一个无参数的构造器 4.需要给所有属性提供getter/setter方法 5.如果涉及集合数据的操作,集合类型要使用接口类型,List,Map

持久化java类必须遵循的原则:
1.通常这个类需要一个id.建议一般使用封装类型
2.这个类不能是final修饰的
3.需要给这个类提供一个无参数的构造器
4.需要给所有属性提供getter/setter方法
5.如果涉及集合数据的操作,集合类型要使用接口类型,List,Map
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn