persistence@glassfish.java.net

Re: Simple collections

From: Aleksei Valikov <aleksei.valikov_at_gmail.com>
Date: Thu, 31 May 2007 11:07:19 +0200

Hi Craig,

Is there a spec-compliant way to map simple collections?
> Like this one:
>
> public List<String> anyURI;
>
>
> You can map this to a BLOB if you're not looking to query the strings.
> What the provider will do is serialize the contents of the list and store it
> as a binary large object. When it comes back in, the blob is deserialized
> into the list.
>


I'm aware of that possibility - but it's really not what people want in this
case.

Is this more convenient for you than the alternative you outline below? Or
> do you want to map this to a table in the database with a number of rows
> each of which has a string value and a reference back to the "owning"
> entity? It is the latter mapping that is being looked at for future releases
> of the specification.
>

Exactly, I am looking forward to have a mapping onto (id, index, value) like
table. From my experience, this is what people naturally expect in this
case.

Thank you for your answer.

Bye.
/lexi