Hibernate with MySQL: Automatically Generate Identifier: Sequence Equivalent (Oracle) in MySQL

As far as I understand, when Oracle uses the "Native" class to generate an automatic identifier, a single sleep sequence is created, from where all identifiers are provided depending on the table.

But I do not see this in MySQL. Instead, the identifier for each table begins with 1.

Please correct me if I am wrong.

Also, if I want the same thing to happen with MySQL, what needs to be done.

Thanks to everyone.

Raj.

+5
source share
1 answer

As far as I understand, when Oracle uses the "Native" class to generate an automatic identifier, a single sleep sequence is created, from where all identifiers are provided depending on the table.

This happens if you do not specify a sequence name, in contrast to this:

<generator class="sequence">
  <param name="sequence">employer_id_seq</param>
</generator>

, , .

MySQL. 1.

MySQL native identity, , .

, , MySQL, .

, , . table :

<generator class="table">
</generator>

, . , , . .

+6

All Articles