首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

hibernate 中 Restrictions 与 Expression 的差别

2012-09-06 
hibernate 中 Restrictions 与 Expression 的区别Criteria.add() 接受的参数是Criterion接口的实现,Simple

hibernate 中 Restrictions 与 Expression 的区别
Criteria.add() 接受的参数是Criterion接口的实现,SimpleExpression、PropertyExpression、LogicalExpression等都是Criterion的实现,其实例都可以作为add的参数。
Restrictions是一个工具类,用于生成各种Criterion(包括SimpleExpression、PropertyExpression等实现)。

而对于Restrictions 与 Expression,它们用法很相似,其中Restrictions是hibernate3代替hibernate2中的Expression,但在hibernate3中Expression还是可以使用的。

热点排行