您的位置:首页 > 数据库

jeecg 里面的三种查询,第一种直接针对数据库查询,自定义查询语法

2016-09-13 19:11 393 查看
jeecg 里面的三种查询,第一种直接针对数据库查询,自定义查询语法

第一种查询:
TSTypegroup tsTypegroup = systemService.findUniqueByProperty(TSTypegroup.class, "typegroupcode","enterprise_property");
String string = tsTypegroup.getId();
String hql = "from TSType t where TSTypegroup = '"+string+"'";
List<TSType> tsTypes = systemService.findByQueryString(hql);

第二种查询:
TSTypegroup tsTypegroup = systemService.findUniqueByProperty(TSTypegroup.class, "typegroupcode","enterprise_property");
String string = tsTypegroup.getId();
CriteriaQuery cq = new CriteriaQuery();
cq.eq("TsTypegroup", string);
cq.add();
List<TSType> tsType1=systemService.getListByCriteriaQuery(cq, false);

第三种查询:
TSTypegroup tsTypegroup = systemService.findUniqueByProperty(TSTypegroup.class, "typegroupcode","enterprise_property");
String string = tsTypegroup.getId();
List<TSType> tsType = systemService.findByProperty(TSType.class, "TsTypegroup", string);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  数据查询