db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew T. Adams" <matthew.ad...@xcalia.com>
Subject RE: Annotation enum : IdGeneratorStrategy
Date Thu, 09 Aug 2007 16:54:44 GMT
+1

-----Original Message-----
From: Andy Jefferson [mailto:andy@jpox.org] 
Sent: Thursday, August 09, 2007 9:47 AM
To: jdo-dev@db.apache.org; JDO Expert Group
Subject: Annotation enum : IdGeneratorStrategy

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 
currently)


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

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


Mime
View raw message