jdo

stale entries in a collection when using detached objects and JDO

I have a class which has a collection. Elements in the collection also have a collection. i am fetching the class instance and detaching it. Now i am updating the collection field to a new collection and then persisting the detached object. To my surpruise the objects collection now has the old elements and the new elements. How do i fix...

How to use @PersistentCapable annotation in Scala 2.8

Hi, I'm switching from Scala 2.7.7 to Scala 2.8.0RC3 and now a few of my classes don't compile anymore. The problem is in the @PersistentCapable annotation: import javax.jdo.annotations._ import java.util.Date @PersistenceCapable{identityType=IdentityType.APPLICATION} class Counter(dt: Date, cName: String, vl: int) { <.. snip ..> } ...

JPA/JDO entity to XML XSD generator.

I am using JDO or JPA on GAE plugin in Eclipse. I am using smartgwt datasource, accepting an xsd. I would like to be educated how to generate an XSD from my jdo/jpa entity, vice versa. Is there a tool to do it? While datanucleas does all its magic enhancing in the Eclipse background, would I be able to somehow operate in a mode that w...

Can't wrap my head around appengine data store persistence

Hi, I've run into the "can't operate on multiple entity groups in a single transaction." problem when using APPENGINE FOR JAVA w/ JDO with the following code: PersistenceManager pm = PMF.get().getPersistenceManager(); Query q = pm.newQuery("SELECT this FROM " + TypeA.class.getName() + " WHERE userId == userIdParam "); q.declarePa...

Google AppEngine JDO Persistence FK Arrays

I'm hoping someone's seen this. I've found no clues on Google. I'm using Google AppEngine with JDO to persist my objects. I have two objects, Parent and Child. Each Parent has n Child objects. I initially stored the Child objects in an ArrayList data member in the Parent class. I got the exception "java.lang.UnsupportedOperationExcep...

Google App Engine - Using managed relations

Guys I am experimenting with App engine. One of my stumbling blocks has been the support for managed relations or lack there off, this is further compounded by the lack of join support. Without getting into details of the issues I have run into (which I will post under different topic), I would like to ask two things. 1. Has any one ...

Where do Entities get saved if you run a GAE project in development mode?

I am running a GWT Web Application project in Eclipse with certain Entities that I make persisent using JDO. Where (on my file system) do these Entities actually get saved if I run the project in development mode from Eclipse (so not on the Google App Engine, but locally)? ...

JDO architecture: One to many relationship and cascading deleting

I’m new to object oriented database designs and I’m trying to understand how I should be structuring my classes in JDO for google app engine, particularly one to many relationships. Let’s say I’m building a structure for a department store where there are many departments, and each department has many products. So I’d want to have a cla...

Are there tools to generate a ddl schema from JDO annotated pojos?

Perhaps i'm wandering down the wrong path - I'm looking for a tool like hbm2ddl. I currently have domain model (pojos with JDO annotations) - I need to setup the database. I want to experiment with a few database types - HSQLDB, Google App Engine, Oracle. Can anyone offer advice on how to proceed? ...

How to instert child entities in JDO (Google App Engine) ?

How do i add a record to a child entity in the example below ? For example i have a Employee Record which is name is "Sam". how do i add 2 street adress for sam ? Guess i have a The Parent entity is Employee import java.util.List; // ... @Persistent(mappedBy = "employee") private List<ContactInfo> contactInfoSets; The Child key is ...

Datanucleus JDO Retrieve newly generated primary key

I am using datanucleus and jdo in a GWT project. How can I retrieve the generated primary key after adding an element to the database with makePersistent() Edit We use annotations, here is the primary key: @PrimaryKey @Column(name = "id_bla", allowsNull = "false") @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY, extensions...

How do I return an Array from grails / jdo to Flex

this seems really simple but I haven't gotten this to work. I am building my app with grails on google app engine. This pretty much requires you to use JDO. I am making an HTTP call from flex to my app. The action that I am calling on the grails end looks like so def returnShowsByDate = { def query = persistenceManager.newQuery( Sh...

Can I execute SQL statements directly in a JDO environment?

I am using Datanucleus JDO on top of HSqlDb. I would like to execute the following SQL statement to tell HsqlDb to set the write delay to 0: "SET WRITE_DELAY 0" Is there a way I can do this from a JDO PersistenceManager or a PersistenceManagerFactory? On a sidenote: I have tried to modify write_delay by using the following connection ...

Can JPA do batch update | put | write | insert as pm.makePersistentAll() does in GAE/J

I searched through multiple discussions here. Can someone just give me a quick and direct answer? And if with JPA you can't do a batch update, what if I don't use transaction, and just use the following flow: em = emf.getEntityManager // do some query // make some data modification em.persist(..) // do some query // make some data modi...

grails with JDO - how do I work with persistenceManager correctly

I am creating an application with google app engine and grails. I have a Controller set up for my Flex application to call. The Controller calls a service to get a list back and send it back to Flex. The Flex client is able to get the data back one time. Also If I call the action in the browser I can call the action and get data back as...

How to query JDO persistent objects in unowned relationship model?

Hello, I'm trying to migrate my app from PHP and RDBMS (MySQL) to Google App Engine and have a hard time figuring out data model and relationships in JDO. In my current app I use a lot of JOIN queries like: SELECT users.name, comments.comment FROM users, comments WHERE users.user_id = comments.user_id AND users.email = '[email protected]...

One-to-many relationship with JDO in Google App Engine

I've followed the GAE docs on setting up one-to-many relationship in JDO but I'm still having trouble in retrieving the collection data back. I have no problem getting the other non-collection fields back. Here are my classes: @PersistenceCapable public class User{ @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDE...

JDO difficulties in retrieving persistent vector

I know there are already some posts regarding this subject, but although I tried using them as a reference, I am still stuck. I have a persistent class as follows: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class GameObject implements IMySerializable{ @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy....

Persisting a list of serializable objects

Hello, I'm still trying to persist a list of serializable objects. I would expect this to be a standard collection as described here: http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Collections That gave me an exception complaining that: FooObject is not a supported property type. When that didn't work, I tried ...

Avoid DataNucleus joins?

I'm experimenting with moving a JDBC webapp to JDO DataNucleus 2.1.1. Assume I have some classes that look something like this: public class Position { private Integer id; private String title; } public class Employee { private Integer id; private String name; private Position position; } The contents of the Position SQL table really...