The method org.hibernate.internal.util.StringHelper.lastIndexOfLetter does not consider the character '_'

Description

I have 3 entities:
A UserEntity (Long Id)
A ConfEntity with an IdClass (ConfId)
A UserConfEntity with also an IdClass (UserConfId)

ConfId is composed of 2 String and UserConId is composed of a Long and ConfId.

In my unit test I create all entities and I do a find on the UserEntity.
Immediately after the find, I do a flush and an exception is throwned.

looking at the code I can see that the method org.hibernate.internal.util.StringHelper.lastIndexOfLetter does not consider the character '_' called by the method org.hibernate.mapping.Column.getAlias(Dialect) and my table USER_CONF has a column with '_' in its name.

You can execute the unit test net.foo.bar.entities.test.FlushTest to reproduce the bug and see the exception.

Rgds,

Thibault

Environment

None

Status

Assignee

Brett Meyer

Reporter

Thibault TIGEON

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure