Guushuuse .NET
专注于ASP.NET 2.0、ASP.NET AJAX、Spring.NET、NHiberbate技术
博客园
首页
新随笔
联系
订阅
管理
41 Posts :: 0 Stories :: 92 Comments :: 18 Trackbacks
与我联系
发短消息
搜索
常用链接
我的随笔
我的空间
我的短信
我的评论
更多链接
我的参与
我的新闻
最新评论
我的标签
留言簿
(2)
给我留言
查看留言
我的标签
Spring.NET
(27)
ASP.NET AJAX
(26)
ASP.NET
(26)
NHibernate
(26)
随笔分类
ASP.NET&Spring.NET&NHibernate企业应用实践
ASP.NET&Spring.NET&NHibernate最佳实践(26)
NHibernate程序设计
Spring.NET程序设计
技巧集录(1)
技术手册(14)
随笔档案
2008年5月 (41)
.NET开源项目
AJAX Control Toolkit
log4net
NHibernate
Spring.NET
友情链接
xugang
积分与排名
积分 - 26854
排名 - 1510
最新评论
1. re: ASP.NET&Spring.NET&NHibernate最佳实践(二十六)——第4章权限子系统(19)权限子系统小结
高人!! 真是叹为观止啊~~
向你学习!!!
--HZW
2. re: Spring.NET
好东西,我的好兄弟,开发真的很方便,net要加油了,都在用很原始很土的方式编程,赶不上java了
--Hibernate Gavin King
3. re: ASP.NET&Spring.NET&NHibernate最佳实践(七)——第3章人事子系统(4)人事子系统小结
在ServiceLocator里面的ProductsService取不到,程序调试在这个地方卡住,是什么原因?请麻烦告知,非常感谢
我的QQ号:120321110
--YangCao
阅读排行榜
1. ASP.NET&Spring.NET&NHibernate最佳实践(八)——第4章权限子系统(1) (3212)
2. ASP.NET&Spring.NET&NHibernate最佳实践(二十六)——第4章权限子系统(19)权限子系统小结 (2797)
3. Agile Software Development(敏捷软件开发)(2070)
4. ASP.NET&Spring.NET&NHibernate最佳实践(四)——第3章人事子系统(1)(2058)
5. Spring.NET(1770)
评论排行榜
1. Agile Software Development(敏捷软件开发)(17)
2. ASP.NET&Spring.NET&NHibernate最佳实践(三)——第2章环境准备(11)
3. 如何把彩色网页快速变为灰色网页(10)
4. ASP.NET&Spring.NET&NHibernate最佳实践(二十六)——第4章权限子系统(19)权限子系统小结 (10)
5. ASP.NET&Spring.NET&NHibernate最佳实践(四)——第3章人事子系统(1)(8)
ASP.NET&Spring.NET&NHibernate最佳实践(十一)——第4章权限子系统(4)
4.3. 权限子系统数据访问层(Dao)
应用程序数据访问接口(IApplicationDao.cs)
using
System;
using
Guushuuse.SalaryPrj.Security.DomainModel;
using
System.Collections;
namespace
Guushuuse.SalaryPrj.Security.Dao
{
/**/
///
<summary>
///
应用程序数据访问接口
///
</summary>
public
interface
IApplicationDao
{
void
CreateApplication(Application application);
void
DeleteApplication(Application application);
IList GetAllApplications();
Application GetApplication(
int
applicationID);
Application GetApplication(
string
applicationName);
void
UpdateApplication(Application application);
}
}
应用程序数据访问类(ApplicationDao.cs)
using
System;
using
System.Collections.Generic;
using
System.Text;
using
Spring.Data.NHibernate.Support;
using
Guushuuse.SalaryPrj.Security.DomainModel;
using
System.Collections;
using
Spring.Transaction.Interceptor;
using
Spring.Dao.Support;
namespace
Guushuuse.SalaryPrj.Security.Dao
{
/**/
///
<summary>
///
应用程序数据访问类
///
</summary>
public
class
ApplicationDao : HibernateDaoSupport, IApplicationDao
{
public
ApplicationDao()
{
}
[Transaction(ReadOnly
=
false
)]
public
void
CreateApplication(Application application)
{
HibernateTemplate.Save(application);
}
[Transaction(ReadOnly
=
false
)]
public
void
UpdateApplication(Application application)
{
HibernateTemplate.Update(application);
}
[Transaction(ReadOnly
=
false
)]
public
void
DeleteApplication(Application application)
{
HibernateTemplate.Delete(application);
}
public
IList GetAllApplications()
{
return
HibernateTemplate.LoadAll(
typeof
(Application));
}
public
Application GetApplication(
int
applicationID)
{
return
(Application)HibernateTemplate.Get(
typeof
(Application), applicationID);
}
public
Application GetApplication(
string
applicationName)
{
string
hql
=
"
from Application application where application.Name = ?
"
;
IList applications
=
HibernateTemplate.Find(hql,
new
object
[]
{ applicationName }
);
if
(applications.Count
>
0
)
{
return
(Application)DataAccessUtils.RequiredUniqueResultSet(applications);
}
else
{
return
null
;
}
}
}
}
Tag标签:
Spring.NET
,
ASP.NET AJAX
,
ASP.NET
,
NHibernate
posted on 2008-05-17 14:37
guushuuse
阅读(212)
评论(1)
编辑
收藏
所属分类:
ASP.NET&Spring.NET&NHibernate最佳实践
社区
新闻
新用户注册
刷新评论列表
标题
姓名
主页
Email
(只有博主才能看到)
验证码
*
看不清,换一张
[
登录
][
注册
]
内容(请不要发表任何与政治相关的内容)
Remember Me?
登录
使用高级评论
新用户注册
返回页首
恢复上次提交
[使用Ctrl+Enter键可以直接提交]
相关文章:
ASP.NET AJAX入门系列
ASP.NET AJAX入门系列(2):使用ScriptManager控件
ASP.NET AJAX入门系列(1):概述
.NET设计模式系列文章
ASP.NET AJAX(开发代号:Atlas)的相关问题请在本帖中提出
ASP.NET AJAX(开发代号Atlas)重要参考资源大收集
相关链接:
所属分类的其他文章:
ASP.NET&Spring.NET&NHibernate最佳实践(二十六)——第4章权限子系统(19)权限子系统小结
ASP.NET&Spring.NET&NHibernate最佳实践(八)——第4章权限子系统(1)
ASP.NET&Spring.NET&NHibernate最佳实践(二十五)——第4章权限子系统(18)
ASP.NET&Spring.NET&NHibernate最佳实践(二十四)——第4章权限子系统(17)
ASP.NET&Spring.NET&NHibernate最佳实践(二十三)——第4章权限子系统(16)
ASP.NET&Spring.NET&NHibernate最佳实践(二十二)——第4章权限子系统(15)
ASP.NET&Spring.NET&NHibernate最佳实践(二十一)——第4章权限子系统(14)
ASP.NET&Spring.NET&NHibernate最佳实践(二十)——第4章权限子系统(13)
ASP.NET&Spring.NET&NHibernate最佳实践(十九)——第4章权限子系统(12)
ASP.NET&Spring.NET&NHibernate最佳实践(十八)——第4章权限子系统(11)
最新IT新闻:
Google推出Android Market挑战App Store
美国年轻人最喜欢的15大网站
2008年8月30日IT博客精选
《极品飞车12》最新真人照片、游戏截图
IBM正在开发超强性能4TB固态硬盘阵列
博客园新闻频道
博客园首页
社区
Powered by:
博客园
Copyright © guushuuse