jdo

Ignore case in JDO query

I would like to select a list of results from a database, but the == operator for JDO queries is case-sensitive. Is there a way to select "USER", "user", and "User" from a table using a single parameter? In MySQL you have the LIKE operator, and in Java the equalsIgnoreCase function. However, neither of them work in this example. Persis...

Keeping a JDO persistence manager alive instead of closing it?

Does a persistence manager generally need to be closed? Can you just keep one open and re-use it all the time, ie just repeat this pattern: Transaction tx = pm.currentTransaction(); try { tx.begin(); // do stuff tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } What are the downsides of this? It seems to mak...

Google App Engine JDO queries referring to other tables

I have entity project that has list of task entities. I know project entity id and now I need to get list of project tasks (tasks contain project id). How can I make that kind of query in GAE with JDO? ...

JDO in Android....

I've tried to find any info on that subject; can't find anything. Strikes me as odd, since JDO sounds like the kind of thing smartphones should be very good at doing. Do you know if JDO is possible at all on Android devices, natively, or with external apps/libraries? ...

What does ":P" mean in a JDO query

I am using JDO on google app engine. Each 'Employee' has a 'key'. I have a set of keys and wanted to retrieve all Employees whose key belongs to this set. So I implemented it using the 'contains()' filter as specified here. The code works fine and looks like this - List<Key> keys = getLookupKeys(....) ..//Get keys from somewhere. Quer...

which types require using JDO dependent="true" for cascading deletes?

I'm using the JDO annotation dependent="true" to delete my owned child classes like this: @Persistent(mappedBy = "parent") @Order(column="PARENT_CHILD_IDX") @Element( dependent="true" ) private ArrayList< Child> children = new ArrayList< Child >(); Do I need to do this for other non-custom data types like Long, String, Link, Blob,...

Java: Google App Engine JDO objects don't update

I am getting an object from the Datastore using JDO and the PersistenceManager using some methods I have built. String email = request.getParameter("email"); MyUser user = MyUser.all(myPersistentManager).filter("email", email).get(); this gets me the user with the given email address that was persisted during another session. It works...

problem with deleting object, using PersistenceManager

I'm created Data Class and store data using PersistenceManager, but later I edited my Data Class and now i have problem with share data I'm trying delete this objects (pm.deletePersistent(e)) but I'have exception : javax.jdo.JDOUserException: One or more instances could not be deleted NestedThrowables: org.datanucleus.jdo.exceptio...

Cascade delete in Google app engine datastore

Hi I'm having the fallowing classes in Google app engine import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; public class A { @PrimaryKey @Persistent String pk; @Persistent(dependent = "true") private B b; . . . } and import javax.jdo.annotations.IdGeneratorStrategy; im...

JDO in google app engine other PrimaryKey than type "Key" key possible?

why isn't it possible to define another key than @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; ? If i try to define a @PrimaryKey as say, an Integer I get an Server Error... http://code.google.com/intl/de-DE/appengine/docs/java/datastore/dataclasses.html ...

create entity - google app engine - most convenient way?

whats the most simple way to create a new entity in google app engine? i used now a simple servlet form, but it is annoying to upload a project only because you want to create a new entity. i am using eclipse with java. ( creating entities is documented on google only for python ) ...

Using sets in JDO

I have a model which contains a java.util.Set object as a member. How do I persist this using JDO? Specifically, how do I define the XML in the .jdo file? class MyClass { Set<String> data; private MyClass() { } } ...

How to use JDO(DataNucleus) to Update & Delete data?

Hey! I've set up a small project using apache.JDO /w DataNucleus. I can save data w/o any problems, but I got stuck when trying to update or delete them. The scenario is the following: I create an object & persist it, it gets and id @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private...

App engine does not store List when it is annotated with serializable and defaultFetchGroup set

I am trying to store an Jdo which has a List in it. When the list is annotated with @Persistent (defaultFetchGroup = "true") It works fine, but when I have @Persistent (serializable = "true", defaultFetchGroup = "true") It does not store the list. Does anyone know why? What do I do when I have a list of custom objects that I want...

GWT JDO relatioships problem - child of an object from datastore is null

Hi, I encounter problems while trying to implement GWT JDO features. Let's say there is a Data object that contains an Item object. In the datastore this would create a one-to-one relationship. The problem is that when I try to get the object from the datastore, the 'item' field is always null. Of course I put the object to the datas...

How to query for an interface and filter the resultset with JDOQL?

Hi, I have an interface @PersistenceCapable public interface MyInterface { public abstract String getName(); public abstract void setName(String name); } The persistence layer uses JDO. The JDO implementation is DataNucleus. Now I want to query for any instances of that interface with JDOQL. Query query = getPersistence...

JDO not storing time information in Date, only stores the day

I am using Google App Engine with Java, JDO for persistence. I have my Activity object with timestamp declared as Persistent and of type java.util.Date. public class Activity ... { ... @Persistent private Date timestamp; ... } All Activities stored in the database are seen with correct dTate but time information is always zero. ...

JDO Google App Engine validate user

I've been following the google app engine tutorial and the part that explains JDO is done under the basis of a guestbook. So when they query the persistence (BigTable i believe) they are interested in returning all the results. I'm trying to adapt this for showing the results for the specific user but seem to be having trouble with it. ...

Google app engine:BigTable Client like toad for oracle.

BigTable Client like toad for oracle or SQL Server Management Studio Express? ...

What's the JDO equivalent of the JPA @PersistenceContext annotation

In JPA, you can inject an EntityManager with the @PersistenceContext annotation: @PersistenceContext private EntityManager entityManager; What is the JDO equivalent of this for a PersistenceManager? @???? private PersistenceManager persistenceManager; ...