rsijaya
rsijaya

Reputation: 169

Grails create table List<String> name

Why i can't create table List to my database?

my domain class :

class Test {
   List<String> names
}

Upvotes: 1

Views: 1565

Answers (2)

IgniteCoders
IgniteCoders

Reputation: 4990

I am using the way exposed in the question and it's working.

class Test {
   List<String> names
}

This generates a table called: test_names with columns test_names_id, names_ids, names_ids_idx.

Upvotes: 0

Burt Beckwith
Burt Beckwith

Reputation: 75681

This is the supported syntax:

class Test {
   static hasMany = [names: String]
}

Upvotes: 6

Related Questions