Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
NHibernate hql 查询返回复合数据到实体 – 扎老铁
Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215

Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
Warning: mysqli_num_fields() expects parameter 1 to be mysqli_result, boolean given in /www/wwwroot/dev.zhalaotie.com/wp-includes/wp-db.php on line 3215
class="post-52862 post type-post status-publish format-standard hentry">

NHibernate hql 查询返回复合数据到实体

 

public class ProjectSummary
{
        public string Id { get; set; }
        public string Name { get; set; }
        public int DeviceCount { get; set; }
        public int SceneCount { get; set; }
        public int GroupCount { get; set; }
        public ProjectSummary(string id, string name, int deviceCount, int sceneCount, int groupCount)
        {
            this.Id = id;
            this.Name = name;
            this.DeviceCount = deviceCount;
            this.SceneCount = sceneCount;
            this.GroupCount = groupCount;
        }
    }

    public class SceneRepository : NHibernateRepositoryBase<Scene, SceneRepository>
    {
        public void Query()
        {

            IList<ProjectSummary> list = CreateQuery("selec new Bitlab.IOT.ProjectSummary(p.Id,p.Name,p.Devices.Count,p.Group.Count,p.Scenes.Count)  from DeviceProject p")

                   .List<ProjectSummary>();

            ;
        }
}

 

发表评论

电子邮件地址不会被公开。