Table Exporter Creating Wrong Column For Generated Value with Composite Primary Key

Description


When using create-drop, the table generated puts the generated value on the wrong column:
create table evnt_milstn (evnt_id bigint generated by default as identity, evnt_milstn_id bigint not null

The problem appears in
org.hibernate.tool.schema.internal.StandardTableExporter in getSqlCreateStrings

This code:


is not looking for the GeneratedValue identity column but merely the first primary key column.

This should be getting the column with @GeneratedValue

Environment

Spring Data JPA
From version 5.3.10 to 5.4.4

Status

Assignee

Fabio Massimo Ercoli

Reporter

Ben Bean

Fix versions

None

Labels

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure