CnPack Forum


 
Subject: 报告CnDHibernate 缺点
bincom
新警察
Rank: 1



UID 41050
Digest Posts 0
Credits 12
Posts 4
点点分 12
Reading Access 10
Registered 2008-10-4
Status Offline
Post at 2008-10-5 20:36  Profile | Blog | P.M. 
报告CnDHibernate 缺点

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

            // set the Enum properties   ////本人修改加入, 不知会不会产生问题 
            if tk = tkEnumeration then
            begin
              SetEnumProp((obj as clazz), pplst^.Name,FieldByName(pplst^.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^.Name, FieldByName(pplst^.Name).AsString);
            end;
            // set the integer properties
            if tk = tkInteger then
            begin
              try
                SetInt64Prop((obj as clazz), pplst^.Name,FieldByName(pplst^.Name).AsInteger);
              except
                SetInt64Prop((obj as clazz), pplst^.Name, 0);
              end;
            end;
            // set the float properties
            if tk = tkFloat then
            begin
              try
                SetFloatProp((obj as clazz), pplst^.Name,
                  FieldByName(pplst^.Name).AsFloat);
              except
                SetFloatProp((obj as clazz), pplst^.Name, 0);
              end;
            end;
            // set the variant properties
            if tk = tkVariant then
            begin
              SetVariantProp((obj as clazz), pplst^.Name,
                FieldByName(pplst^.Name).Value);
            end;
Top
rarnu (橙子)
灌水部部长
Rank: 8Rank: 8


UID 2689
Digest Posts 11
Credits 648
Posts 209
点点分 648
Reading Access 10
Registered 2006-10-2
Status Offline
Post at 2008-10-5 21:00  Profile | Site | Blog | P.M. 
用sql2005试过?
sql2000本身就没有boolean的




Rarnu
CnPack Interfacer
rarnu@cnpack.org
Top
bincom
新警察
Rank: 1



UID 41050
Digest Posts 0
Credits 12
Posts 4
点点分 12
Reading Access 10
Registered 2008-10-4
Status Offline
Post at 2008-10-6 09:33  Profile | Blog | P.M. 
MS SQL里的BIT类型是->Boolean(Delphi )

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




All times are GMT++8, the time now is 2024-4-24 03:32

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.006740 second(s), 7 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP