【发布时间】:2013-04-30 16:17:03
【问题描述】:
我正在尝试从 oracle 11g 数据库中检索所有对象,除了某些在属性中包含特殊值的对象。
代码:
//Retrieve thoughts
def thoughts = Question.findAllByThoughtsNotInList(["-", "", null], params)
def totalThoughts = Question.countByThoughtsNotInList(["-", "", null])
属性thoughts 必须是CLOB,因为我只有CRUD 数据的权限。我不能使用任何 DDL 语句。
这样,我得到了ORA-00932 错误。
ORA-00932: inconsistent datatypes: expected - got CLOB
我的领域类:
class Question {
String person
String thoughts
static constraints = {
thoughts nullable: true
}
static mapping = {
table "Question"
id name: "person"
person column: "person"
thoughts column: "thoughts_person"
version false
}
}
我该如何解决?
【问题讨论】:
-
映射有点混乱。
idforQuestion是person?thoughts映射到哪里?
标签: java oracle hibernate grails grails-orm