Thoughts/suggestions provided by Pinaki:
OpenJPAConfiguration already has a notion of specification – but it is merely a String.
Follow the trail of ProductDerivation.afterSpecificationSet(String spec) and OpenJPAConfiguration.setSpecification(String spec).
Currently Specification is set to "JPA", JDO" etc.
We can consider
a) introduce a internal Specification class with version info as some JDBC drivers do.
b) overload OpenJPAConfiguration.setSpecification(String spec, int majorVersion, int minorVersion)
Irrespective of the mechanics, the idea is to capture more data about which specification OpenJPA kernel is working with.
Detection of which specification is active in runtime controlled by appropriate ProductDerivation but it is hardcoded and does not capture specification version.
The work on schema upgrade for JPA 2.0 may lead to devising some mechanics on detecting specification version. If that is done satisfactorily and early enough (i.e. before configuration is set) during bootstrap, we can stick that version info with the Configuration. Then Compatibility and other stuff can set their defaults based on specification. Or annotation processing can warn on conflicting settings etc.
1. detect or accept user-supplied specification name & version.
2. Plug it into OpenJPAConfiguration.
3. Set default values of Compatibility and other stuff based on Specification
4. Warn during annotation parsing if settings are conflicting etc.