-
Type: Bug
-
Resolution: Fixed
-
Priority: Major
-
Affects Version/s: None
-
Component/s: S2Dao.NET
[seasar-dotnet:2205]より
■現象
InsertでVERSIONNOに初期値の0が設定されない
■原因
VersionNoプロパティかどうか名前をチェックするとき大文字と小文字を区別して比較しているため、
エンティティのプロパティ名が「VERSIONNO」だと、通常のバインド変数として処理される。
■ソース
Seasar.Dao.Impl.AbstractAutoHandler
protected void SetupInsertBindVariables(object bean)
181 else if (pt.PropertyName.Equals(BeanMetaData.VersionNoPropertyName))
■補足
ちなみにTimestampプロパティやUpdateのときは、大文字と小文字を無視して比較していました。
例としてSetupUpdateBindVariablesでは以下の通り
208 else if (string.Compare(pt.PropertyName, BeanMetaData.VersionNoPropertyName, true) == 0)
■修正方法
181行目を208行目と同様に変更する