Hibernate IllegalArgumentException

今天用hibernate时候出现,IllegalArgumentException occurred calling getter of com.yu.model.Customer.id

根本原因是类型不匹配

在一对多的多的一方配置错误

<many-to-one name="customer" column="customer_id" class="com.yu.model.Customer"></many-to-one>

错误将customer配置成customerId, customerId是int类型,所以导致爆出参数异常

<many-to-one name="customerId" column="customer_id" class="com.yu.model.Customer"></many-to-one>

猜你喜欢

转载自yuxiaolongwin.iteye.com/blog/1734826
今日推荐