来源:http://www.cnblogs.com/Terrylee/archive/2006/04/12/372823.html 一.HQL简单介绍HQL全名是Hibernate Query Language,它是一种完全面向对象的查询语言. 1.from 子句 from UserInfo from UserInfo as userinfo from UserInfo userinfo UserInfo:是类名称,而不是[ActiveRecord(Table = "UserInfo"…
这篇随笔将会记录hql的常用的查询语句,为日后查看提供便利. 在这里通过定义了三个类,Special.Classroom.Student来做测试,Special与Classroom是一对多,Classroom与Student是一对多的关系,这里仅仅贴出这三个bean的属性代码: Special类: public class Special { private int id; private String name; private String type; private Set<Classro…
Model中的Demo: using Castle.ActiveRecord; using Castle.ActiveRecord.Queries; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Models { //指定数据表,Lazy为延迟加载,一旦指定为延迟加载,其属性应该加上virtu…