Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top