hibernate课程 初探单表映射1-8 hibernate持久化类
java beans 的设计原则
1 公有的类
2 共有不带参数构造方法
3 私有属性
4 属性setter/getter方法
Studnet类:
package com.ddwei.student;
import java.util.Date;
public class Student {
// java beans 的设计原则 /** * 1 公有的类 2 共有不带参数构造方法 3 私有属性 4 属性setter/getter方法 */
private int pid;// 学号 private String name;// 姓名 private String sex;// 性别 private Date birthday;// 出生日期 private String address;// 家庭地址
public Student() {
}
public Student(int pid, String name, String sex, Date birthday, String address) { // super(); this.pid = pid; this.name = name; this.sex = sex; this.birthday = birthday; this.address = address; }
@Override public String toString() { return "Student [pid=" + pid + ", name=" + name + ", sex=" + sex + ", birthday=" + birthday + ", address=" + address + "]"; }
public int getPid() { return pid; }
public void setPid(int pid) { this.pid = pid; }
public Date getBirthday() { return birthday; }
public void setBirthday(Date birthday) { this.birthday = birthday; }
public String getAddress() { return address; }
public void setAddress(String address) { this.address = address; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public String getSex() { return sex; }
public void setSex(String sex) { this.sex = sex; }
}
最新文章
- PHP中explode和implode的区别
- ASP.NET MVC3中Controller与View之间的数据传递
- android-文件存储的使用
- android 发短信
- php + Redis 写的类似于新浪微博的feed系统
- 基于Extjs的web表单设计器 第四节——控件拖放
- nyoj 19擅长排列的小明 (DFS)
- LinkedIn高级分析师王益:大数据时代的理想主义和现实主义(图灵访谈)
- 功率和dB的关系
- windows nfs server for linux
- http层负载均衡之haproxy
- sqlclr创建表值函数案例
- iOS学习笔记(十六)——数据库操作(使用FMDB)
- java对象引用-要掌握的细节
- 自动生成材质Material(Unity3D开发之十九)
- Kali Linux中下载工具Axel的安装和使用
- Flutter去除右上角Debug标签
- PAT (Basic Level) Practise - 写出这个数
- WebGL 颜色与纹理
- JS浮点数运算