SpringDataJpa idea自动生成实体类

第一步 

SpringDataJpa idea自动生成实体类

 第二步

SpringDataJpa idea自动生成实体类

第三步 

SpringDataJpa idea自动生成实体类

第四步 

SpringDataJpa idea自动生成实体类

 第五步

SpringDataJpa idea自动生成实体类

 第六步

SpringDataJpa idea自动生成实体类

第七步 

SpringDataJpa idea自动生成实体类

第九步 

SpringDataJpa idea自动生成实体类

第十步

SpringDataJpa idea自动生成实体类

package com.hikktn.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * @ClassName PersonEntity
 * @Description TODO
 * @Author lisonglin
 * @Date 2021/5/3 20:15
 * @Version 1.0
 */
@Entity
@Table(name = "person", schema = "test")
public class PersonEntity {
	private int id;
	private String name;
	private Integer age;

	@Id
	@Column(name = "id", nullable = false)
	public int getId() {
		return id;
	}

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

	@Basic
	@Column(name = "name", nullable = true, length = 255)
	public String getName() {
		return name;
	}

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

	@Basic
	@Column(name = "age", nullable = true)
	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		PersonEntity that = (PersonEntity) o;
		return id == that.id && Objects.equals(name, that.name) && Objects.equals(age, that.age);
	}

	@Override
	public int hashCode() {
		return Objects.hash(id, name, age);
	}
}

 

上一篇:codeforce Round #599(Div.2)


下一篇:SpringDataJpa配置