求高手帮帮忙,谢谢啦!我在做一个SSH框架的多表查询倒是总是报错 unexpected token: join near line 1, c
代码如下:ListuserInfos;try{Stringsql="fromUserTabwhererootlike'%"+root+"%'andflaglike'%"+...
代码如下: List userInfos ;
try{
String sql = "from UserTab where root like '%"+root+"%' and flag like '%"+flag+"%' join TeatcherTab where root like '%"+root+"%' and flag like '%"+flag+"%'";
System.out.print("jurdfgvf");
sql+=" join TeatcherTab where TeatcherTab.root like '%"+root+"%' and TeatcherTab.flag like '%"+flag+"%'";
userInfos = this.getHibernateTemplate().find(sql);
}catch(DataAccessException t){
t.printStackTrace();
throw t;
}
return userInfos.size(); 展开
try{
String sql = "from UserTab where root like '%"+root+"%' and flag like '%"+flag+"%' join TeatcherTab where root like '%"+root+"%' and flag like '%"+flag+"%'";
System.out.print("jurdfgvf");
sql+=" join TeatcherTab where TeatcherTab.root like '%"+root+"%' and TeatcherTab.flag like '%"+flag+"%'";
userInfos = this.getHibernateTemplate().find(sql);
}catch(DataAccessException t){
t.printStackTrace();
throw t;
}
return userInfos.size(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询