增加必要的依赖,修改bean包的数据类型以及添加Getter,Setter方法

master
Allen 6 years ago
parent 4bb26265da
commit 08434cca31

@ -28,7 +28,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>1.3.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
@ -39,6 +39,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.10</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>

@ -1,54 +1,22 @@
package com.example.demo.bean;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
@Getter
@Setter
@Entity
public class book {
@GeneratedValue(strategy=GenerationType.AUTO)
@ID
private long book_id;
private string book_name;
private string author;
private string book_sort;
private String book_name;
private String author;
private String book_sort;
private int book_num;
public long getBook_id() {
return book_id;
}
public void setBook_id(long book_id) {
this.book_id = book_id;
}
public string getBook_name() {
return book_name;
}
public void setBook_name(string book_name) {
this.book_name = book_name;
}
public string getAuthor() {
return author;
}
public void setAuthor(string author) {
this.author = author;
}
public string getBook_sort() {
return book_sort;
}
public void setBook_sort(string book_sort) {
this.book_sort = book_sort;
}
public int getBook_num() {
return book_num;
}
public void setBook_num(int book_num) {
this.book_num = book_num;
}
public book(){};
}

@ -1,66 +1,22 @@
package com.example.demo.bean;
import org.springframework.boot.autoconfigure.domain.EntityScan;
@EntityScan
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
@Getter
@Setter
@Entity
public class borrowrecord {
@GeneratedValue(strategy=GenerationType.AUTO)
@ID
private long s_id;
private long book_id;
private string s_name;
public long getS_id() {
return s_id;
}
public void setS_id(long s_id) {
this.s_id = s_id;
}
public long getBook_id() {
return book_id;
}
public void setBook_id(long book_id) {
this.book_id = book_id;
}
public string getS_name() {
return s_name;
}
public void setS_name(string s_name) {
this.s_name = s_name;
}
public string getBook_name() {
return book_name;
}
public void setBook_name(string book_name) {
this.book_name = book_name;
}
public string getBorrowtime() {
return borrowtime;
}
public void setBorrowtime(string borrowtime) {
this.borrowtime = borrowtime;
}
public string getSenttime() {
return senttime;
}
public void setSenttime(string senttime) {
this.senttime = senttime;
}
private string book_name;
private string borrowtime;
private string senttime;
private String s_name;
private String book_name;
private String borrowtime;
private String senttime;
public borrowrecord(){};
}

@ -1,38 +1,19 @@
package com.example.demo.bean;
import org.springframework.boot.autoconfigure.domain.EntityScan;
@EntityScan
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
@Getter
@Setter
@Entity
public class student {
@GeneratedValue(strategy=GenerationType.AUTO)
@ID
private long s_id;
private String s_name;
private String s_password;
public long getS_id() {
return s_id;
}
public void setS_id(long s_id) {
this.s_id = s_id;
}
public String getS_name() {
return s_name;
}
public void setS_name(string s_name) {
this.s_name = s_name;
}
public string getS_password() {
return s_password;
}
public void setS_password(string s_password) {
this.s_password = s_password;
}
public student() {};
}

Loading…
Cancel
Save