I have two objects one user and one role that I'm constantly using using GDO and goggles app engine. Two datatapes are associated with each other because many people are sad for many relationships. I tried the model which is as much as the GA-Tutorial as a set of keys to the same object. By the time I make my items, these keys are zero. So to generate some keys, I make those items continuously, after that, I add the referencing keys for those objects. Although those keys are not finally archived.
In addition to setting the key, I also manipulate some other features (after MacCententant) these changes later appear in the datastore. However, all the important changes that I make when I create do not make it into the datastore if I set it before setting the key, then they will accumulate as much as they want. However, this is not a solution, because at least one object must be acquired logically after receiving significant logic.
To illustrate the problem, under some sample code
What is a good practice to store those keys?
Strong Role Class
Role of Public Sections {@PrimaryKey @Persistent (valueStrategy = IdGeneratorStrategy.INDNTITY) Private Key Role_id; @ Presentation Private Set & lt; Key & gt; User = new hashet & lt; Key & gt; (); ...} firm user class
public class user {@PrimaryKey @ PERSPEST (value strategy = ID generator transit .info) private key User_id; @printingent private string email = null; @ Presentation Private Set & lt; Key & gt; Roles = New Hashet & lt; Key & gt; (); ...} Removing the code that creates 1 roll and 1 user and tries to set the key-reference on both sides. They change the keys, not in the datastore, however, at the email address The change is written to the data store. ...
Persistence Manager pm = PMF.get (). GetPersistenceManager (); Role GlobalAdmin = New Role (); User Daniel = new user (); Try Pm.makePersistent (GlobalAdmin); Pm.makePersistent (Daniel); } Hold (exception e) {System.out.println ("storage failed:" + e.getMessage ()); } GlobalAdmin.addUser (Daniel.getUser_id ()); Daniel.addRole (GlobalAdmin.getRole_id ()); Daniel.setEMail ("a@b.com"); Pm.close (); ...
I think you should read the documentation from Daytonuclease. It will presently explain your solution.
Provides an interface for the persistence of the JDO object. JDO 1.0 does not provide a way to pick an object that was just that and just works on it and updates the item released later to manually copy the fields and make them immediately afterwards The object must be copied. JDO 2.0 introduces a new way of handling this situation, from which an object is strongly separated from the graph, which can be used in the user's application. This can later be linked to the firmness graph.
Comments
Post a Comment