persistence@glassfish.java.net

Re: field of type List<String>

From: Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
Date: Thu, 01 Mar 2007 08:31:40 +0530

This is a bug in the persistence provider that thinks List<String> is a
collection of entities. I presume you are using GlassFish persistence
provider. What version are you using?

Thanks,
Sahoo
jeff wrote:
> i have an entity class w/ a field of type List<String>, it looks like
> this:
>
> @XmlElementWrapper (
> name = "portlet-entity-ids",
> nillable = false
> )
> @XmlElement (
> name = "portlet-entity-id"
> )
> private List<String> portletEntityIds;
>
> when i attempt to persist this class, i get an exception ...
>
> Exception Description: [class com.sun.portal.pom.Page] uses a
> non-entity [class java.lang.String] as target entity in the
> relationship attribute [public java.util.List
> com.sun.portal.pom.Page.getPortletEntityIds()].
>
> i tried declaring java.lang.String in my PU just to see what happened,
> and it did not like that either (said it couldn't find the class
> actually).
>
> am i missing something?
> thanks!
>
> ------------------------------------------------------------------------
> Bored stiff?
> <http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com> Loosen up...
> Download and play hundreds of games for free
> <http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com> on Yahoo!
> Games.