I have a simple domain model as follows
Driver - key(string), run-count, unique-track-count
Track - key(string), run-count, unique-driver-count, best-time
Run - key(?), driver-key, track-key, time, boolean-driver-update, boolean-track-updated
I need to be able to update a Run and a Driver in the same transaction; as well as a Run and...
Is it possible to Autowire the JDO PersistenceManager?
In the example below, only the PersistenceManagerFactory is Autowired, while the PersistenceManager is obtained using a getter and utility method before each operation.
import org.springframework.orm.jdo.PersistenceManagerFactoryUtils;
@Service
public class MainServiceImpl impleme...
Despite the fact that my JDO query contains TWO declareParameters statements, the code below produces an error claiming only one parameter is accepted:
Query requires 1 parameters, yet 2 values have been provided.
The two parameters are amountP and taxP:
javax.jdo.Query query= pm.newQuery(Main.class);
query.setFilter("amount == amo...
Instead of instantiating a PersistenceManagerFactory within my app like this:
Properties properties = new Properties();
properties.setProperty("javax.jdo.PersistenceManagerFactoryClass",
"org.datanucleus.jdo.JDOPersistenceManagerFactory");
properties.setProperty("javax.jdo.option.ConnectionDriverName","com.mysql.jdbc.Dri...
I tried to add a property to my User class to get it to automatically load its child records (contacts).
According to the error below, this doesn't seem possible, at least the way I tried to do it:
@Persistent(mappedBy = "user", defaultFetchGroup="true")
private List<Contact> contacts;
WARNING: Meta-data warning for com.contactl...
I've got this code (Java, GAE):
// Much earlier:
playerKey = KeyFactory.keyToString(somePlayer.key);
// Then, later...
PersistenceManager pm = assassin.PMF.get().getPersistenceManager();
Key targetKey = KeyFactory.stringToKey(playerKey);
Query query = pm.newQuery(Player.class);
query.setFilter("__key__ == keyParam");
query.declarePara...
Is it possible to store a collection of embedded classes in Google App Engine (Java)? If so, how would I annotate it?
This is my class:
@PersistenceCapable
public class Employee
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
Key key;
@Persistent(embeddedElement = "true")
private List<Contac...
I have a simple app I'd like to use JDO. But I don't want to use any DB back, just regular file system. Before jdo, I had this class it serializes it object to a file whereas file name is the "primary key". I'd like to be able to do the same thing with JDO. Is that possible?
...
I have two classes, Truck and Tweeter, where every Truck must have a Tweeter and every Tweeter can have any number of Trucks associated with it. All I want is to be able to store a reference of the associated Tweeter in all my Truck objects so I can access it without having to explicitly look it up. Given a Tweeter, I don't need to kno...
I am getting below error whilst trying to persist an object that has a collection of interfaces which I want to hold a couple of different types of objects. Seems to be happening almost randomly. Sometimes after restarting it works ok ( I might be doing something wrong though).
class CommentList {
@Persistent
@Join
ArrayList<IComment> ...
I cant imagine any more methods to solve my problem. Here's a thread I made yesterday that describes the parent and child class in detail: http://stackoverflow.com/questions/3800450/many-to-one-unidirectional-gae-jdo-relationship-amongst-entities
I'm trying to add a Truck and persist it, but the persistence manager insists that the p...
I'm trying to construct a JDOQL query (using datanucleus) that will search for matches of a parent class based on criteria in an owned one-to-many child class. The query looks like this:
Query lQ = lPm.newQuery("select from "+Module.class.getName()+
" where moduleMappings.contains(m)" +
" && showNameParam.ma...
This syntax does not produce unique values across different Fetch Groups:
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private long id;
So I've written the method below to simulate generating a database sequence for my Order model. But what I'm not sure about is what the transactional state needs to be configured as here ...
I'm using eclipse and google appengine plugin to develop a war app. I'm trying to use JDO persistency (per appengine rules). I'd like to be able to inspect, add and remove jdo objects my app uses. Is that possible? If so, how?
...
I am trying to duplicate the pattern described in Building Scalable, Complex Apps on App Engine. I am having trouble understanding how to tell GAE that Message index is a child of Message. From google, they say that you create a child object by including it in the parent class, but this is exactly what we are trying to prevent. So how...
I need to update entity that I loaded from the datastore. How can I do this with GAE JDO?
...
App Engine Datastore cannot be queried for an aggregate result.
Example:
I have an entity called "Post" with the following fields:
Key id, String nickname, String postText, int score
I have many different nicknames and many posts by each nickname in my datastore.
If I want a leader board of the top ten nicknames of total scores, I w...
Hello,
Is it possible to do Incremental syncronization for occasionally connected clients using JDO.
I stumbled upon JDOReplicationManager but not sure whether is solves the following needs,
Replication to be initiated from an web application.
Replication should be a two way process. i.e. Synchronization
If there is a failure in netwo...
Do not close this as a duplicate of other questions because I'm not asking the same thing. They're also about a year old. That said, see these links:
http://db.apache.org/jdo/jdo_v_jpa.html
http://www.datanucleus.org/products/accessplatform/jdo_jpa_faq.html
http://www.datanucleus.org/products/accessplatform/persistence_api.html
It se...
I want to have my DB server opensource and capable of saving hystory of record changing.
Meaning I do not want it to be way 2 complicated , I'd love to operate with it like with JDOs but with some kind of revision extention... or SQL like DB with extended sintax and search capabiletis... So is out there any such?
...