You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by GitBox <gi...@apache.org> on 2022/10/28 22:58:34 UTC

[GitHub] [db-jdo] clr-apache commented on pull request #60: [JDO-709] Enable Element.TYPE for @Convert

clr-apache commented on PR #60:
URL: https://github.com/apache/db-jdo/pull/60#issuecomment-1295607626

   The original goal for having Element.Type apply to @Convert was to allow a PersistenceCapable class to have all of the field convert annotations in one place at the definition of the class instead of needing the annotation on each field/property. But this requires new properties on @Convert to identify the field plus the converter for each field. We decided that this use case was not really needed.
   But a different use, case recently identified by @Dieken is to annotate the field type for a user-defined class that will by default always use the converter regardless of which PersistenceCapable class the field is defined in. This use case requires the Element.Type to be supported by @Convert.
   Note that the JPA annotation supports this use case and therefore there should be minimal changes needed to DataNucleus to support JDO in addition to JPA which is already supported. Perhaps @andyjefferson can comment on whether this can be done easily or if it already should work with JDO if the annotation is enabled.
   To properly support this use case we should have TCK tests for it. There are already test cases for AttributeConverters which should have a new test added.
   One test case should annotate a new user-defined type with @Convert and verify that the converter is used for date between memory and the datastore. Another test case should override the default case and verify that the override conversion is used instead of the conversion defined in the annotation for the class.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jdo-dev-unsubscribe@db.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org