Apparently I forgot about the nulls. Here is the fixed code:
diff -r1.3 EnumTypeConverter.java
107a108,121
>
> /**
> * INTERNAL:
> * Convert Enum object to the data value.
> */
> public Object convertObjectValueToDataValue(Object attributeValue,
Session session) {
> if (attributeValue == null) {
> return super.convertObjectValueToDataValue(null, session);
> }
>
> Enum theEnum = Enum.class.cast(attributeValue);
> return (m_usesOrdinalValues)? theEnum.ordinal() : theEnum.name();
> }
>
thanks,
-marina
Marina Vatkina wrote:
> Tom, Team,
>
> This issue (https://glassfish.dev.java.net/issues/show_bug.cgi?id=634)
> is caused
> by the problem with ORB unmarshalling rules
> (https://glassfish.dev.java.net/issues/show_bug.cgi?id=193).
>
> There seems to be an easy solution to solve this bug for TopLink users
> by adding
> an override method to EnumTypeConverter that just returns the corresponding
> value instead of looking it up (and why bother spending time on lookup
> in this
> case?).
>
> diff -r1.3 EnumTypeConverter.java
> 107a108,118
> >
> > /**
> > * INTERNAL:
> > * Convert Enum object to the data value.
> > */
> > public Object convertObjectValueToDataValue(Object
> attributeValue, Session session) {
> > Object fieldValue;
> > Enum theEnum = Enum.class.cast(attributeValue);
> > return (m_usesOrdinalValues)? theEnum.ordinal() :
> theEnum.name();
> > }
> >
>
> I verified that it works correctly with the test attached to the issue
> in both
> modes (one has been failing without the fix).
>
> What do you think?
>
> thanks,
> -marina