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
积分与排名
积分 - 28068
排名 - 1530
最新评论
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) (3275)
2. ASP.NET&Spring.NET&NHibernate最佳实践(二十六)——第4章权限子系统(19)权限子系统小结 (2850)
3. ASP.NET&Spring.NET&NHibernate最佳实践(四)——第3章人事子系统(1)(2137)
4. Agile Software Development(敏捷软件开发)(2086)
5. Spring.NET(1843)
评论排行榜
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章权限子系统(5)
角色数据访问接口(IRoleDao.cs)
using
System;
using
Guushuuse.SalaryPrj.Security.DomainModel;
using
System.Collections;
namespace
Guushuuse.SalaryPrj.Security.Dao
{
/**/
///
<summary>
///
角色数据访问接口
///
</summary>
public
interface
IRoleDao
{
void
CreateRole(Role role);
void
DeleteRole(Role role);
IList GetAllRoles();
Role GetRole(
int
roleID);
Role GetRole(Application application,
string
roleName);
IList GetRoles(Application application);
void
UpdateRole(Role role);
}
}
角色数据访问类(RoleDao.cs)
using
System;
using
System.Collections.Generic;
using
System.Text;
using
Spring.Data.NHibernate.Support;
using
Spring.Transaction.Interceptor;
using
Guushuuse.SalaryPrj.Security.DomainModel;
using
System.Collections;
using
Spring.Dao.Support;
namespace
Guushuuse.SalaryPrj.Security.Dao
{
/**/
///
<summary>
///
角色数据访问类
///
</summary>
public
class
RoleDao : HibernateDaoSupport, IRoleDao
{
public
RoleDao()
{
}
[Transaction(ReadOnly
=
false
)]
public
void
CreateRole(Role role)
{
HibernateTemplate.Save(role);
}
[Transaction(ReadOnly
=
false
)]
public
void
UpdateRole(Role role)
{
HibernateTemplate.Update(role);
}
[Transaction(ReadOnly
=
false
)]
public
void
DeleteRole(Role role)
{
HibernateTemplate.Delete(role);
}
public
IList GetAllRoles()
{
return
HibernateTemplate.LoadAll(
typeof
(Role));
}
public
IList GetRoles(Application application)
{
string
hql
=
"
from Role r where r.Application = ?
"
;
return
HibernateTemplate.Find(hql,
new
object
[]
{ application }
);
}
public
Role GetRole(
int
roleID)
{
return
(Role)HibernateTemplate.Get(
typeof
(Role), roleID);
}
public
Role GetRole(Application application,
string
roleName)
{
string
hql
=
"
from Role role where role.Application = ? and role.Name = ?
"
;
IList roles
=
HibernateTemplate.Find(hql,
new
object
[]
{ application, roleName }
);
if
(roles.Count
>
0
)
{
return
(Role)DataAccessUtils.RequiredUniqueResultSet(roles);
}
else
{
return
null
;
}
}
}
}
Tag标签:
Spring.NET
,
ASP.NET AJAX
,
ASP.NET
,
NHibernate
posted on 2008-05-17 15:59
guushuuse
阅读(181)
评论(1)
编辑
收藏
所属分类:
ASP.NET&Spring.NET&NHibernate最佳实践
新用户注册
刷新评论列表
标题
姓名
主页
Email
(博主才能看到)
验证码
*
看不清,换一张
[
登录
][
注册
]
内容(请不要发表任何与政治相关的内容)
网站首页
新闻频道
社区
小组
博问
网摘
闪存
找找看
Remember Me?
登录
使用高级评论
新用户注册
返回页首
恢复上次提交
[使用Ctrl+Enter键可以直接提交]
该文被作者在 2008-05-17 16:01 编辑过
相关文章:
ASP.NET实用技巧(一)
ASP.NET跨页面传值技巧总结
ASP.NET AJAX入门系列
ASP.NET AJAX入门系列(2):使用ScriptManager控件
Virtual Earth ASP.NET 控件将于 7 月发布
Visual Studio 2008 和 .NET Framework 3.5 Training Kit
ASP.NET下如何浏览客户端文件夹
学校有关于ASP.NET和JSP的课程 有必要都学习吗?
建议博问中增加ASP.NET MVC分类
深入剖析ASP.NET组件设计
相关链接:
所属分类的其他文章:
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开拓美政府机构市场 微软业务受冲击
消息称苹果正在开发iTunes网络电视
微软周一开电话会议 预计将发布Silverlight2.0
开心网即将启用”shejiao.com”?
Google股价跌破329美元 61%员工期权价值归零
Powered by:
博客园
Copyright © guushuuse