[seasar-dotnet:256] [S2Dao]要望:IdentityやTimestampのNullables対応

kubo jazzflute @ mbn.nifty.com
2006年 6月 26日 (月) 22:41:38 JST


久保です。

今、IdentityやTimestamp(排他制御)の列に
Nullables.Nullable...クラスを利用しています。

それがおかしい、と言われるかもしれませんが、
型の統一を重視してそのようになっています。

※NotNull制約の無い数値列や日付列をNULLで更新したいため、
  Nullables.Nullable...を利用しています。



現在は、AbstractAutoHandlerとAbstractIdentifierGeneratorを
暫定にベタっと対応しています。(切羽詰まってるので本当にベタです)

[AbstractAutoHandler] SetupUpdateBindVariables()辺り
    if (pt.PropertyType == typeof(DateTime))
    {
        varList.Add(this.Timestamp);
    }
    else if (pt.PropertyType == typeof(Nullables.NullableDateTime))
    {
        varList.Add(new Nullables.NullableDateTime(this.Timestamp));
    }

[AbstractIdentifierGenerator] SetIdentifier()辺り
    if (propertyInfo.PropertyType == typeof(Nullables.NullableDecimal))
    {
        propertyInfo.SetValue(bean, Nullables.NullableDecimal.Parse(value.ToString()), null);
    }
    else
    {
        propertyInfo.SetValue(bean, Convert.ChangeType(value, propertyInfo.PropertyType), null);
    }




IdentityやTimestampをNullables対応して頂けませんでしょうか?



-- 
kubo <jazzflute @ mbn.nifty.com>




seasar-dotnet メーリングリストの案内