r_id: 2}, {date_time:
'', visited_profile_id: 2, visitor_id: 2}, {date_time: '',
visited_profile_id: 3, visitor_id: 2}]
But it seemed very RDMS.
I thought then about:
Profile
- visitors: [a collection of keys]
profile: { visitors: [1, 2, 3], name: "Thiago", bio: "...&quo
Thanks!
Well, in JDO you can do:
Query q = pm.newQuery("select id from " + MyClass.class.getName());
I think __key__ can work too, but not sure.
On 4 July 2011 19:09, jMotta wrote:
> Thiago,
>
> Nowadays the amount of documentation and features of both interfaces are
> a
True. I had forgotten about the unowned relationships, but I think again I
will need to retrieve the collections in order to add the new Key, right? Of
course it's much better to retrieve a collection of keys than a collection
of entities. And maybe making the relationship from the LoginHistory to
You just need to retrieve it, change it and close the persistence manager.
No makePersistent method needed.
For example:
public void updateEmployeeTitle(User user, String newTitle) {
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
Employee e = pm.getObjectById(
need to do this:
User user = pm.getObjectById(User.class.getName(), "thiago");
LoginHistory loginHistory = new LoginHistory(now);
loginHistory.setKey(user.getKey().getChild(LoginHistory.class.getName(),
now.getTime());
user.getLoginHistory(loginHistory);
pm.close();
I loginHostory has t
I noticed, at least I couldn't see anything different, that if I omit
this annotation in a field, the behavior of the Persistence Manager is
the same when it comes to make an entity persistent. I'm talking about
fields which type are marked as @EmbeddedOnly.
@PersistenceCapable(detachable = "true"
Hi, everybody.
I'm new to GAE and I've been reading a few books/tutorial about it.
However, something is still not clear to me. It always describes that
a key would have a reference to the entity parent. So, if I have the
following entity User, when it is persisted the Image will have a key
saying