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的類該如何解決?

相關文章
相關標籤/搜索