ํฐ์คํ ๋ฆฌ ๋ทฐ
๋ฐ์ํ
error
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "create table [*]order (id bigint generated by default as identity, completed boolean not null, title varchar(255) not null, todo_order bigint not null, primary key (id))"; expected "identifier"; SQL statement: create table order (id bigint generated by default as identity, completed boolean not null, title varchar(255) not null, todo_order bigint not null, primary key (id)) [42001-214]
h2 DB ๋ฅผ ์ด์ฉํด์ ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ง๋ค๋์ค ํด๋น ์๋ฌ๊ฐ ๋ฐ์ํ์๋ค.
ํ ์ด๋ธ๋ช ์ ์ง์ ํ์ง์์ผ๋ฉด ์ ์์ ์ผ๋ก ๋์ํ์ง๋ง ํ ์ด๋ธ๋ช ์ ์ง์ ํ๊ฒ ๋๋ฉด ๋ฌธ์ ๊ฐ ๋ฐ์ํ์๋ค.
Solve
@Entity(name = "order")
@Getter
@Setter
public class Todo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String title;
@Column(nullable = false)
private Long todoOrder;
@Column(nullable = false)
private Boolean completed;
}
Entity์ ์ด๋ฆ์ order๋ก ์ค๊ฒ์ด ๋ฌธ์ ์๋ค. "order"๋ผ๋ ๋จ์ด๋ H2 ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ์์ฝ์ด๋ก ์ฌ์ฉ๋๊ธฐ ๋๋ฌธ์ ํ ์ด๋ธ ์ด๋ฆ์ผ๋ก ์ฌ์ฉํ ์ ์๋ค. ๋ฐ๋ผ์ "order" ํ ์ด๋ธ์ ์์ฑํ๋ ์ฟผ๋ฆฌ๋ฅผ ์คํํ ๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ฒ์ด๋ค. ํด๊ฒฐ๋ฐฉ๋ฒ์
@Entity(name = "`order`")
์์ ๊ฐ์ด ๋ฐฑํฑ(`)์ผ๋ก ๊ฐ์ธ์ฃผ๋ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ๋ฉด ์ ์์ ์ผ๋ก ORDERํ ์ด๋ธ์ด ์์ฑ๋๊ณ ๋ก๊ทธ์์ ์๋ฌ๋ ์์ด์ง๋ค.
๋ฐ์ํ
๋ฐ์ํ
๊ณต์ง์ฌํญ
์ต๊ทผ์ ์ฌ๋ผ์จ ๊ธ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
- Total
- Today
- Yesterday
๋งํฌ
TAG
- mapper
- modifiedAt
- oracle
- ๋ฐ์ดํฐ๋ฒ ์ด์ค
- ํ๊ณ
- Til
- Spring
- yml ๋ถ๋ฆฌ
- JSP
- Stream
- xml
- PostgreSQL
- VMware
- docker
- sqld
- preproject
- codestates
- ๋ฐฑ์ค
- ์ํฐ๋ ์ฑ๋ฆฐ์ง
- ๋ค์ด๋๋ฏนํ๋ก๊ทธ๋๋ฐ
- mysql ์ค์
- pyinstaller ์ค์น
- error
- doit์๊ณ ๋ฆฌ์ฆ์ ๋ฌธ
- Java
- ์ฐ๋ถํฌ
- ์ ๋ณด์ฒ๋ฆฌ๊ธฐ์ฌ ์ค๊ธฐ
- ๋ ์
- ์ฝ๋์คํ ์ด์ธ
- ๋์ปค
| ์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
๊ธ ๋ณด๊ดํจ
