我正在使用Ralph Schindler的ZF + Doctrine 2.1實現(https://github.com/ralphschindler/NOLASnowball/tree/doctrine2-managed-crud)。如何使用Bisna爲ZF1製作Doctrine 2.1報價標識符?
我的MySQL數據庫使用了一些保留字,名爲order的列。我需要告訴Doctrine引用標識符,但我似乎無法讓它在應用程序本身中工作,也無法在scripts/doctrine.php(https://github.com/ralphschindler/NOLASnowball/blob/doctrine2-managed-crud/scripts/doctrine.php)中使用命令行工具。
注:我的反向使用命令工程我的數據庫:
php scripts/doctrine.php orm:convert-mapping --from-database annotation library/app/Entity/
這給錯誤:
Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order' at line 1
因爲列的順序不會與蜱報價。
道歉,如果你已經檢查了教義手冊,但如果沒有,第5.9節說,所有你需要做的就是添加字符'在註釋中的列名稱的兩側。所以你的將是@Column(name =「'order'」,type =「integer」) – cantera
謝謝cantera25,我已經讀過,但我試圖對數據庫進行逆向工程。所以Doctrine會通過運行上面的腳本爲我創建實體。因此,原則自我需要在檢查時添加滴答。 – stephangroen
啊,我明白了。我錯誤地將'訂單'列作爲'列順序'。將進一步研究。 – cantera