-
StackOverflow 文件
-
spring-boot 教程
-
Spring Boot + JPA + REST
-
域物件
package com.example.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
//simple person object with JPA annotations
@Entity
public class Person {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
@Column
private String firstName;
@Column
private String lastName;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}