我将我的网站转换为使用 Java EE 和休眠!我有3张桌子:likeid | table | idElement | userIdmoviemovie_id | title | durationvideoGamegame_id | title | nbPlayer和目前 2 类:@Entity@Table(name="movie")public class Movie { @Id @GeneratedValue @Column(name="movie_id") private Integer id; private String title; private int duration;@Entity@Table(name="videoGame")public class Game { @Id @GeneratedValue @Column(name="game_id") private Integer id; private String title; private int nbPlayer;我不知道如何使我的表“喜欢”以将其链接到两个表之一和正确的 ID?例子:table like:+---+-------+-----------+-------+|id | table | idElement | userId||1 | movie | 1 | 1 ||1 | game | 5 | 3 |+---+-------+-----------+-------+非常感谢你的帮助!
添加回答
举报
0/150
提交
取消