zoukankan      html  css  js  c++  java
  • 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;  }

    }

  • 相关阅读:
    LoadRunner脚本转化成Jmeter脚本
    LoadRunner场景运行错误解决方法
    IntelliJ IDEA lombok插件的安装和使用
    js瀑布流加载数据
    js获取浏览器高度和宽度值(多浏览器 图解经典) 转载
    MPMoviePlayerViewController和MPMoviePlayerController
    NSString的内存管理问题
    cocos2D icon
    Singleton 单例模式
    Cocos2d中各种坐标位置关系
  • 原文地址:https://www.cnblogs.com/1446358788-qq/p/8067203.html
Copyright © 2011-2022 走看看