栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Ormlite-扩展BaseDaoImpl时构造函数调用失败

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Ormlite-扩展BaseDaoImpl时构造函数调用失败

我怀疑在异常堆栈跟踪的末尾有您丢失的原因消息。例如,如果我在上面重复了您的示例,则会得到:

java.sql.SQLException: Could not call the constructor in class class       com.j256.ormlite.table.CustomDaoTest$A_DaoImpl  at com.j256.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)  ...Caused by: java.lang.reflect.InvocationTargetException  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  ...Caused by: java.lang.IllegalArgumentException: Foreign field class>>>>      com.j256.ormlite.table.CustomDaoTest$B does not have id field  <<<<<<  at com.j256.ormlite.field.FieldType.configDaoInformation(FieldType.java:332)  ...

因为

A
有一个class的外部字段
B
,那么
B
需要一个id字段。身份字段是外国字段所必需的。

我敢肯定

A
,这
B
是您的类的简化版本,因此,如果您发布更多包含所有原因信息的异常,我将适当地编辑答案。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/438858.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号