db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <a...@jpox.org>
Subject Annotation enum : IdGeneratorStrategy
Date Thu, 09 Aug 2007 16:47:20 GMT
JDO2 defines particular id generation 
strategies ... "identity", "increment", "sequence", "uuid-string", "uuid-hex", "native".
Obviously implementations can define their own add-on strategies.

In XML we have free-form text and so people can just type 
<field value-strategy="auid"> and rely on the implementation providing one 
called "auid".
In Annotations they currently can't do this since it uses an enum.

Two possible options
1. Remove IdGeneratorStrategy enum and just let people type in 
the "valueStrategy" name (and @DatastoreIdentity "strategy"), so they can 
access implementations own variants too.
2. Make implementations use the @Extension to access these vendor add-on 
strategies and use IdGeneratorStrategy.UNKNOWN (which is in the enum 

I'm swaying towards 1 since its more consistent with XML specification. Any 
opinions ?

Andy  (Java Persistent Objects - http://www.jpox.org)

View raw message