mirror of
https://github.com/ityouknow/spring-boot-examples.git
synced 2026-09-27 03:17:41 +08:00
56 lines
1.0 KiB
Java
56 lines
1.0 KiB
Java
package com.neo.model;
|
|
|
|
import jakarta.persistence.Column;
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.GeneratedValue;
|
|
import jakarta.persistence.Id;
|
|
|
|
@Entity
|
|
public class User {
|
|
@Id
|
|
@GeneratedValue
|
|
private long id;
|
|
@Column(nullable = false, unique = true)
|
|
private String userName;
|
|
@Column(nullable = false)
|
|
private String password;
|
|
@Column(nullable = false)
|
|
private int age;
|
|
|
|
public long getId() {
|
|
return id;
|
|
}
|
|
|
|
public User setId(long id) {
|
|
this.id = id;
|
|
return this;
|
|
}
|
|
|
|
public String getUserName() {
|
|
return userName;
|
|
}
|
|
|
|
public User setUserName(String userName) {
|
|
this.userName = userName;
|
|
return this;
|
|
}
|
|
|
|
public String getPassword() {
|
|
return password;
|
|
}
|
|
|
|
public User setPassword(String password) {
|
|
this.password = password;
|
|
return this;
|
|
}
|
|
|
|
public int getAge() {
|
|
return age;
|
|
}
|
|
|
|
public User setAge(int age) {
|
|
this.age = age;
|
|
return this;
|
|
}
|
|
}
|