When using a SequenceStyleGenerator backed by a TableStructure each table using the generator inserts an extra row there when using SchemaExport

Description

When using a SequenceStyleGenerator backed by a database table (using TableStructure) each entity using the same table will cause an extra row to be inserted to the table (when using SchemaExport or hbm2ddl).

This is because a generator is initialized for each entity, and every time registerExportables is called, which causes an additional InitCommand to be registered.

Sample mapping:

Causes:

Environment

None

Activity

Show:
Lukasz Pater
August 31, 2017, 8:58 AM

Test case here

Buğra Gedik
March 22, 2018, 10:21 PM
Edited

Is anyone form the Hibernate team going to address this?

Assignee

Unassigned

Reporter

Lukasz Pater

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.2.13

Affects versions

Priority

Major
Configure