我正在使用 Oracle9i 和 NHibernate 3.1.0.4 和 FluentNhibernate 1.2.0.712
NHibernate 配置如下...
<property name="dialect">NHibernate.Dialect.Oracle9iDialect</property>
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
<property name="connection.connection_string">Data Source=ORA9TEST;User ID=NOPE;Password=NOPE;</property>
<property name="query.substitutions">true=1;false=0</property>
<property name="show_sql">true</property>
它生成这个插入状态
2012-08-10 16:33:36,380 [DEBUG] 15 NHibernate.SQL -
INSERT INTO FACT_Data (STime, subg_number, subg_index, measurement, Rj, InvalidSpec, data_uid, WrittenState, dept_id, specs_id, data_id) VALUES (:p0, :p1, :p2, :p3, :p4, :p5, :p6, :p7, :p8, :p9, :p10);:p0 = 2/7/2012 12:49:57 AM [Type: DateTime (0)], :p1 = 103 [Type: Int32 (0)], :p2 = 0 [Type: Int32 (0)], :p3 = 30.346 [Type: Single (0)], :p4 = 0 [Type: Single (0)], :p5 = False [Type: Boolean (0)], :p6 = 0 [Type: Int32 (0)], :p7 = 0 [Type: Int32 (0)], :p8 = 2 [Type: Int32 (0)], :p9 = 45423 [Type: Int32 (0)], :p10 = 1178436 [Type: Int32 (0)]
FACT_Data.Measurement 列的类型为 NUMBER(*,6)
当我读回该行时,测量值不是 30.346,而是 30.346001。如果没有额外的 0.000001,我该怎么做才能正确存储我的 Single 值?
谢谢,麻烦您了