src/com/itbaizhan/entity/Book.java
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.itbaizhan.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
@Entity // 注解为hibernate实体 对应数据库中同名表
public class Book {
public static final int type_special = 1;
public static final int type_new = 2;
public static final int type_sale = 3;
@Id // 注解主键
@GeneratedValue //id生成策略 默认auto 相当于hibernate的native - 自增字段
private int id;
private String name;
private String cover;
private float price;
private String intro;
private String auther;
private String press;
private String pubdate;
@ManyToOne
@NotFound(action=NotFoundAction.IGNORE)
private Category category;
private boolean special;
private boolean news;
private boolean sale;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCover() {
return cover;
}
public void setCover(String cover) {
this.cover = cover;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
后面还有 51 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。