You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Lars Vogel <la...@googlemail.com> on 2008/04/11 19:09:56 UTC

Annotation of Arraylist myList;

Hello,

I would like to persist a object which contains a list of primitives
(Strings). It is possible or can JPA only store real objects?

I tried it an received an error.

Best regards, Lars

Re: Annotation of Arraylist myList;

Posted by Lars Vogel <la...@googlemail.com>.
Hi Catatina,

thank you. Best regards, Lars


2008/4/15, catalina wei <ca...@gmail.com>:
>
> Hi Lars,
> See my comment below
>
>
> On 4/13/08, Lars Vogel <la...@googlemail.com> wrote:
> >
> > Hi Catalina,
> >
> > is it correct that this will be serialized as a BLOB?
>
>
>
> I think it means that instances of datamodel.impl.Person when serialized,
> the field nickNameList will be serialized as a BLOB.
>
>
>
> >
> > I receive the message: 1469  people  WARN   [main] openjpa.MetaData -
> > OpenJPA cannot map field "datamodel.impl.Person.nickNameList"
> efficiently.
> > It is of an unsupported type. The field value will be serialized to a
> BLOB
> > by default.
> >
> > You are pointing to a directory which I do not have (I downloaded
> > apache-openjpa-1.0.2). Can you please tell me how I can get this
> > directory?
> >
>
>
> OpenJPA source code can be extracted from svn repository location:
> http://svn.apache.org/repos/asf/openjpa
> The release you are interested in is under branch 1.0.x.
> The samples are under openjpa-persistence-jdbc/src/test folder.
>
>
> >
> > Best regards, Lars
> >
> >
> > 2008/4/13, catalina wei <ca...@gmail.com>:
> > >
> >
> > > Hi Lars,
> > > Want to correct my previous email.
> > > OpenJPA does have this feature implemented already, an example can be
> > > found
> > > in
> > >
> > >
> >
> org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.OrderByEntity:
> > >     @PersistentCollection
> > >     @OrderBy
> > >     private List<String> strings = new ArrayList();
> > >
> > > If you search for "@PersistentCollection" under
> > > openjpa-persistence-jdbc/src/test/java folder,
> > > you will get lots of examples.
> > >
> > >
> > > Catalina
> > >
> > >
> > > On 4/12/08, Janko Heilgeist <ja...@rzg.mpg.de> wrote:
> > > >
> > > > catalina wei wrote:
> > > >
> > > > > Hi Lars,
> > > > > The feature you are looking for has been addressed in the draft
> > > of  JPA
> > > > > 2.0
> > > > > spec Section 2.1.5 Collections of Embeddable Classes and Basic
> > Types.
> > > > > I don't think we have this feature implemented in the current
> > OpenJPA
> > > > > releases.
> > > > >
> > > > > Catalina
> > > > >
> > > > > On 4/11/08, Lars Vogel <la...@googlemail.com> wrote:
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > I would like to persist a object which contains a list of
> > primitives
> > > > > > (Strings). It is possible or can JPA only store real objects?
> > > > > >
> > > > > > I tried it an received an error.
> > > > > >
> > > > > > Best regards, Lars
> > > > > >
> > > > > >
> > > > >
> > > > Hi,
> > > >
> > > > what about @org.apache.openjpa.persistence.PersistentCollection?
> I've
> > > > never used it myself, but someone mentioned this feature a few days
> > ago
> > > on
> > > > this mailinglist.
> > > >
> > > > @Entity
> > > > public MyObject {
> > > >
> > > > @PersistentCollection
> > > > private Collection<String> users;
> > > >
> > > > }
> > > >
> > > > It is not standard-JPA, though.
> > > >
> > > > Janko
> > > >
> > > >
> > >
> >
>

Re: Annotation of Arraylist myList;

Posted by catalina wei <ca...@gmail.com>.
Hi Lars,
See my comment below

On 4/13/08, Lars Vogel <la...@googlemail.com> wrote:
>
> Hi Catalina,
>
> is it correct that this will be serialized as a BLOB?


I think it means that instances of datamodel.impl.Person when serialized,
the field nickNameList will be serialized as a BLOB.


>
> I receive the message: 1469  people  WARN   [main] openjpa.MetaData -
> OpenJPA cannot map field "datamodel.impl.Person.nickNameList" efficiently.
> It is of an unsupported type. The field value will be serialized to a BLOB
> by default.
>
> You are pointing to a directory which I do not have (I downloaded
> apache-openjpa-1.0.2). Can you please tell me how I can get this
> directory?
>

OpenJPA source code can be extracted from svn repository location:
http://svn.apache.org/repos/asf/openjpa
The release you are interested in is under branch 1.0.x.
The samples are under openjpa-persistence-jdbc/src/test folder.

