[seasar-dotnet:447] Re: Nullable型にIdentityを指定するとキャストエラー
kotani.k
kotani.k @ buildsystem.jp
2007年 2月 16日 (金) 14:23:43 JST
羽田様
小谷です。
> 現在、S2Dao.NETを利用させていただいています。
> S2Dao.NET利用時、Identityを.NET 2.0のNullable<long>やNullable<int>に
> マップしようとしたところ、下記のようなエラーが発生してしまいました。
ご指摘有難うございます!
問題の件についてですが、変換・型判定処理は統一した方が
いいように思えたので羽田様ご指摘の箇所を以下のように
修正してみたいと考えております。
検証はまだできていないので、終わり次第、ご連絡致します。
Seasar.Framework.Util.ConversionUtil.ConvertTargetType()
を使用して
=================================================================
protected void SetIdentifier(object bean, object value)
{
if(propertyName == null) throw new EmptyRuntimeException("propertyName");
PropertyInfo propertyInfo = bean.GetType().GetProperty(propertyName);
propertyInfo.SetValue(bean, ConversionUtil.ConvertTargetType(
value, propertyInfo.PropertyType), null);
}
=================================================================
=========================================
koyak
kotani.k @ buildsystem.jp
=========================================
seasar-dotnet メーリングリストの案内