表没有找到Hibernate和HSQLDB(Table Not Found with Hibernate and HSQLDB)
我们使用hibernate entitymanager通过JPA映射我们的实体。 我们正在使用HSQLDB内存数据库进行单元测试。 一切都很好,直到模型的最近重构开始导致以下错误:
17:55:48.516 [main] WARN o.h.util.JDBCExceptionReporter - SQL Error: -22, SQLState: S0002 17:55:48.517 [main] ERROR o.h.util.JDBCExceptionReporter - Table not found in statement
我无法发布有问题的SQL,但任何人都可以指出上述错误的可能原因吗? 特别是因为我知道代码以前工作过。 好像hibernate因为重构而生成无效的sqls?
We're using hibernate entitymanager to map our entities through JPA. And we are using HSQLDB in-memory database for unit testing. Everything was fine until a recent refactor to the model started causing the following error:
17:55:48.516 [main] WARN o.h.util.JDBCExceptionReporter - SQL Error: -22, SQLState: S0002 17:55:48.517 [main] ERROR o.h.util.JDBCExceptionReporter - Table not found in statement
I can't post the SQL in question, but can anyone give me pointers as to the possible causes of the above error? especially since I know the code was working before. It seems like hibernate is generating invalid sqls because of the refactor?
原文:https://stackoverflow.com/questions/1442127
满意答案
您需要将obj对象放入集合中,而不是控件本身
未经测试:
Dim tbCollection As Collection Private Sub UserForm_Initialize() Dim obj As clsTextBox Dim arr Dim ctrl Set tbCollection = New Collection arr = Array(Me.tbAC, Me.tbCR, Me.tbHP) '<< edit: no Set For Each ctrl in arr Set obj = New clsTextBox Set obj.Control = ctrl tbCollection.Add obj Next End Sub
You need to put the obj objects in the collection, not the controls themselves
Untested:
Dim tbCollection As Collection Private Sub UserForm_Initialize() Dim obj As clsTextBox Dim arr Dim ctrl Set tbCollection = New Collection arr = Array(Me.tbAC, Me.tbCR, Me.tbHP) '<< edit: no Set For Each ctrl in arr Set obj = New clsTextBox Set obj.Control = ctrl tbCollection.Add obj Next End Sub
相关问答
更多如何根据模型类的属性创建一组控件(How to create a group of Controls based on properties of a model class)
销毁控件(Destroy controls)
“无法修改Controls集合,因为控件包含代码块”(“The Controls collection cannot be modified because the control contains code blocks”)
删除一组控件(Removing a collection of controls)
MS Access中的表单类对象(如控件集合)(MS Access list class objects in a form (like controls collection))
将控件集合与列表进行比较(Compare Collection of Controls with a list)
如何跟踪一组控件中任何控件的编辑(How to keep track of editing in any of the controls from a group of controls)
如何使用具有一组控件的类(How to use a Class with a Collection of Controls)
相关文章
更多Hibernate创建sessionFactory null
hibernate查询
关于hibernate的saveorupdate
HIBERNATE 没反应
Hibernate中如何实现一个model和多个表关联
使用Hibernate+solr取代hibernate search
关于Hibernate级联数据表的存储问题(多对一)
jpa与hibernate注解混合使用
hibernate中的映射文件
spring和freemarker 总是提示freemarkerResult这个类没有找到,不能注入,但是程序也能运行
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!