>
> Best regards, Lars
>
>
> 2008/4/13, catalina wei <ca...@gmail.com>:
> >
>
> > Hi Lars,
> > Want to correct my previous email.
> > OpenJPA does have this feature implemented already, an example can be
> > found
> > in
> >
> >
> org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.OrderByEntity:
> >     @PersistentCollection
> >     @OrderBy
> >     private List<String> strings = new ArrayList();
> >
> > If you search for "@PersistentCollection" under
> > openjpa-persistence-jdbc/src/test/java folder,
> > you will get lots of examples.
> >
> >
> > Catalina
> >
> >
> > On 4/12/08, Janko Heilgeist <ja...@rzg.mpg.de> wrote:
> > >
> > > catalina wei wrote:
> > >
> > > > Hi Lars,
> > > > The feature you are looking for has been addressed in the draft
> > of  JPA
> > > > 2.0
> > > > spec Section 2.1.5 Collections of Embeddable Classes and Basic
> Types.
> > > > I don't think we have this feature implemented in the current
> OpenJPA
> > > > releases.
> > > >
> > > > Catalina
> > > >
> > > > On 4/11/08, Lars Vogel <la...@googlemail.com> wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I would like to persist a object which contains a list of
> primitives
> > > > > (Strings). It is possible or can JPA only store real objects?
> > > > >
> > > > > I tried it an received an error.
> > > > >
> > > > > Best regards, Lars
> > > > >
> > > > >
> > > >
> > > Hi,
> > >
> > > what about @org.apache.openjpa.persistence.PersistentCollection? I've
> > > never used it myself, but someone mentioned this feature a few days
> ago
> > on
> > > this mailinglist.
> > >
> > > @Entity
> > > public MyObject {
> > >
> > > @PersistentCollection
> > > private Collection<String> users;
> > >
> > > }
> > >
> > > It is not standard-JPA, though.
> > >
> > > Janko
> > >
> > >
> >
>

Re: Annotation of Arraylist myList;

Posted by Lars Vogel <la...@googlemail.com>.
Hi Catalina,

is it correct that this will be serialized as a BLOB?

I receive the message: 1469  people  WARN   [main] openjpa.MetaData -
OpenJPA cannot map field "datamodel.impl.Person.nickNameList" efficiently.
It is of an unsupported type. The field value will be serialized to a BLOB
by default.

You are pointing to a directory which I do not have (I downloaded
apache-openjpa-1.0.2). Can you please tell me how I can get this directory?

Best regards, Lars

2008/4/13, catalina wei <ca...@gmail.com>:
>
> Hi Lars,
> Want to correct my previous email.
> OpenJPA does have this feature implemented already, an example can be
> found
> in
>
> org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.OrderByEntity:
>     @PersistentCollection
>     @OrderBy
>     private List<String> strings = new ArrayList();
>
> If you search for "@PersistentCollection" under
> openjpa-persistence-jdbc/src/test/java folder,
> you will get lots of examples.
>
>
> Catalina
>
>
> On 4/12/08, Janko Heilgeist <ja...@rzg.mpg.de> wrote:
> >
> > catalina wei wrote:
> >
> > > Hi Lars,
> > > The feature you are looking for has been addressed in the draft
> of  JPA
> > > 2.0
> > > spec Section 2.1.5 Collections of Embeddable Classes and Basic Types.
> > > I don't think we have this feature implemented in the current OpenJPA
> > > releases.
> > >
> > > Catalina
> > >
> > > On 4/11/08, Lars Vogel <la...@googlemail.com> wrote:
> > >
> > > > Hello,
> > > >
> > > > I would like to persist a object which contains a list of primitives
> > > > (Strings). It is possible or can JPA only store real objects?
> > > >
> > > > I tried it an received an error.
> > > >
> > > > Best regards, Lars
> > > >
> > > >
> > >
> > Hi,
> >
> > what about @org.apache.openjpa.persistence.PersistentCollection? I've
> > never used it myself, but someone mentioned this feature a few days ago
> on
> > this mailinglist.
> >
> > @Entity
> > public MyObject {
> >
> > @PersistentCollection
> > private Collection<String> users;
> >
> > }
> >
> > It is not standard-JPA, though.
> >
> > Janko
> >
> >
>

Re: Annotation of Arraylist myList;

Posted by Lars Vogel <la...@googlemail.com>.
Hi Catalina,

thank you very much for your quick and helpful answer. Best regards, Lars

2008/4/13, catalina wei <ca...@gmail.com>:
>
> Hi Lars,
> Want to correct my previous email.
> OpenJPA does have this feature implemented already, an example can be
> found
> in
>
> org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.OrderByEntity:
>     @PersistentCollection
>     @OrderBy
>     private List<String> strings = new ArrayList();
>
> If you search for "@PersistentCollection" under
> openjpa-persistence-jdbc/src/test/java folder,
> you will get lots of examples.
>
>
> Catalina
>
>
> On 4/12/08, Janko Heilgeist <ja...@rzg.mpg.de> wrote:
> >
> > catalina wei wrote:
> >
> > > Hi Lars,
> > > The feature you are looking for has been addressed in the draft
> of  JPA
> > > 2.0
> > > spec Section 2.1.5 Collections of Embeddable Classes and Basic Types.
> > > I don't think we have this feature implemented in the current OpenJPA
> > > releases.
> > >
> > > Catalina
> > >
> > > On 4/11/08, Lars Vogel <la...@googlemail.com> wrote:
> > >
> > > > Hello,
> > > >
> > > > I would like to persist a object which contains a list of primitives
> > > > (Strings). It is possible or can JPA only store real objects?
> > > >
> > > > I tried it an received an error.
> > > >
> > > > Best regards, Lars
> > > >
> > > >
> > >
> > Hi,
> >
> > what about @org.apache.openjpa.persistence.PersistentCollection? I've
> > never used it myself, but someone mentioned this feature a few days ago
> on
> > this mailinglist.
> >
> > @Entity
> > public MyObject {
> >
> > @PersistentCollection
> > private Collection<String> users;
> >
> > }
> >
> > It is not standard-JPA, though.
> >
> > Janko
> >
> >
>

