hibernate报错:MappingException: Could not determine type for...解决办法

有时候实体里的一些属性并不想映射到数据库(比方说子级菜单List),

如果不做处理的话会报字段映射错误找不到这列Column Not Found

例如:org.hibernate.MappingException: Could not determine type for: java.util.List, at table: xxxx, for columns: [org.hibernate.mapping.Column(xxx)]

Hibernate实体类注解可以让某些属性不映射到数据库

使用hibernate注解@Transien放在属性上即可解决此问题。

没有get方法的属性可以直接写在属性上面,有get方法的要在get方法上也写上

猜你喜欢

转载自www.cnblogs.com/juanxincai/p/12345977.html
今日推荐