jdo

Difference between JPA and JDO?

want to develop my project on Google App Engine .I want to use google big table as database. For the database I have two options JPA and JDO. Will you guys please suggest me on it? Both are new for me and I need to learn them. So I will be focused on one after your replies. ...

How to store child objects on GAE using JDO from Scala

Hi, I'm have a parent-child relation between 2 classes, but the child objects are never stored. I do get an warning: "org.datanucleus.store.appengine.MetaDataValidator checkForIllegalChildField: Unable to validate relation net.vermaas.kivanotify.model.UserCriteria.internalCriteria" but it is unclear to me why this occurs. Already tri...

JDO Queries: Is it possible to filter using complex objects?

Hi, I'm quite new to JDO and wanted to ask if it is possible to filter using complex objects. I know that you can do something like this: Query q = pm.newQuery(MyClass.class, "field1 < value"); q.declareParameters("int value"); List results = q.execute(205); Iterator iter = results.iterator(); But assume I have the following situatio...

JDO not saving object

I have a class Answer, and when I do pm.MakePersistent on an object of that class it doesn't show up in the database. No exception is thrown or anything. When I do pm.MakePersistent on other classes, they properly show up in the database. Any idea why this could be happening? ...

Google App Engine and SQL LIKE

Is there any way to query GAE datastore with filter similar to SQL LIKE statement? For example, if a class has a string field, and I want to find all classes that have some specific keyword in that string, how can I do that? It looks like JDOQL's matches() don't work... Am I missing something? Any comments, links or code fragments are ...

DataNucleus Enhancer, JDO and Specifying Column Names

I'm working with DataNucleus as part of a Google App Engine project and I'm having a bit of trouble with columns in persistence. @PrimaryKey(column = "user_id") @Column(name = "user_id") @Persistent(name = "user_id", column = "user_id", valueStrategy = IdGeneratorStrategy.IDENTITY) private Key m_id; @Column(name = "user_name") @Persist...

Store java.util.Calendar field into one column

How to store java.util.Calendar field into one column with Datanucleus JDO. By default it is stored into two columns (millisecs, Timezone) with following JDO metadata. field name="startDate" serialized="true" embedded="true" persistence-modifier="persistent" What need to be changed in metadata to sto...

How to retrieve a list of objects which are a property of a class with JDOQL?

I have the next persistence capable classes: @PersistenceCapable public class AppAccount { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private String companyName; @Persistent List<AppUser> users = new ArrayList<AppUser>(); // Getters and Sett...

Java JDO Problem (Google App Engine), What after (PersistenceManager)pm.close

Hello, I'm a newbie in JDO. I use eclipse. After I use (PersistenceManager) pm.close for test, now I delete this pm.close. However I still could not find a way to open or create a new one, even after I restarted the computer. Every time, PersistenceManager show this error, Object Manager has been closed And I could not find a way to d...

Problem detaching entire object graph in GAE-J with JDO

I am trying to load the full object graph for User, which contains a collection of decks, which then contains a collection of cards, as such: User: @PersistenceCapable(detachable = "true") @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) @FetchGroup(name = "decks", members = { @Persistent(name = "_Decks") }) public ab...

What is the JDO order of deletes

I have two tables in my oracle database Request and Approver. Every approver has a request. A foreign key protected by a constraint. In my java code using kodo jdo 3.4 I call delete persistant on some or all of the approvers. Then at the end if no approvers are left I call delete persistant on the Request. When I commit I my integrity...

GAE, JDO, count() doesn't work ?

On GAE with Spring/JDO after saving 2 entities (in transaction). On calling getById - entities fetched from data storage. On calling getCount() returns "0" and - on calling getAll() - returns empty collection. @Override public Long getCount() { return ((Integer) getJdoTemplate().execute(new JdoCallback() { @Override public Obj...

How to do batch Google DataStore key lookup query in JDO

I have about 50k entities stored in appengine. I am able to look up an individual record via the GQL admin interface with a query like: SELECT * FROM Pet where __key__ = KEY( 'Pet','Fido') But I'm having trouble figuring out how to do a batch version of this via JDO. Right now I have this: PersistenceManager pm = ...; for(...

GAE/JDO: How to check whether a field in a detached object was loaded

My DAO detaches and then caches certain objects, and it may retrieve them with different fetch groups. Depending on which fetch group was used to retrieve the object, certain fields of that object may be available, or not. I would like to be able to test whether a given field on that object was loaded or not, but I can't simply check w...

Java App Engine - ranked counter

I understand the sharded counter, here: http://code.google.com/appengine/articles/sharding_counters.html The problem is that a simple counter will not work in my application. I am sorting my entities by a particular variable so I am returned not so much a count, but more of a rank. My current method is: SELECT COUNT(this) FROM Entity.cl...

Why "pm.newQuery(Employee.class)" and not "pm.newQuery(Employee)" in JDO?

In this JDO, why is .class needed here? Query averageSalaryQuery = pm.newQuery(Employee.class); I would prefer to write this more concise syntax if possible? Query averageSalaryQuery = pm.newQuery(Employee); ...

How do these user/userParam references relate to the Customer and Account lookups?

In the following code example how do the user/userParam references relate to the Customer and Account lookups and what is the relationship between Customer and Account? // PersistenceManager pm = ...; Transaction tx = pm.currentTransaction(); User user = userService.currentUser(); List<Account> accounts = new ArrayList<A...

Maven building for GoogleAppEngine, forced to include JDO libraries?

Hi, I'm trying to build my application for GoogleAppEngine using maven. I've added the following to my pom which should "enhance" my classes after building, as suggested on the DataNucleus documentation <plugin> <groupId>org.datanucleus</groupId> <artifactId>maven-datanucleus-plugin</artifactId> ...

What is the correct approach to using GWT with persistent objects?

Hi, I am currently working on a simple web application through Google App engine using GWT. It should be noted that this is my first attempt at such a task. I have run into to following problem/dilema: I have a simple Class (getters/setters and nothing more. For the sake of clarity I will refer to this Class as DataHolder) and I want...

JDOQL Any way to avoid multiple .contains() calls in the query when searching for the presence of one or more elements in a member List variable?

The question pretty much says it all. If I have a class Class A public class A { ... private List<String> keys; ... } And I want to select all A instances from the DataStore that have atleast one of a List of keys, is there a better way of doing it than this: query = pm.newQuery(A.class); query.setFilter("keys.contains(:...