com.haoxuer.discover.weibo.data.entity.WeiBo Maven / Gradle / Ivy
package com.haoxuer.discover.weibo.data.entity;
import com.haoxuer.discover.config.data.entity.User;
import com.haoxuer.discover.data.annotations.ColType;
import com.haoxuer.discover.data.annotations.FormAnnotation;
import com.haoxuer.discover.data.annotations.FormFieldAnnotation;
import com.haoxuer.discover.data.entity.AbstractEntity;
import com.haoxuer.discover.data.enums.StoreState;
import com.haoxuer.discover.weibo.data.enums.WeiBoType;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@FormAnnotation(title = "微博", add = "添加微博", list = "微博", update = "更新微博")
@Entity
@Table(name = "weibo_content")
public class WeiBo extends AbstractEntity {
public static WeiBo fromId(Long id) {
WeiBo result = new WeiBo();
result.setId(id);
return result;
}
@FormFieldAnnotation(title = "嘉宾", sortNum = "1", grid = true, col = ColType.col_1)
@ManyToOne(fetch = FetchType.LAZY)
private User user;
@FormFieldAnnotation(title = "内容", sortNum = "1", grid = true, col = ColType.col_9)
private String note;
private StoreState storeState;
private WeiBoType weiBoType;
/**
* 根话题
*/
@ManyToOne(fetch = FetchType.LAZY)
private WeiBo root;
/**
* 回复量
*/
private Long replys;
/**
* 转发量
*/
private Long forwards;
/**
* 喜欢量
*/
private Long likes;
@OrderBy(" id desc ")
@OneToMany(fetch = FetchType.LAZY, mappedBy = "weiBo")
private List files = new ArrayList<>();
@OneToMany(fetch = FetchType.LAZY, mappedBy = "weiBo")
private List channels=new ArrayList<>();
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public StoreState getStoreState() {
return storeState;
}
public void setStoreState(StoreState storeState) {
this.storeState = storeState;
}
public WeiBoType getWeiBoType() {
return weiBoType;
}
public void setWeiBoType(WeiBoType weiBoType) {
this.weiBoType = weiBoType;
}
public WeiBo getRoot() {
return root;
}
public void setRoot(WeiBo root) {
this.root = root;
}
public Long getReplys() {
return replys;
}
public void setReplys(Long replys) {
this.replys = replys;
}
public Long getForwards() {
return forwards;
}
public void setForwards(Long forwards) {
this.forwards = forwards;
}
public Long getLikes() {
return likes;
}
public void setLikes(Long likes) {
this.likes = likes;
}
public List getFiles() {
return files;
}
public void setFiles(List files) {
this.files = files;
}
public List getChannels() {
return channels;
}
public void setChannels(List channels) {
this.channels = channels;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy