Looks good Pramod please check in, there is no need for the null check on the field.type though. You can just set the type from the accessor.
--GOrdon
-----Original Message-----
From: Pramod Gopinath [mailto:Pramod.Gopinath_at_Sun.COM]
Sent: Thursday, March 16, 2006 5:13 PM
To: Gordon Yorke
Cc: persistence_at_glassfish.dev.java.net
Subject: Code changes relevant to issue 349 - java2db and @Version
datatype
Hi Gordon
The code change is to deal with the fact that for @Version field we
are not setting the field type. So for a number field during java2db we
are always creating a field of type BigDecimal and ignoring the type of
the field on which the @Version has been defined.
The solution has been made in
src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataProcessor.processAccessor()
to set the databasefield type correctly.
If the type is correctly then
src/java/oracle/toplink/essentials/descriptors/VersionLockingPolicy.
initializeProperties() will not set the type of the field to BigDecimal.
I have attached the diffs and jar file. Also ran the
entity-persistence-tests and all passed.
Thanks
Pramod