![JAR search and dependency download from the Maven repository](/logo.png)
com.quhaodian.article.data.entity.ArticleCatalog Maven / Gradle / Ivy
The newest version!
package com.quhaodian.article.data.entity;
import com.quhaodian.data.entity.CatalogEntity;
import javax.persistence.*;
import java.util.List;
/**
* 文章分类
*
* @author 年高
*
*/
@Entity
@Table(name = "article_catalog")
public class ArticleCatalog extends CatalogEntity {
/**
* 父节点
*/
@JoinColumn(name = "pid")
@ManyToOne
private ArticleCatalog parent;
/**
* 数量
*/
private Long nums;
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY)
private List childrens;
@Override
public Integer getParentId() {
if (parent != null) {
return parent.getId();
}
return null;
}
public ArticleCatalog getParent() {
return parent;
}
public void setParent(ArticleCatalog parent) {
this.parent = parent;
}
public List getChildrens() {
return childrens;
}
public void setChildrens(List childrens) {
this.childrens = childrens;
}
public Long getNums() {
return nums;
}
public void setNums(Long nums) {
this.nums = nums;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy