Search code examples
grailsgrails-orm

Grails static mapping for String[]


I am trying to store a string[] in a database with grails but tinyblob isn't large enough. I've tried changing the mapping to blob and longblob but when I do this I get an error:

[Ljava.lang.String; cannot be cast to java.sql.Blob  

Next I tried changing the maxSize within the domain constraints but I get the error

No such property: maxSize for class:

Any ideas on how to get this to work?


Solution

  • I'm curious about your reasoning for doing this. If you are just trying to have many string associated to a domain class you can do that directly like this:

        static hasMany = [whatevers: String]