/**
* @hibernate.class table="CATEGORY"
*/
public class Category {
private Long id;
private String name;
/**
* @hibernate.id generator-class="native" column="CATEGORY_ID"
*/
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
* @hibernate.property column="NAME"
*/
public String getName() {
return name;
}
public void setName(Long name) {
this.name = name;
}
}
/**
* @hibernate.class table="PRODUCT"
*/
public class Product {
private Long id;
private Category category;
/**
* @hibernate.id generator-class="native" column="PRODUCT_ID"
*/
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
* @hibernate.many-to-one
* column="CATEGORY_ID"
* class="Category"
* cascade="none"
* not-null="false"
*/
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
}
新闻热点
疑难解答