Re: Annotation of Arraylist myList;

Posted by catalina wei <ca...@gmail.com>.
Hi Lars,
Want to correct my previous email.
OpenJPA does have this feature implemented already, an example can be found
in
org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype.OrderByEntity:
    @PersistentCollection
    @OrderBy
    private List<String> strings = new ArrayList();

If you search for "@PersistentCollection" under
openjpa-persistence-jdbc/src/test/java folder,
you will get lots of examples.

Catalina

On 4/12/08, Janko Heilgeist <ja...@rzg.mpg.de> wrote:
>
> catalina wei wrote:
>
> > Hi Lars,
> > The feature you are looking for has been addressed in the draft of  JPA
> > 2.0
> > spec Section 2.1.5 Collections of Embeddable Classes and Basic Types.
> > I don't think we have this feature implemented in the current OpenJPA
> > releases.
> >
> > Catalina
> >
> > On 4/11/08, Lars Vogel <la...@googlemail.com> wrote:
> >
> > > Hello,
> > >
> > > I would like to persist a object which contains a list of primitives
> > > (Strings). It is possible or can JPA only store real objects?
> > >
> > > I tried it an received an error.
> > >
> > > Best regards, Lars
> > >
> > >
> >
> Hi,
>
> what about @org.apache.openjpa.persistence.PersistentCollection? I've
> never used it myself, but someone mentioned this feature a few days ago on
> this mailinglist.
>
> @Entity
> public MyObject {
>
> @PersistentCollection
> private Collection<String> users;
>
> }
>
> It is not standard-JPA, though.
>
> Janko
>
>

Re: Annotation of Arraylist myList;

Posted by Lars Vogel <la...@googlemail.com>.
Hi Janko,

thank you very much.

Best regards, Lars

2008/4/12, Janko Heilgeist <ja...@rzg.mpg.de>:
>
> catalina wei wrote:
>
> > Hi Lars,
> > The feature you are looking for has been addressed in the draft of  JPA
> > 2.0
> > spec Section 2.1.5 Collections of Embeddable Classes and Basic Types.
> > I don't think we have this feature implemented in the current OpenJPA
> > releases.
> >
> > Catalina
> >
> > On 4/11/08, Lars Vogel <la...@googlemail.com> wrote:
> >
> > > Hello,
> > >
> > > I would like to persist a object which contains a list of primitives
> > > (Strings). It is possible or can JPA only store real objects?
> > >
> > > I tried it an received an error.
> > >
> > > Best regards, Lars
> > >
> > >
> >
> Hi,
>
> what about @org.apache.openjpa.persistence.PersistentCollection? I've
> never used it myself, but someone mentioned this feature a few days ago on
> this mailinglist.
>
> @Entity
> public MyObject {
>
> @PersistentCollection
> private Collection<String> users;
>
> }
>
> It is not standard-JPA, though.
>
> Janko
>
>

Re: Annotation of Arraylist myList;

Posted by Janko Heilgeist <ja...@rzg.mpg.de>.
catalina wei wrote:
> Hi Lars,
> The feature you are looking for has been addressed in the draft of  JPA 2.0
> spec Section 2.1.5 Collections of Embeddable Classes and Basic Types.
> I don't think we have this feature implemented in the current OpenJPA
> releases.
> 
> Catalina
> 
> On 4/11/08, Lars Vogel <la...@googlemail.com> wrote:
>> Hello,
>>
>> I would like to persist a object which contains a list of primitives
>> (Strings). It is possible or can JPA only store real objects?
>>
>> I tried it an received an error.
>>
>> Best regards, Lars
>>
> 

Hi,

what about @org.apache.openjpa.persistence.PersistentCollection? I've 
never used it myself, but someone mentioned this feature a few days ago 
on this mailinglist.

@Entity
public MyObject {

@PersistentCollection
private Collection<String> users;

}

It is not standard-JPA, though.

Janko


Re: Annotation of Arraylist myList;

Posted by catalina wei <ca...@gmail.com>.
Hi Lars,
The feature you are looking for has been addressed in the draft of  JPA 2.0
spec Section 2.1.5 Collections of Embeddable Classes and Basic Types.
I don't think we have this feature implemented in the current OpenJPA
releases.

Catalina

On 4/11/08, Lars Vogel <la...@googlemail.com> wrote:
>
> Hello,
>
> I would like to persist a object which contains a list of primitives
> (Strings). It is possible or can JPA only store real objects?
>
> I tried it an received an error.
>
> Best regards, Lars
>