简体   繁体   中英

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. Here is the Entity (in 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 . 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.

Thats quite strange because test is in my values, not in my column definitions.

Does anyone know whats going on?

字符常量需要单引号

insert into calculation_type (guid, title, modified, creation) VALUES ('test", 'title', '2013-12-12', '2013-12-12');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM