【发布时间】:2017-12-11 15:05:19
【问题描述】:
我想使用import.sql 将默认条目导入我的数据库,它在ddl-auto: create-drop 上执行。
INSERT INTO CAR (vehicleId, manufacturer, model, bodyDesign, capacity, capacityUnit, constructionDate, cylinders, doors, fuelType, gears, gearBox, isElectric, ps, seats, propulsion) VALUES ("WBA5J71050GZ75477", "BMW", "M3", "Coupé", 3246, "m³", PARSEDATETIME('17-03-2015', 'dd-MM-yyyy'), 6, 2, "petrol", 6, "semi-automatic", false, 343, 5, "rear");
但是,我要插入的列名会自动转换为大写:
2017-12-11 15:57:04.668 ERROR 24141 --- [ main] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000388: Unsuccessful: INSERT INTO CAR (vehicleId, manufacturer, model, bodyDesign, capacity, capacityUnit, constructionDate, cylinders, doors, fuelType, gears, gearBox, isElectric, ps, seats, propulsion) VALUES ("WBA5J71050GZ75477", "BMW", "M3", "Coupé", 3246, "m³", PARSEDATETIME('17-03-2015', 'dd-MM-yyyy'), 6, 2, "petrol", 6, "semi-automatic", false, 343, 5, "rear")
2017-12-11 15:57:04.668 ERROR 24141 --- [ main] org.hibernate.tool.hbm2ddl.SchemaExport : Column "VEHICLEID" not found; SQL statement:
有什么方法可以在不重命名所有列的情况下绕过这个问题?
【问题讨论】:
标签: sql spring hibernate spring-boot