今天應用MyBatis進行資料庫一對多,一對一查詢的時候,出現了一個錯誤:
The content of element type "collection" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
源代碼為:
出錯原因,當出現一對一,一對多的時候,并且這兩個是并列的時候,需要先寫一對一:association,再寫一對多:collection
修改後的代碼:
今天應用MyBatis進行資料庫一對多,一對一查詢的時候,出現了一個錯誤:
The content of element type "collection" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
源代碼為:
出錯原因,當出現一對一,一對多的時候,并且這兩個是并列的時候,需要先寫一對一:association,再寫一對多:collection
修改後的代碼: