Error at saving entity via Hibernate session

Description

At saving entity I got following error:

19:26:28.595 [JavaFX Application Thread] ERROR com.xxx.DatabaseConnectionsController - cannot save DB connection: class org.hibernate.id.IdentifierGeneratorHelper$2 cannot be cast to class java.lang.Long (org.hibernate.id.IdentifierGeneratorHelper$2 is in module org.hibernate.orm.core@6.0.0.Alpha2 of loader 'app'; java.lang.Long is in module java.base of loader 'bootstrap')
19:26:28.599 [JavaFX Application Thread] ERROR com.xxx.DatabaseConnectionsController - org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl@67ea3277 is closed

Entity:

As you can see, I use GenerationType.IDENTITY as strategy for 'id' field. I try to use other strategies (AUTO), but without results.

I tried to create table via SQL-script, but it didn't help:

Content of hibernate.cfg.xml:

Source code:


MWE:

Environment

OS: macOS 10.13, 10.14
DB: H2 1.4.199
JVM: 12

Status

Assignee

Unassigned

Reporter

Oleg Vorobiov

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure