CnPack Forum » 技术板块灌水区 » 报告CnDHibernate 缺点


2008-10-5 20:36 bincom
报告CnDHibernate 缺点

本人在测试过程中,发现 CnDHibernate 不支持 Boolean 类型数据, 我想Boolean类型在Delphi中应该人人都用到吧.相关代码部分:
          if tk <> tkMethod then
          begin

            // set the Enum properties   ////本人修改加入, 不知会不会产生问题 
            if tk = tkEnumeration then
            begin
              SetEnumProp((obj as clazz), pplst[i]^.Name,FieldByName(pplst[i]^.Name).AsString);
            end;                                 ////end
      

            // set the string properties
            if (tk = tkString) or (tk = tkLString) or (tk = tkWString) or (tk=tkUString) then
            begin
              SetStrProp((obj as clazz), pplst[i]^.Name, FieldByName(pplst[i]^.Name).AsString);
            end;
            // set the integer properties
            if tk = tkInteger then
            begin
              try
                SetInt64Prop((obj as clazz), pplst[i]^.Name,FieldByName(pplst[i]^.Name).AsInteger);
              except
                SetInt64Prop((obj as clazz), pplst[i]^.Name, 0);
              end;
            end;
            // set the float properties
            if tk = tkFloat then
            begin
              try
                SetFloatProp((obj as clazz), pplst[i]^.Name,
                  FieldByName(pplst[i]^.Name).AsFloat);
              except
                SetFloatProp((obj as clazz), pplst[i]^.Name, 0);
              end;
            end;
            // set the variant properties
            if tk = tkVariant then
            begin
              SetVariantProp((obj as clazz), pplst[i]^.Name,
                FieldByName(pplst[i]^.Name).Value);
            end;

2008-10-5 21:00 rarnu
用sql2005试过?
sql2000本身就没有boolean的

2008-10-6 09:33 bincom
MS SQL里的BIT类型是->Boolean(Delphi )

我用SQL2000里的BIT类型, 可以对应Delphi 的Boolean类型值。加入 tkEnum...处理就可以了。

页: [1]
查看完整版本: 报告CnDHibernate 缺点


Powered by Discuz! Archiver 5.0.0  © 2001-2006 Comsenz Inc.