JDO and the RequestFactory

74 views
Skip to first unread message

AlexG

unread,
Oct 28, 2010, 5:26:38 AM10/28/10
to Google Web Toolkit
Hi all,

first of all, I want to say that I found no example of using the
RequestFactory with JDO. I want to use JDO with the RequestFactory,
so I´m a little disappointed, that there is so less support/examples.

I tested the RF with JPA and everything seems to work very well.
So I tryed porting it to JDO.

I have several problems, with remove and editing persisted objects.
Querys and persists work very fine at the moment.

So the first point, I´m wondering is, I have an version field on my
class.
I used the @Version annotation form the RequestFactory, and
implemented
the needed methods fpr this field. The problem is, when I create and
persist
a new Object, the version field is not set. The value is always null.
Anybody has an example how this works with RF and JDO??
My class looks like this:


@PersistenceCapable
class MyClass{

...

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;

@Version
@Persistent
private Integer version;

public void setVersion(Integer version){this.version = version;}
public Integer getVersion(){return this.version;}

public Long getId(){return this.id;}
...

}


The second problem is, when I call the function getMyClass(Long id)
I get an Error: EntityKeyId is not Base64 encoded.
I don´t know why I get ths Error.

So anybody has an idea, how I can get the versioning, and the
getMyClass() to work??

Thanks

Greets
Alex

ali

unread,
Dec 4, 2010, 9:34:24 PM12/4/10
to Google Web Toolkit
I am interested to know the answer to this question as well since I'm
using JDO with RequesyFactory.


On Oct 28, 1:26 am, AlexG <alexander.gauss.ax...@googlemail.com>
wrote:

ali

unread,
Dec 4, 2010, 9:48:30 PM12/4/10
to Google Web Toolkit

ali

unread,
Dec 4, 2010, 10:06:23 PM12/4/10
to Google Web Toolkit
Yup, I was able to get it to work with the following annotation:

@Version(
strategy=VersionStrategy.VERSION_NUMBER,
column = "version",
extensions={@Extension(vendorName="datanucleus", key="field-name",
value="version")})

on the domain class and no annotation on the version column.

On Dec 4, 6:48 pm, ali <a.akhava...@gmail.com> wrote:
> Take a look at here :http://www.datanucleus.org/products/accessplatform/jdo/orm/versioning...
Reply all
Reply to author
Forward
0 new messages