Grails gorm 如何为每个具体类插入表,其中每个具体类继承一个抽象类 [英] How Grails gorm will insert table per concrete class where each concrete class inherits an abstract class

查看:19
本文介绍了Grails gorm 如何为每个具体类插入表,其中每个具体类继承一个抽象类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,以下是情况我有一个抽象类 AbstractProfile 和一个具体类 GoogleProfile

Hi all following is the situation I have an abstract class AbstractProfile and one concrete class GoogleProfile

abstract class AbstractProfile  {
    .....
}

class GoogleProfile extends AbstractProfile { 

    ......
}

我正在使用 grails,但 gorm 没有为 google 配置文件插入表 当前 gorm 仅为 AbstractProfile 类插入表,请提前帮助

I am using grails but gorm is not inserting table for google profile current gorm is inserting table for only AbstractProfile class please help Thanks in advance

推荐答案

我做了一些挖掘,发现从 grails 2.3 你有以下映射选项:

I did some digging and found out that starting on grails 2.3 you have the following mapping option:

tablePerConcreteClass true

似乎文档(即使对于版本 2.4) 尚未对此进行更新.

It seems the documentation (even for version 2.4) hasn't been updated regarding this yet.

这篇关于Grails gorm 如何为每个具体类插入表,其中每个具体类继承一个抽象类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