zoukankan      html  css  js  c++  java
  • spring_150910_hibernate_id_auto

    package com.spring.model;
    
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.Table;
    
    @Entity
    @Table(name="t_dog")
    public class DogPet {
        
        private int id;
        private String name;
        private int age;
        private String kind;
        private String sex;
        private String health;
        
        @Id  
        @GeneratedValue(strategy = GenerationType.AUTO)
        public int getId() {
            return id;
        }
        public void setId(int id) {
            this.id = id;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public int getAge() {
            return age;
        }
        public void setAge(int age) {
            this.age = age;
        }
        public String getKind() {
            return kind;
        }
        public void setKind(String kind) {
            this.kind = kind;
        }
        public String getSex() {
            return sex;
        }
        public void setSex(String sex) {
            this.sex = sex;
        }
        public String getHealth() {
            return health;
        }
        public void setHealth(String health) {
            this.health = health;
        }
        
        public String toString()
        {
            return id+"--"+name+"--"+kind+"--"+age+"--"+health;
        }
    }
  • 相关阅读:
    03-字典
    02-列表
    01-字符串操作
    Django中的跨域问题
    Codeforces Round #617 (Div. 3) A
    Codeforces Round #717 (Div. 2) A
    如何在Vuespa中使用less
    excle导出
    ajaxFileUpload上传文件
    图片插入word
  • 原文地址:https://www.cnblogs.com/yanff/p/4842161.html
Copyright © 2011-2022 走看看