Using @GeneratedValue (strategy = GenerationType.TABLE), sequence_next_hi_value is int (11), but my table has a column identifier bigint (20)

I am using @Id with @GeneratedValue (strategy = GenerationType.TABLE), just checked that hibernate created the hibernate_sequences table, but the column type for sequence_next_hi_value is int (11). I have some objects (I mean tables) that have an id field of type bigint (20), will this work? and when does my table reach the number of rows I expect?

thank

+3
source share
1 answer

(...) hibernate hibernate_sequences, sequence_next_hi_value int (11). ( ), id bigint (20), ?

Yest, .

, ?

, . , , - JPA:

, . , , . , . , id NUMBER (5), 99,999 , . , NUMBER (10), , 9,999,999,999, 300 ( ). , () . (20) 99,999,999,999,999,999,999, id 3 000 000 000 , .

. Java int, 32- , 4 294 967 296 , 200 . 64- , 18,446,744,073,709,551,616 ids 600 000 000 , .

IMO, int (11) 50 .

+11

Source: https://habr.com/ru/post/1771394/


All Articles