[英]Spring Boot Autoimport import.sql file - Getting a "Column Not found" Error
So I have a table in postgresql and I want to fill it with some values on application start.所以我在 postgresql 中有一个表,我想在应用程序启动时用一些值填充它。 Here is the Entity (in Kotlin):
这是实体(在 Kotlin 中):
@Entity
class CalculationType(
@Id @GeneratedValue(strategy = GenerationType.AUTO)
var id: Long = 0,
var guid: String = "",
var title: String = "",
var modified: Date,
var creation: Date
)
my import.sql
file is located under ..\\.\\resources
.我的
import.sql
文件位于..\\.\\resources
。 it looks like this:它看起来像这样:
insert into calculation_type (guid, title, modified, creation) VALUES ("test", "title", "2013-12-12", "2013-12-12");
I am getting an error in German, traslated it says Column »test« does not exist.
我在德语中遇到错误,翻译它说
Column »test« does not exist.
Thats quite strange because test
is in my values, not in my column definitions.这很奇怪,因为
test
在我的值中,而不是在我的列定义中。
Does anyone know whats going on?有谁知道这是怎么回事?
字符常量需要单引号
insert into calculation_type (guid, title, modified, creation) VALUES ('test", 'title', '2013-12-12', '2013-12-12');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.