Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.5-RC1
-
Fix Version/s: 1.1-beta1
-
Component/s: Persistence
-
Labels:None
Description
I have to put a simple list of names as a domain class attribute, but a list of strings doesnt work, and I have to do a domain class to wrap strings in it to make it works. It'll fine if I cand do things like:
class XXXX {
List names = []
}
and the names on the list persists to the db without more work.
What I've tried to do is something like this:
class Pepe {
List names
static hasMany = [names: String]
}
thanks.
First of all, it must be decided on how to store the collection of basic types in a relational database.
Option 1:
Use JDBC ARRAY type.
Option 2:
Use Java serialization to store the whole collection in a column of byte array. (BLOB or VARBINARY or LONGVARBINARY).
Option 3:
Use XML serialization to store the whole collection in a column of VARCHAR or LONGVARCHAR.
Option 4:
Store the collection in a separate table.
Option 5:
Hacks, such as comma-delimited String... What about having a comma in a String element? What about various types within one array?
As there are workarounds, I propose to lower the priority to 'Minor'.