Hi.
I'm experiencing that EL pick the wrong converter. I have a
Scala-project where I have converters for Option[Int] and
Option[Long] etc. For some reason the OptionIntegerConverter
is used where OptionLongConverter should be used.
I'm unable to reproduce this on another project.
Where in the code is the converters mapped to types, so I
can debug and see what's going on?
After som digging and debugging here's what's going on:
I have a Scala-project and am trying to auto-apply converters
for Option[<primitive type>], ie. Option[Long],
Option[Int] etc. It appears Scala generates byte-code like
Option[java.lang.Object] for these type, as opposed to
reference-types (AnyRef) where it correctly generates
Option[java.lang.Long]. Because of this it is impossible (I
think) for EL to automatically distinguish between fields of
type Option[Int] and Option[Long], and the generation of
MetadataProject.m_autoApplyConvertAccessors merges all of them
to one type, Option[java.lang.Object].
The solution is to always annotate fields of Option-primitive
types explicitly with @Convert.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
--

Guy Pelletier
ORACLE Canada,
45 O'Connor Street
Suite 400
Ottawa, Ontario
Canada K1P 1A4
Oracle is committed to developing practices
and products that help protect the environment