Home > Database > Mysql Tutorial > body text

Hibernate持久化类的原则

WBOY
Release: 2016-06-07 16:06:30
Original
1146 people have browsed it

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

持久化java类必须遵循的原则:
1.通常这个类需要一个id.建议一般使用封装类型
2.这个类不能是final修饰的
3.需要给这个类提供一个无参数的构造器
4.需要给所有属性提供getter/setter方法
5.如果涉及集合数据的操作,集合类型要使用接口类型,List,Map
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!