Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAP实体类怎么自动生成 #571

Open
setsuna opened this issue Jul 11, 2017 · 0 comments
Open

JAP实体类怎么自动生成 #571

setsuna opened this issue Jul 11, 2017 · 0 comments

Comments

@setsuna
Copy link

setsuna commented Jul 11, 2017

// JPA实体类的标识
@entity
public class Book {

public static final String STATUS_IDLE = "idle";
public static final String STATUS_REQUEST = "request";
public static final String STATUS_OUT = "out";

// JPA 主键标识, 策略为由数据库生成主键
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long id;

public String doubanId;

public String title;

public String url;

public String status;

@ManyToOne
@JoinColumn(name = "owner_id")
public Account owner;

public Date onboardDate;

@ManyToOne
@JoinColumn(name = "borrower_id")
public Account borrower;

public Date borrowDate;

public Book() {
}

public Book(Long id) {
	this.id = id;
}

@Override
public String toString() {
	return ToStringBuilder.reflectionToString(this);
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant