How does GenerationType.AUTO hibernate work in Oracle?

Using oracle / JPA Hibernate. I imported a schema that matters below the students table below. Here is an example

100
85
80
70
1

I have the code below:

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
long id;

Now that a new student is inserted, he does not insert the maximum value ie 101 (max + 1). But inserting some values ​​available between like 90. I'm not sure how this is possible?

Does Hibernate create the internal structure of some database sequence and use it using the last created value plus 1

+4
source share
1 answer

For the oracle, yes, it creates a sequence (probably called hibernate_sequence).

, , , , , , ( ).

+3

All Articles