欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

mysql-Hibernate 原生sql多表查询在Linux服务器上查询不到数据

程序员文章站 2022-05-24 14:29:22
...
mysqllinux服务器

String sql = "SELECT Area.* FROM area AS Area,district AS d WHERE Area.districtid=d.districtid AND Area.areaname= '"
+ areaname + "' AND d.districtname='" + cityname + "'";
@SuppressWarnings("unchecked")
List as = (List) getCurrentSession()
.createSQLQuery(sql).addEntity("Area",Area.class).list();