小编ale*_*ebu的帖子

未创建内存数据库,但日志显示已执行DDL

我正在尝试设置spring环境以在内存数据库中运行,该数据库是根据提供的映射自动创建的.在执行期间,我可以在日志中看到执行DDL语句,但是当hibernate尝试将数据插入到创建的表中时,我得到"Table not found"异常.

有什么问题?

使用spring 3.1.1和Hibernate 4.1.1和H2版本1.3.165.

日志看起来像(只剩下令人印象深刻的记录):

INFO at '25-04-2012 13:23:56.318' by thread 'main' from category 'org.hibernate.tool.hbm2ddl.SchemaExport':
HHH000227: Running hbm2ddl schema export
DEBUG at '25-04-2012 13:23:56.318' by thread 'main' from category 'org.hibernate.SQL':

    drop table DUMMIES if exists
Hibernate: 
    drop table DUMMIES if exists
DEBUG at '25-04-2012 13:23:56.318' by thread 'main' from category 'org.hibernate.SQL':

    create table DUMMIES (
        id bigint generated by default as identity,
        title varchar(255),
        primary key (id),
        unique (title)
    )
Hibernate: 
    create table DUMMIES (
        id bigint …
Run Code Online (Sandbox Code Playgroud)

spring hibernate

4
推荐指数
1
解决办法
5843
查看次数

标签 统计

hibernate ×1

spring ×1