
java问题,ssh框架使用注解一对多关联2张表出现了问题 45
出现这个错误@OneToOneor@ManyToOneoncom.softcode.business.entity.BizDemandOrderLog.orderIdre...
出现这个错误 @OneToOne or @ManyToOne on com.softcode.business.entity.BizDemandOrderLog.orderId references an unknown entity: java.lang.Long。
2表没有主外键联系,如何用注解关联起来? 展开
2表没有主外键联系,如何用注解关联起来? 展开
展开全部
orderId没有成功的映射
@ManyToOne(targetEntity=XXXX.class) //指定关联对象
加上targetEntity=映射类
@ManyToOne(targetEntity=XXXX.class) //指定关联对象
加上targetEntity=映射类
更多追问追答
追问
加了之后出现错误 mappedBy reference an unknown target entity property: com.softcode.business.entity.BizDemandOrderLog.bizDemandOrder in com.softcode.business.entity.BizDemandOrder.bizDemandOrderLog
追答
你可以去网上看个例子, 是不是在映射的类里面没有对应的属性哦, 你把你的实体类贴出来看看呢
如果刚开始学ORM框架,我建议不要学hibernate了, 学mybatis或者beetlsql吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询