Java註解開發,表不存在錯誤,解決

2021-08-04 09:58:51 字數 362 閱讀 1731

進行註解開發的時候,我們會在實體類上加上@table註解來對應mysql資料庫表,我們習慣寫成駝峰格式usergroup。

本地測試的時候是沒有問題的。

但是部署到linux上就會出現如下錯誤。

error querying database.  cause: com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: table 'test.usergroup' doesn't exist

原因是linux上的mysql是區分大小寫的,所以註解的name要跟mysql表名字完全一致,如果mysql全部為小寫,修改如下即可解決

@table(name="usergroup")

springmvc註解開發

1.配置dispatcherservlet 2.在springmvc中配置三大元件 3.在spring容器中配置action 使用 controller 與此同型別的還有 service responsitory component 使用spring容器的元件掃瞄,自動掃瞄到action在sprin...

Spring註解開發

spring註解開發 dao層用的註解 repository service層的註解 service controller表現層的註解 controller 以上的三個註解都是用 componment新增三個衍生的註解 屬性依賴注入 value的屬性注入 value wwtmy love 注入的是屬...

spring註解開發

第一步,設定xml約束檔案 第一步,設定xml約束檔案 xmlns xsi xmlns context xsi schemalocation spring beans.xsd spring context.xsd 第二步,定義bean 除了 component外,spring提供了3個功能基本和 c...