ArrayStoreException in Constraint.generateName

Description

I have the following mapping inside an entity:

When I start the application the following exception occurs:

This is, because Table.generateName(List keyColumns) is called with a list that contains a Column and a Formula object. Inside that method org.hibernate.mapping.Constraint#generateName(java.lang.String, org.hibernate.mapping.Table, java.util.List<org.hibernate.mapping.Column>) is called:

The call columns.toArray(new Column[columns.size()]) causes ArrayStoreException because an array for Column is initialized, but the columns list also contains a Formula object.

I'm using spring 5.1.7, spring boot 2.1.5, spring-data 2.1.8, hibernate-core 5.3.10.Final

Environment

None

Status

Assignee

Sanne Grinovero

Reporter

Andreas Knees

Fix versions

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure