Entity层简介及配置

来源:互联网 发布:犀牛软件图标 编辑:程序博客网 时间:2024/05/24 07:38

Entity层是什么

entity实体层,放置一个个实体,及其相应的set、get方法。如果想要对数据库进行一些操作(比如说读取)的话,就要先写entity层。

怎么写Entity

1.理解业务需求,分析需要从数据库中读取哪些字段;
2.根据这些字段写对应属性,写完后[自动生成get、set方法]。(http://blog.csdn.net/weixin_38703170/article/details/77366887)
放一段我写的代码:

public class AccountEntity extends CoreEntity implements Serializable{    private String nccode;    /**     * @return the nccode     */    public String getNccode() {        return nccode;    }    /**     * @param nccode the nccode to set     */    public void setNccode(String nccode) {        this.nccode = nccode;    }}

如何在xml文件中配置Entity

原创粉丝点击