[appengine-java] Re: Using @EmbeddedID and @Embedded with JPA ...

2009-08-27 Thread Larry Cable

should'a RTFM'ed :)

On Aug 27, 1:20 am, datanucleus  wrote:
> > btw why does em.flush() throw an exception declaring that it requires
> > a transaction and that there is none in context when the Persistence
> > Provider is clearly configured for non-tx writes
>
> You mean according to the JPA spec 3.1.1, for flush()
> 
> @throws TransactionRequiredException if there is no transaction
> 
>
> so it complies with the JPA TCK then. Don't call flush in a non-tx
> context.
>
> --Andy (DataNucleus)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Using @EmbeddedID and @Embedded with JPA ...

2009-08-27 Thread datanucleus

> btw why does em.flush() throw an exception declaring that it requires
> a transaction and that there is none in context when the Persistence
> Provider is clearly configured for non-tx writes

You mean according to the JPA spec 3.1.1, for flush()

@throws TransactionRequiredException if there is no transaction


so it complies with the JPA TCK then. Don't call flush in a non-tx
context.

--Andy (DataNucleus)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Using @EmbeddedID and @Embedded with JPA ...

2009-08-26 Thread Larry Cable

that's funny because it seems to "work"; well when I say work,
em.persist() of such an entity does not throw ... I'll see what
happens when I try to query an object with such a key ...

errr ... also parenthetically, if it doesn't support @EmbeddedId then
it's not really a conformant implementation of JPA ... :D

btw why does em.flush() throw an exception declaring that it requires
a transaction and that there is none in context when the Persistence
Provider is clearly configured for
non transactional read/writes, surely a flush() would either silently
"do nothing" or commit/write any pending objects to the ds???

:)

Thanks

- larry

On Aug 26, 2:57 pm, "Jason (Google)"  wrote:
> You have four choices for key type which are described 
> athttp://code.google.com/appengine/docs/java/datastore/creatinggettinga
> An embedded Id won't work with App Engine since it can't be naturally
> represented as a Key object.
> - Jason
>
>
>
> On Tue, Aug 25, 2009 at 2:09 PM, Larry Cable  wrote:
>
> > I have given up, seems like this is not supported, the runtime
> > complains that the "MyId" class is not a supported Key Class ... go
> > figure ...
>
> > On Aug 24, 4:15 pm, Larry Cable  wrote:
> > > Has anyone managed to get @EmbeddedId with JPA to work in GAE/
> > > DataNucleus???
>
> > > @Entity
> > > public class MyEntity {
> > >     //...
> > >     @EmbeddedId public MyId id;
>
> > > }
>
> > > // ...
>
> > > @Embeddable
> > > public class MyId {
> > >     //...
>
> > >     public String id;
>
> > > }
>
> > > I'm getting an "unsupported primary key type" exception at runtime
> > > during em.flush()
>
> > > any thoughts? examples of working code?
>
> > > I am pretty sure it's pilot error ... but the documentation for this
> > > is pretty thin on the ground ...
>
> > > will try and isolate an actual "working" example and post that here
> > > also ...- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Using @EmbeddedID and @Embedded with JPA ...

2009-08-26 Thread Jason (Google)
You have four choices for key type which are described at
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys.
An embedded Id won't work with App Engine since it can't be naturally
represented as a Key object.
- Jason

On Tue, Aug 25, 2009 at 2:09 PM, Larry Cable  wrote:

>
> I have given up, seems like this is not supported, the runtime
> complains that the "MyId" class is not a supported Key Class ... go
> figure ...
>
> On Aug 24, 4:15 pm, Larry Cable  wrote:
> > Has anyone managed to get @EmbeddedId with JPA to work in GAE/
> > DataNucleus???
> >
> > @Entity
> > public class MyEntity {
> > //...
> > @EmbeddedId public MyId id;
> >
> > }
> >
> > // ...
> >
> > @Embeddable
> > public class MyId {
> > //...
> >
> > public String id;
> >
> > }
> >
> > I'm getting an "unsupported primary key type" exception at runtime
> > during em.flush()
> >
> > any thoughts? examples of working code?
> >
> > I am pretty sure it's pilot error ... but the documentation for this
> > is pretty thin on the ground ...
> >
> > will try and isolate an actual "working" example and post that here
> > also ...
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Using @EmbeddedID and @Embedded with JPA ...

2009-08-25 Thread Larry Cable

I have given up, seems like this is not supported, the runtime
complains that the "MyId" class is not a supported Key Class ... go
figure ...

On Aug 24, 4:15 pm, Larry Cable  wrote:
> Has anyone managed to get @EmbeddedId with JPA to work in GAE/
> DataNucleus???
>
> @Entity
> public class MyEntity {
>     //...
>     @EmbeddedId public MyId id;
>
> }
>
> // ...
>
> @Embeddable
> public class MyId {
>     //...
>
>     public String id;
>
> }
>
> I'm getting an "unsupported primary key type" exception at runtime
> during em.flush()
>
> any thoughts? examples of working code?
>
> I am pretty sure it's pilot error ... but the documentation for this
> is pretty thin on the ground ...
>
> will try and isolate an actual "working" example and post that here
> also ...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---