์ํฉ
H2 db ์ฌ์ฉ, entity class ์ ํ
์ด๋ธ๋ช
์ ๋ช
์ํด์ฃผ์ง ์์.
๋ฐ์ดํฐ ๋ฑ๋ก ์ฒ๋ฆฌ ์ค ํด๋น ์๋ฌ ๋ฐ์ (ํ
์ด๋ธ ์ํ์ค ๊ฐ์ด ์๋ค๋ ์ํฉ)
ํด๊ฒฐ
entity class (@Entity ์ค์ ํด๋์ค) ๋ด id ํ๋(@Id ์ค์ ๋ ๊ฐ)์
@GeneratedValue(strategy = GenerationType.AUTO) ์ค์ ๋ถ๋ถ์
@GeneratedValue(strategy = GenerationType.IDENTITY) ์ผ๋ก ๋ณ๊ฒฝ
--> ๊ธฐ๋ณธํค ์์ฑ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์์ํด์ฃผ๊ณ id๊ฐ null ์ด๋ฉด ์์์ auto_increment ํด์ค
์ฐธ๊ณ
https://stackoverflow.com/questions/39807483/sequence-hibernate-sequence-not-found-sql-statement
Sequence "HIBERNATE_SEQUENCE" not found; SQL statement
In my spring mvc app, i have the following object. I am trying to make a visual of data using devtool in my app. @Entity @Data public class ConsultationRequest { @Id @GeneratedValue p...
stackoverflow.com
https://gmlwjd9405.github.io/2019/08/12/primary-key-mapping.html