[seasar-dotnet:1013] DBFlute &S2Dxoによるデータ詰め替えについて
中井 雅文
[E-MAIL ADDRESS DELETED]
2008年 10月 20日 (月) 17:38:40 JST
お世話になります。中井と申します。
現在、Quill、DBFlute、S2Dxoでアプリケーションを作成しております。
DBFluteで自動生成したEntityをカスタムDtoに移送しようとS2Dxoを使ったのですが、
以下のExceptionが発生してしまいました。
(移送元が試しに作ったカスタムEntityであれば問題ありません)
【発生場所】
Seasar.Dxo.Interceptor.DxoInterceptor._TryExchangeSameNameProperty
【例外内容】
'System.StackOverflowException' のハンドルされていない例外が mscorlib.dll で発生しました。
S2Dxoのソースを見て、下記部分をコメントアウトすると、データの移し替えも正しく行われたのですが、何か他に影響が出ますでしょうか?
お忙しいところ申し訳ありませんが、よろしくお願い致します。
-----------------------------------------------------
destInfo = destType.GetProperty(targetPropertyName);
if (destInfo != null && destInfo.CanRead && destInfo.CanWrite)
{
_ConvertProperty(sourceInfo, source, dest, destInfo, existProperty);
}
// 異なる場合、再帰で調査する
↓↓↓↓↓↓↓↓↓↓以下コメントアウトで正常動作↓↓↓↓↓↓↓↓↓
/*
else
{
object srcValue = sourceInfo.GetValue(source, null);
if (srcValue != null)
{
// 変換元を調査する
if (srcValue.GetType().Namespace != "System")
{
AssignTo(srcValue, dest);
}
// 変換先を調査する
else
{
↓↓↓↓↓↓↓↓↓↓ここでException発生↓↓↓↓↓↓↓↓↓
PropertyInfo[] properties = destType.GetProperties();
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
foreach (PropertyInfo property in properties)
{
object destValue = property.GetValue(dest, null);
if (destValue != null && destValue.GetType().BaseType != typeof (ValueType) &&
destValue.GetType().Namespace != "System")
AssignTo(source, destValue);
}
}
}
}
*/
seasar-dotnet メーリングリストの案内