SSH框架之VO配置

SSH框架搭建配置在本人博客里面已经有记载,在前面的配置文件下面,进行下面的代码测试:
两个VO类:

package cn.itcast.oa.domain;
/**
 * 岗位
 * @author liusen
 *
 */
public class Role {
  private Long id;
  private String name;
  private String description;
public Long getId() {
    return id;
}
public void setId(Long id) {
    this.id = id;
}
public String getName() {
    return name;
}
public void setName(String name) {
    this.name = name;
}
public String getDescription() {
    return description;
}
public void setDescription(String description) {
    this.description = description;
}

}
package cn.itcast.oa.domain;

public class Student {
    private Long id;
    private String name;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
package cn.itcast.oa.domain;

public class User {
    private Long id;
    private String name;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}

两个vo类对应的hibernate配置文件

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="cn.itcast.oa.domain">

    <class name="Role" table="itcast_role">
        <id name="id">
            <generator class="native"/>
        </id>
        <property name="name" />
        <property name="description" />
    </class>

</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="cn.itcast.oa.domain">

    <class name="User" table="itcast_user">
        <id name="id">
            <generator class="native"/>
        </id>
        <property name="name" />
    </class>

</hibernate-mapping>
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页