persistence@glassfish.java.net

Re: field of type List<String>

From: Guy Pelletier <guy.pelletier_at_oracle.com>
Date: Thu, 1 Mar 2007 11:46:55 -0500

Jeff,

I have re-opened the bug for further investigation. In the mean time, you
can explicitly mark the accessor with @Basic to get past this exception.

Cheers,
Guy

----- Original Message -----
From: "Sanjeeb Kumar Sahoo" <Sanjeeb.Sahoo_at_Sun.COM>
To: <persistence_at_glassfish.dev.java.net>
Sent: Wednesday, February 28, 2007 11:44 PM
Subject: Re: field of type List<String>


> Hi Jeff,
>
> Your issue is related to issue #1327. It is fixed in the version of
> TopLink Essentials you are using. Although that issue is marked as fixed,
> I don't think it is entirely fixed. Had it been the case, as reported in
> that bug, you should have got a validation error that says something like:
> /List<String> is not Serializable/; and if you used LinkedList<String> or
> some other List implementation that is serializable, your program should
> have worked.
>
> You can reopen that bug or file a new one.
>
> Thanks,
> Sahoo
>
> jeff wrote:
>> hi sanjeeb, thanks for your response,
>>
>> i'm using the standalone distribution from glassfish, toplink essentials
>> 2.0-36, which was the latest as of a few days ago.
>>
>> is there an issue submitted for this? should i submit a new one?
>> thanks.
>>
>> */Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>/* wrote:
>>
>> This is a bug in the persistence provider that thinks List 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, it looks like
>> > this:
>> >
>> > @XmlElementWrapper (
>> > name = "portlet-entity-ids",
>> > nillable = false
>> > )
>> > @XmlElement (
>> > name = "portlet-entity-id"
>> > )
>> > private List 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?
>> > Loosen up...
>> > Download and play hundreds of games for free
>> > on Yahoo!
>> > Games.
>>
>>
>> ------------------------------------------------------------------------
>> Want to start your own business? Learn how on Yahoo! Small Business.
>> <http://us.rd.yahoo.com/evt=41244/*http://smallbusiness.yahoo.com/r-index>
>
>