开发者

Retrieving a list of Grails composite id properties?

Ho开发者_StackOverfloww can I retrieve a list of Grails composite id properties?

I have tried the following but the id property is returning a Long:

Domain

class Domain implements Serializable {
    String field1
    String field2

    static mapping = {
        id composite: ['field1', 'field2']
    }
}

Test

def d = DefaultGrailsDomainClass(Domain.class)
assert(d.identifier.type == java.lang.Long)


After deep diving GORM I found the solution:

GrailsDomainBinder.getMapping(Domain).identity.propertyNames
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