« Return to Thread: Can I persist a Map containing a List as Value

Re: Can I persist a Map containing a List as Value

by tware :: Rate this Message:

Reply to Author | View in Thread

You will likely need an extra object to do this.  Something like:

private Map<String, ListHolder> instructions;

@Entity
public class ListHolder{
   @id
   private int id;

   private List instructions;

...
}

It should be pretty easy to write some business methods that make this mapping
transparent to the users of the API.

-Tom

adi@... wrote:

> Hi
>
> I persisted a map like this:
> private Map<String, String> instructions;
>
> How can I persist a map that contains a List as value?
> private Map<String, List<String>> instructions;
>
> Thanks a lot!
>
> Regards Adrian
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@...
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

 « Return to Thread: Can I persist a Map containing a List as Value