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...
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...
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?
...
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?
...
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...
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,...
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...
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...
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...
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
...
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 )
...
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() {
}
}
...
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...
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...
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...
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...
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. ...
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.
...
BigTable Client like toad for oracle or SQL Server Management Studio Express?
...
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;
...