Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

仿照Spring JdbcTemplate实现nutz的SqlTemplate,方便在nutz中执行sql #489

Merged
merged 1 commit into from
Jul 16, 2013

Conversation

hzl7652
Copy link
Contributor

@hzl7652 hzl7652 commented Jul 13, 2013

具体使用方法可以查看SqlTemplate的单元测试,写得不好,提提意见

@wendal
Copy link
Member

wendal commented Jul 13, 2013

貌似不错的样子, 大家怎么看?

@ywjno
Copy link
Member

ywjno commented Jul 13, 2013

自定义SQL那的话貌似能方便不少

@hzl7652
Copy link
Contributor Author

hzl7652 commented Jul 13, 2013

感觉还应有jdbc批处理更新,自定义SqlCallback操作等常用操作

@wendal
Copy link
Member

wendal commented Jul 13, 2013

不如放到nutzmore吧

@hzl7652
Copy link
Contributor Author

hzl7652 commented Jul 14, 2013

好的,放到nutzmore

@ywjno
Copy link
Member

ywjno commented Jul 14, 2013

感觉入主线无问题啊

@hzl7652
Copy link
Contributor Author

hzl7652 commented Jul 14, 2013

感觉入主线无问题啊,我也想入主线。看看兽哥什么意见了

@ywjno
Copy link
Member

ywjno commented Jul 14, 2013

等他们再评估评估的

@wendal
Copy link
Member

wendal commented Jul 15, 2013

代码是没问题的了, 就是想想有没有必要性扔主线去...

@hzl7652
Copy link
Contributor Author

hzl7652 commented Jul 15, 2013

我感觉还是有必要的,在我目前的开发的项目中,使用sql比较多。按目前自定义sql的写法,每个sql都要这样写:
Sql sql = Sqls.create("INSERT INTO $table ($name,$age,$weight) VALUES(@name,@Age,@weight)");
sql.params().set("name","Peter").set("age",18).set("weight",60);
dao.execute(sql);
sql.getResult();
执行一条sql要写最少三行以上的代码,使用template后,不用写那么多了

wendal added a commit that referenced this pull request Jul 16, 2013
仿照Spring JdbcTemplate实现nutz的SqlTemplate,方便在nutz中执行sql
@wendal wendal merged commit bb3fca3 into nutzam:master Jul 16, 2013
@hzl7652 hzl7652 deleted the upstream branch July 16, 2013 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants