ssh中多表查询及Path expected for join的异常处理

1.ssh介绍框架

   在ssh中咱们一般会将其分为pojo,dao,daoimpl,service,serviceimpl和action层,固然还包括xml配置文件及pd.properties文件。在近期作的项目中经过ssh框架搭建了后台框架以及功能的实现,发现ssh中主要须要注意对xml映射方面进行多加注意。ssh

2.查询内容3d

本次用到的查询是多表查询,如shift和station的实体类存在多表查询的内容xml

2.1 多表的内容blog

在查询内容是主要涉及station和shift表中存在多对一的关系,同时须要station和shift表中的部份内容,即经过station中stationName来查询各类内容io

2.2 多表查询的方法后台

查询的方法为from Shift s left join Station departStation where s.departStation .stationId=s.id and departStation .stationId=2配置

2.3多表查询遇到的问题及解决办法service

在中途会遇到Path expected for join的异常,一般会将其改成from Shift where departStation is null or departStation.stationName like '%"+stationName+"%',另外'%"+stationName+"%'在其中不可写成'%stationName%',不然会报错方法

2.4 一些问题

 若是是两个Station的类该如何解决?

相关文章
相关标签/搜索