日期:2014-05-20  浏览次数:20715 次

新手求助 Hibernate 反转
我是在自学中,按照视频做,此处错误出现在Hibernate 反转 映射,表1:PetInfo 表2:PetDiary
此处错误是在反转生成的entity.PetInfo中出现 想不通...

private Set<PetDiary> diarts = new HashSet<PetDiary>();

报错:Multiple markers at this line
- The type HashSet is not generic; it cannot be parameterized with 
arguments <PetInfo>
- Syntax error, parameterized types are only available if source level 
is 5.0
- The type Set is not generic; it cannot be parameterized with 
arguments <PetInfo>
- Syntax error, parameterized types are only available if source level 
is 5.0


------解决方案--------------------
那应该是编译级别的问题,你修改下你工程的编辑为5.0就好啦
右键点击你工程,properties-->java compiler--->右边有选项config workspace setting
-->修改compiler compilance level,修改成5.0即可