jdo

[app-engine-java-groovy] One-to-Many relationship. Select objects from datastore.

Hi. I've omitted some code(package declarations, imports, other fields) for shortness. I have here simple One-to-Many relation. It worked fine till this moment. @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") class Restaurant implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGenerator...

Loading a collection of Enums with Google app engine datastore

I am using the Goole app engine datastore with Java and trying to load an Object with a List of Enums. Every time I load the object the List is null. The object is @PersistenceCapable(identityType = IdentityType.APPLICATION) public class ObjectToSave { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) pr...

JDO: referencing a collection of entities "owned" by another class

I have a RecipeJDO that contains a List<IngredientJDO>. RecipeJDO "owns" the ingredients. This has been working well for me for several weeks. Now I'd like to introduce a new class "GroceryListJDO", that references the ingredients owned by various recipes. When I try to persist a new GroceryListJDO I get the following: javax.jdo.J...

Google App Engine, JDO, and equals/hashCode

I've got an app in Google App Engine that was working fine. I realized that one on of my JDO-enhanced objects that I forgot to implement equals and hashCode (I need to use the object in a set). So I did. I didn't really do anything special in these implementations, in fact I just used Eclipse to generate them. Like so: @PrimaryKey @Pers...

JDO, GAE: Load object group by child's key

I have owned one-to-many relationship between two objects: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class AccessInfo { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private com.google.appengine.api.datastore.Key keyInternal; ... @Persistent private PollIn...

Is it possible to load child object from JDO? (Java, Google App Engine)

I persist in storage an object with a child inside it. There is an "Owned One-to-One Relationships" (http://code.google.com/appengine/docs/java/datastore/relationships.html#Owned%5FOne%5Fto%5FOne%5FRelationships). Now I want to load objects but I have ONLY id of child's object. Is it possible? Child c = new Child("chld23", "I'm a c...

GWT + JDO + ArrayList

Hi, I'm getting a Null ArrayList in a program i'm developing. For testing purposes I created this really small example that still has the same problem. I already tried diferent Primary Keys, but the problem persists. Any ideas or suggestions? 1-Employee class @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Em...

Deleting from a Set in Google App Engine is not being persisted

I see a similar question in Problems while saving a pre-persisted object in Google App Engine (Java), and indeed I was not calling close() on my persistence manager. However, I am now calling close, but my object update is not being persisted. Specifically, I want to remove an element from a Set, and save that smaller set. Here is the...

Delete an entity by key without fetching it first in app engine (using JDO)

Is there a way to delete an entity without having to fetch it from the datastore first? I am assuming I already have the key or id for the entity. I'm thinking of something like deleteObjectById that would be an analogue to getObjectById on PersistenceManager. The closest I can think of is using Query.deletePersistentAll() (as seen her...

Error saving image into Google App Engine/Java

I'm trying to make following JDO entity in GAE/J (I'm using Gilead). package test.domains; import java.io.Serializable; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.Prim...

Code sharing in GWT app engine

I have an Employee class @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Employee { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private String firstName; @Persistent private String lastName; ...

App engine many-to-many data modelling

I have a question regarding how to model a many-to-many relationship in App Engine: A Blogentry can have many tags, a tag can apply to many blog entries. I see a couple of scenarios: Use a Set of Strings as an attribute on the blog entry. This allows me to easily query for an entry using a tag This does not allow me to fetch all ta...

Problem with persisting data in Google Application Engine

Hi, we are having a hard time persisting data in our google app project, we have the classes "Customer" "Reservation" and "Room". Our goal is to map a relation between these, with a one-to-many relation from Customer to Reservation and a one-to-many relation from Room to the same Reservation. The exception we get is: Error in meta-dat...

Swap two elements in a list using JDO on Google Appengine

I have a TestEntity that has an ArrayList of ChildEntities. They are joined in a owned relationship. I want to get the Entity from the datastore, update an int field in the child entity, and then swap the position of the two child entities. However, as soon as I swap the entities, it appears as though the updates to the int field are e...

persisting persistence; or moving legacy webapp to non-relational store

Suppose you have a huge app with a data access layer bound to SQL You want to provide other non-sql DAL, for instance a GoogleAppEngine instance or XML-based backup. How would you approach this migration to a different storage paradigm but with limited flexibility, since it is legacy. I might be missing info here, but One solution I ha...

Troubleshooting DataNucleus JDO

I am using the Eclipse plugin for Google App Engine 1.2.6 and Web Toolkit 1.7.1 DataNucleus/JDO is driving me mad! I suspect either my creates are silently erroring out before being written AND/OR the reads are inconsistently populating the objects. I could use some tips on figuring out what is really happening. Using a minimally unm...

Does Google App Engine supports JDO data objects with "Object" fields?

I have an "Object" field in one of my JDO classes, like this: @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true") class Foo { ... @Persistent @Value(types={java.lang.Boolean.class, java.lang.String.class}) Object bar; ... } When I tried to access this field, I got the following exception: ...

JDO designer eclipse plugin

Is there an eclipse plugin for jdo which has a designer tab and a source tab like the xml editor? The designer tab would have a table for me to key in all the fields, each row per field, with columns defining if that field is String, persistent, etc. Then I flip over to source tab and, voila, is the java class source. Or something lik...

Whats the difference between JPA and JDO specifications?

I have been using Hibernate ORM, which is an implementation of the JPA specification to manage relational data. I have also heard of the JDO specification that supposed to do the same (manage relational data). What are the fundamental differences between the two? Any code samples most appreciated. How does JDO integrate with other Java ...

Do gae datanucleus annotations modify our java code?

I placed this question in Google groups for gae java (http://groups.google.com/group/google-appengine-java/browse%5Fthread/thread/85dc9f10d7e12a3), but sometimes it takes a week for someone to bother answering a question and I feel I need to know the answer much quicker. We are advised to have our persistent fields accessible only thro ...