Tomas Romero
Tomas Romero

Reputation: 8708

Change grails hasMany from LinkedHashSet to ArrayList

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.

Upvotes: 0

Views: 929

Answers (1)

Sudhir N
Sudhir N

Reputation: 4096

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

Upvotes: 1

Related Questions