在使用table-per-hierarchy继承时,GORM创建一个“class”列来存储实例的类名。
我想将DB索引添加到本专栏,因为我的许多查询都包括where class='com.myapp.Mychildclass'。但是,我在这段代码中没有成功:
static mapping = {
columns {
'class' column: 'class', index: 'class_idx'
}
} 在没有创建索引的情况下,我尝试了该代码的不同版本。
我怎么能这么做?
发布于 2010-02-26 11:51:19
我在这里找到了这个问题的答案:http://grails.1312388.n4.nabble.com/GORM-Howto-index-the-inheritance-class-column-td1563116.html
更新:链接更新
https://stackoverflow.com/questions/2330443
复制相似问题