私はここで小さな問題を抱えており、誰かが私を助けてくれることを願っています。
オブジェクトから整数へのマッピングを行いたいです。オブジェクトはFetchtype.Lazyとしてマークされています。
マッピングを行うと、次のエラーメッセージが表示されます。
11:31:46,569 ERROR MappingProcessor:253 - Field mapping error -->
MapId: null
Type: null
Source parent class: ClassA
Source field name: MyObjectProperty
Source field type: null
Source field value: null
Dest parent class: ClassB
Dest field name: myIntegerProperty
Dest field type: java.lang.Integer
org.dozer.MappingException: java.lang.reflect.InvocationTargetException
at org.dozer.util.MappingUtils.throwMappingException(MappingUtils.java:88)
at org.dozer.util.ReflectionUtils.invoke(ReflectionUtils.java:258)
at org.dozer.propertydescriptor.GetterSetterPropertyDescriptor.invokeReadMethod(GetterSetterPropertyDescriptor.java:234)
at org.dozer.propertydescriptor.GetterSetterPropertyDescriptor.getPropertyValue(GetterSetterPropertyDescriptor.java:68)
at org.dozer.fieldmap.FieldMap.getSrcFieldValue(FieldMap.java:82)
InnerException:
Caused by: java.lang.IllegalStateException: Attempt to access an unloaded field of detached instance
dozer xmlファイルでカスタムコンバーターを作成しましたが、コンバーターが呼び出されることはありません。このコンバーターに到達する前に、アプリケーションで問題が発生したと思います。
面白いことに、フィールドを逆に正常にマップできるので、整数をオブジェクトにマップできます。
任意のアイデアに感謝します。さらに情報が必要な場合は、私に一言お願いします。
すべてにThx。