views:

331

answers:

1

I am using Google App Engine with Google's JDO implementation to save an entity for which I wish to provide an URL that a user can navigate to to view information about that entity. The problem I have is that the key generating strategy IdGeneratorStrategy.IDENTITY produces very long keys while the INCREMENT and SEQUENCE strategies are not implemented. I was planning to use the key as part of the URL to link to the entity, however since the only option I have to create a system generated key would result in an unwieldy URL I'm looking for suggestions how how to create a manageable URL to link directly to an entity in my datastore.

Is there any other option other than to create and maintain my own id generator?

+3  A: 

Don't use the whole key - just the ID field. You can construct a key from the model name and the ID.

Nick Johnson
Thanks Nick, this answered my question.
Enrique Anaya