I have the following:

class A{

    static hasMany = [b: B]
}

Grails generates the class with property b being a LinkedHashMap. I want to configure Grails in order to generate an ArrayList instead.

I know this can be done by explicitly writing the list:

class A{

    static hasMany = [b: B]

    List<B> b = new ArrayList<B>()
}

But I was looking for a way to achieve this by some external configuration.

有帮助吗?

解决方案

This is not configurable - The only solution is to declare a property of the type list as you did in your sample.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top