package com.example.myproject.entity; | |
import javax.persistence.*; | |
@Entity | |
@Table(name = "likes") | |
public class Likes { | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) // 使用自增主键 | |
@Column(name = "likeId") | |
private Long likeId; | |
@Column(name = "user_id") | |
private Long userId; | |
@Column(name = "postNo") | |
private Long postNo; | |
// Getters and Setters | |
public Long getLikeId() { | |
return likeId; | |
} | |
public void setLikeId(Long likeId) { | |
this.likeId = likeId; | |
} | |
public Long getUserId() { | |
return userId; | |
} | |
public void setUserId(Long userId) { | |
this.userId = userId; | |
} | |
public Long getPostNo() { | |
return postNo; | |
} | |
public void setPostNo(Long postNo) { | |
this.postNo = postNo; | |
} | |
} |