从Groovy对象中提取属性会导致H2数据库错误

时间:2012-01-29 00:19:22

标签: eclipse grails groovy h2

我在Eclipse STS 3.7上使用Grails 2.0,Groovy 1.8.4。当我执行以下语句从groovy对象中提取属性时,Grails抛出一个SQL异常,不确定为什么因为我没有使用H2数据库。我已从项目中删除了DataSources.groovy并在其他配置文件中注释了对sqlh2的所有引用,但问题仍然存在

Note note = [title:'foo', details:'bar']
def objprops = note.properties.findAll{ !['class','metaClass'].contains(it.key)}

例外......

org.h2.jdbc.JdbcSQLException: Table "NOTE" not found; SQL statement:
select this_.id as id0_0_, this_.version as version0_0_, this_.details as details0_0_, this_.title as title0_0_ from note this_ [42102-147]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
    at org.h2.message.DbException.get(DbException.java:167)
    at org.h2.message.DbException.get(DbException.java:144)
    at org.h2.command.Parser.readTableOrView(Parser.java:4562)
    at org.h2.command.Parser.readTableFilter(Parser.java:1020)
    at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1622)
    at org.h2.command.Parser.parseSelectSimple(Parser.java:1729)

0 个答案:

没有答案