package com.example.demo.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
/**
* 文章 类
*
* @author LJM
*/
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "ARTICLE")
public class Article {
/**
* 文章 id
*/
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "article_id", nullable = false)
private Long articleId;
/**
* 文章 标题
*/
@Column(name = "article_title", nullable = false)
private String articleTitle;
/**
* 文章 内容
*/
@Column(name = "article_content", nullable = false)
private String articleContent;
/**
* 文章 类型
*/
@Column(name = "article_type", nullable = false)
private String articleType;
/**
* 文章 阅读量
*/
@Column(name = "article_read_number", nullable = false)
private Integer articleReadNumber;
/**
* 文章 点赞数
*/
@Column(name = "article_likes_number", nullable = false)
private Integer articleLikesNumber;
/**
* 多对一
* 多方
* 作者外键
* 维护方
*/
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "article_author_id", nullable = false)
private Author author;
}
评论0