问题描述
- Hibernate 原生sql多表查询在Linux服务器上查询不到数据
-
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();
解决方案
时间: 2024-11-08 22:19:39