I have an Entity type say URLInfo which keeps info about URLs. The primary 
key of this entity is URL itself ( that makes sure that I always have 
unique URLs in the datastore). I also want unique integer id for each url 
so that sharing the id becomes easier. Though, I can use GUIDs, but that is 
not a preferred thing for me. How can I achieve this requirement? Integer 
Ids need not be sequential ( preferred, if they are). Entities can be 
generated at a faster rate (that means I can't keep a common counter to 
update each time I generate a new URL record). This is what I have tried so 
far - In the URLInfo class, I defined a field - Long Id and annotate it 
with @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) in the hope 
that it will get automatically generated with the unique value. But when I 
save the new entity (with id set as null), it saves the entity in the 
datastore but doesn't assign any value to this field.

I am trying all this on a local machine. I am using Java/JDO.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/DQYcuXI9AJYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to