jdo

Base Class "Does Not Seem to Have Been Enhanced" After Upgrade of Google App Engine SDK for Java

I get errors like this when attempting to run unit tests under App Engine SDK 1.2.8. The unit tests pass under SDK 1.2.6 using the same code. "Class com.foo.bar.BaseClass does not seem to have been enhanced. You may want to rerun the enhancer and check for errors in the output" A class which extends BaseClass IS persisted, but has the...

org.springframework.transaction.annotation.Transactional vs javax.jdo.annotations.Transactional

when using spring @Transcational on service layer, I will need to put <annotation driven> on xml file. may i know can javax.jdo.annotations.Transactional be used on service layer just like spring does? do not need to configure xml files. etc? can javax.jdo.annotations.Transactional be used on service layer independent on whether i usi...

How do I map a conditional many-to-many relationship with JDO?

I have two objects, A and B. They both share the same types of fields, 1 and 2. Their relationship can be expressed in SQL as follows: A's Bs: SELECT * FROM B WHERE B.1 = A.1 AND (B.2 = A.2 OR B.2 IS NULL) B's As: SELECT * FROM A WHERE B.1 = A.1 AND (A.2 = B.2 OR B.2 IS NULL) That's the tricky part - that B.2 can be null and still b...

Querying if an array contains an element in JDO

I have a model that has an array of Strings called tags, public class Model { private String tags[]; ... } How do I make a query that looks at if the array tags contains a certain string say if a certain model's tag attribute looks like this tags[] = {"Java","Programming"} I want to make a query in JDO that's gets all Mode...

Problem with JDO pagination

I have a unit test that populates the datastore with 26 entities. I have a DAO that tries to retrieve these entities and page through them but somehow I can't get it to work entirely. If I do query.setRange(0,10) it works but not for query.setRange(10,20). The query returns 0 results even if the unit test shows that I have 26 entities. ...

What's the easiest way to persist java objects?

Right now I have java program whose classes are currently POJOs and stored in volatile memory. These need to be persisted. As I understand it two popular choices are JDO and the Java Persistence API. For someone who know little about SQL, Torque, etc, which is the easiest way to add persistence to my program's data? ...

JDO not fetching collection member field.

Hi Have a class: class Node implements Serializable { private String name; public String getName { return name; } public void setName(String val){ name = val; } public Node(){} } @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") class NodeBag implements Serializable { @PrimaryKey ...

Gae Jdo persistance on one-to-many owned relationship with bidirectional navigation

I'm trying to persist a one-to-many owned relationship with bidirectional navigation in gae using jdo. I manually add the Contact to User class, and I would expect that in the end the contact will have a reference to the parent User class. If I configure this manually before i persist the parent i get an exception at org.datanucleus....

Google App Engine (Java) + Spring managed PersistenceManager

Hi, I've got kinda problem with JDO persistence of a list of just retrieved objects. What I want to do is to: Fetch list of "Orders" Modify one property "status" Make bulk update of "Orders" What I've got so far is "Object with id ... is managed by a different Object Manager". But wait, I haven't faced such a problem without Spring...

Is there a way to have a non-persistent field in GAE/J using JDO?

I intend questions not to be a child since I had to manipulate it independently, and I don't want to persist the questions field, I would to fill it up by retrieving the questions manually. Here is the code. Questionnaire.java @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Questionnaire{ //supposedly ...

Can I use JDO to serialize entities into byte[] ?

In Google App Engine, I can use JDO to persist Java objects into the data store. Can I also use JDO to turn the object into a byte[], so that I can put it into memcache or send it over HTTP? Clarification: I want to serialize classes that I have already annotated for JDO persistence. Having to use another serialization mechanism seems t...

Datanucleus/JDO Level 2 Cache on Google App Engine

Is it possible (and does it make sense) to use the JDO Level 2 Cache for the Google App Engine Datastore? First of all, why is there no documentation about this on Google's pages? Are there some problems with it? Do we need to set up limits to protect our memcache quota? According to DataNucleus on Stackoverflow, you can set the follow...

getObjectsById on App Engine

According to JDO, you can use PersistenceManager.getObjectsById to load multiple entity instances by their object id. What kind of Collection does one need to use here? A Google Data Store Key does not work as object id. ...

cannot fetch image data in gwt google datastore - image is strected out

I have a class in which I have decrlared a serialized class to store image data @Persistent(serialized = "true") private DownloadableFile imageLogoFile; Implementation of the class public class DownloadableFile implements Serializable { public DownloadableFile(byte[] content, String filename, String mimeType) { super(); this....

Multiple Class in JDO Query

Hello, I'm currently developing in GAE and I have to query like this using JDO: SELECT table1.column1, table2.column2 FROM table1, table2 WHERE table1.column1 = table2.column1; I tried this one but it won't work: String query = "select from "+Assessment.class.getName()+ "a, "+ Project.class.getNa...

How to always use the same PersistenceManager within the same RPC request on Google App Engine

Is there a way to ensure the same PersistenceManager instance is used throughout the different code parts executed in the context of the same RPC request? Having to manually handle out the persistence manager instance from function to function is quite a pain: for example: private void updateItem(ItemModel listItem) throws ...

How is KODO JDO distributed cache performance?

Does anyone have experience with KODO JDO's distributed cache mechanism? I would like to know: 1) what is the latency like between distributed cache updates (so if two users are hitting two separate caches i.e. on two different JVMs and are using the same data and one makes an update, when will the other user, using the other cache, see...

Adding Google App Engine support and keeping standalone support.

I have a java web application built on Stuts2/Google Guice/JPA. It uses hibernate as the JPA vendor. I would like to add support so it can be used on Google's App Engine. Of course I'm running into issues with the queries and mappings. Such as Many-to-Many and joins not being supported. I'm trying to come up with the best solution f...

Appengine jdoconfig.xml for local database

Has anyone successfully configured JDO datanucleus default to google app engine to work on a local database? Why am I always getting an error in jdoconfig.xml when I have specified the property "datanucleus.storeManagerType" with value "rdbms." at the end part. I tried googling but seems no luck. Caused by: org.datanucleus.exceptions....

Persist List of objects

Hi, I got this "javax.jdo.JDOFatalUserException: Error in meta-data for don.Comment.id: Cannot have a java.lang.String primary key and be a child object (owning field is don.Post.comments). NestedThrowables:" when running my grails + app-engine webapp How can I fix this? class Comment.groovy import javax.jdo.annotations.*; @Persi...