@JoinFormula and @Generated behave differentlly on java 6 vs. java 8

Description

I have an entity with the following 2 attributes (among others):

This definition works in java 6. The same code and hibernate libraries on java 8 fail during construction of the sessionFactory with the following error:

It states the entity Insuredperson does not exist. However, if I remove the @Generated annotation from the insuredperson attribute, the sessionFactory is constructed without problems on java 8.

I've tested this behaviour with hibernate 5.1.14 and 5.1.15 but the results are the same for both versions.

Environment

hibernate-core:5.1.14, Oracle 11g Database, Windows 7 x64, WebLogic Servers 10.3.6.0 (JDK 1.6.0_45), 12.2.1.3.0 (JDK 1.8.0_152), Spring Framework 4.3.18

Activity

Show:
Guillaume Smet
December 11, 2018, 9:21 PM
Edited

Seems weird to say the least.

And you don't have a prior error which might explain the issue?

The only way we could understand what's going on would be if you created a test case using our test case template https://github.com/hibernate/hibernate-test-case-templates/tree/master/orm/hibernate-orm-5 .

There's no plan to release another 5.1.x though.

J. Gremmen
December 12, 2018, 10:36 AM

No, there is no prior error. If @Generated is there, it fails. If I remove the annotation, the session factory is created without errors.

As there is no plan to release another 5.1.x version, I woulld like to take the opportunity to upgrade to the latest hibernate version and see if the problem still exists.

Sanne Grinovero
August 7, 2019, 2:01 PM

were you able to test a more recent version and/or crate a test case? If not, we’ll close this.

Assignee

Unassigned

Reporter

J. Gremmen

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.1.14

Components

Affects versions

Priority

Blocker
Configure