![]() | CYQ.Data componentsCYQ.Data support multi-database application [Txt,Xml,Access, MSSQL, Oracle,SQLite,MySql], help easily and quickly to develop your project |
CYQ.Data 数据框架 版本发布 V4.5
Platform for dynamic |
|
|
| #TopicOwner |
前言: 继上一版本:CYQ.Data 数据框架 版本发布 V4.3,至今已快近3个月了,仅有V4.5beta版本供下载,却没正式发布,今天,终于要把V4.5给发布了。
下面看一下新版本的修改记录 实用:
1:MAction:Select方法增加重载:Select(string where); 2:FormatWhere处理了"Parent is null"的"is"关键字;处理"order by"语句补充为"1=1 order by ..." 3:MAction增加Exists方法 4:MDataRow 增加ToEntity<T>()方法转实体 5:允许更新Null值到数据库中 事务: 6:修正事务二次回滚的错误,即连续调用两次action.RollBack(); 7:修正二次启动事务。 缓存: 8:缓存增加Set方法,无则添加,有则更新 9:大力修改Cache机制,使信息更容易查看.[定时清缓存] 其它: 10:MDataRow 重写Clear()方法,该方法将清除行的数据[即数据重置为Null] 11:AOP的End方法修改返回值为MDataRow和MDataTable结果集 12:修正OrmBase转实体时值为DBNull.Value的转换异常 下面进行详细的解说 一:实用性功能介绍 1:MAction:Select方法增加重载:Select(string where) 在V4.3及之前版本,仅存在以下两个原型方法: public MDataTable Select() public MDataTable Select(int pageIndex, int pageSize, string where, out int rowCount) 有很多人使用习惯:Select("where语句");然后发现where语句不起作用,全部数据都查出来了,然后纠结的问起这个问题。 原因: 不存在该重载方法。为何不报错?有点迷惑。 因为默认有Aop功能,该参数会变成Aop参数传给Aop功能使用,多数人不了解Aop,所以第一次使用上容易引发此问题。 本次增加了重载的方法,一来适应大众使用习惯,二来也消除掉一些迷惑。 2:FormatWhere处理了"Parent is null"的"is"关键字;处理"order by"语句补充为"1=1 order by ..." 问题1:action.Select(1,10,"parent is null",out count); 原因:会被解析成id="parent is null",因此条件将失败。 解决方法:action.Select(1,10,"1=1 and parent is null",out count); 可以的原因:因为有"="号或其它符号时,则不会被解析成ID=xxx的形式。 本次增加IS解析,解决了这个问题。 问题2:action.Select(1,10,"order by id desc",out count); 原因:内部组装为:“...where"+"order by id desc",SQL语句语法错误 解决方法:action.Select(1,10,"1=1 order by id desc",out count); 可以的原因:组成:"...where+“1=1 order by id desc",这样组装就正常能过了。 本次自动补充1=1前缀。以后可以放心的直写order by语句了。 3:MAction增加Exists方法 早期的判断:if(action.GetCount(where语句)>0){}来判断。 此次增加后判断:if(action.Exists(where语句)){},表达上看更前进了一些。 4:MDataRow 增加ToEntity<T>()方法转实体 在很多网友的使用中,还是有很多使用实体类的用户。 CYQ.Data中可以通过:action.Select().ToList<T>(),将表转成实体类。 不过对于单行实体类,一直没此功能,此处增加功能后,即可: if(action.Fill(id)){UserInfo info=action.Data.ToEntity<UserInfo>();} 可以填充后转实体类操作。 5:允许更新Null值到数据库中 本次增加的功能,允许你设置: action.Set(字段,null)或者action.Set(字段,DBNull.Value); 然后通过action.Update();将Null值更新回数据库。 二:事务 6:修正事务二次回滚的错误[连续调用两次action.RollBack()] 在之前版本中,连续调用两次action.RollBack()来回滚两次事务是会抛异常的, 虽然一般你不会这么做,但还是处理了一下。 7:修正二次启动事务 一个MAction中,如果你结束掉事务之后,是无法启动第二个事务的。 本次修正后可以在一个MAction中多次启用关闭事务。 三:缓存 8:9:本次版本升级到最新版本缓存机制。 相关的缓存使用说明见:CYQ.Data 数据框架 缓存使用帮助 四:其它 10:MDataRow 重写Clear()方法:该方法将清除行的数据[即数据重置为Null] 11:AOP的End方法修改返回值为MDataRow和MDataTable结果集 12:修正OrmBase转实体时值为DBNull.Value的转换异常 最后: CYQ.Data 数据框架主页:http://www.cyqdata.cn/cyqdata CYQ.Data 数据框架下载:http://www.cyqdata.cn/download/article-detail-426 ![]() |
Post Comment
Bulletin
Article Search
Categories
- Platform for dynamic (20)
- Feedback (9)
- Guide (33)
- Principles (19)
- Project-Case (8)
- Business & Buy (2)
- Technology exchange (45)
New Article
- CYQ.Data Components Getting Started Guide [Part 5]-[MProc Execute Stored Procedures or SQL]
- CYQ.Data Components Getting Started Guide [Part 4]-[MAction Insert Delete Update]
- CYQ.Data Components Getting Started Guide [Part 3]-[MAction Get And Set Value]
- CYQ.Data Components Getting Started Guide [Part 2]-[MAction Data Query- Fill And Select]
- CYQ.Data Components Getting Started Guide [Part 1]
New Comment
- When some one searches for his necessary thing, therefore he/she wishes to be available that in detail, so that thing is maintained over here.
- This is my first time pay a quick visit at here and i am in fact happy to read everthing at alone place.
- I truly appreciate this blog article.Really thank you! Cool.
- please pay a visit to the web sites we follow, like this one particular, as it represents our picks in the web
- Really enjoyed this post.Really thank you!
- Really enjoyed this article.Really looking forward to read more. Great.
- poker bonuses What are the norms of copyright of web content? How as it different from Patent?
- Wow! Thank you! I permanently needed to write on my blog something like that. Can I implement a fragment of your post to my site?
- This website was how do I say it? Relevant!! Finally I ave found something that helped me. Cheers!
- I was reading through some of your content on this internet site and I believe this web site is very informative ! Continue posting.