在做Student与Course多对多的关联,出现上述异常

1.请检查Student的courses这个属性是否使用了泛型,:Set<Course>. 

如果未使用泛型,请在@ManyToMany注释中使用targetEntity指定元素的类型 即@ManyToMany(targetEntity=Course.class)

2.注意当你使用了泛型即Set<Course>时,也要确保你对应的geters, seters方法也是使用泛型,要不然也会报上述错误




 

相关文章:

  • 2021-09-28
  • 2021-07-19
  • 2022-12-23
  • 2021-08-17
  • 2021-08-28
  • 2022-12-23
  • 2021-12-29
  • 2021-05-18
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-01-12
  • 2022-12-23
相关资源
相似解决方案