2017-03-07 2 views
0

스프링 부트 응용 프로그램에서 응용 프로그램 테스트를 위해 내 sql 스키마로 시작 import.sql 파일을로드하려고합니다. 이상한 문제는 동일한 SQL 파일이 내 DB에 직접 추가 될 때 작동하기 때문입니다. import.sql의SQL 구문에서 하이버 네이트 import.sql erorr

샘플 :

INSERT INTO car 
(name, description, price) VALUES 
('Audi Q7', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse libero ex.', 150), 
('Audi A4', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse libero ex.', 79.99), 
... 

봄 부팅 시작 목록 : 오류의

Listing on GitHubGist

샘플 :

HHH000388: Unsuccessful: INSERT INTO car 
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 '' at line 1 
HHH000388: Unsuccessful: (name, description, price) VALUES 
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 'name, description, price) VALUES' at line 1 
... 
+1

일부 JPA 제공 업체는 "새 라인"구문 (예 : DataNucleus)을 지원하지만 일부는 지원하지 않습니다. 너는 그렇지 않아. –

답변

1

import.sql shouldn의 항목 때문에 여러 줄에 걸쳐 있습니다. Hibernate는 한 줄에 그것을 읽고, 한 줄로 읽은 각 줄을 하나의 문장으로 실행한다.