equivalent of InheritanceType.TABLE_PER_CLASS in grails?

前端 未结 2 1281
小蘑菇
小蘑菇 2021-01-26 05:23

I want to create 3 separate tables for 3 domain classes: A, B extends A, C extends B But I want their tables to be NOT connected to each other.

In hibernate, I would use

2条回答
  •  既然无缘
    2021-01-26 06:23

    Try to use tablePerHierarchy false

    class Payment {
        Integer amount
        static mapping = {
            tablePerHierarchy false
        }
    }
    
    class CreditCardPayment extends Payment {
        String cardNumber
    }
    

    See more : http://grails.org/doc/latest/guide/single.html#5.5.2.3%20Inheritance%20Strategies

提交回复
热议问题