Field named "id" (but not an @Id) in a class referenced via join table leads to "Column 'col_1_1_' not found" when retrieving old versions

Description

I have a child class referenced with a @OneToMany via a @JoinTable. This class has a field in it named "id", as well as a real @Id field called something else.

Envers seems to treat the field specially because it's called "id", which seems wrong. It seems to get confused and ends up trying to pull a column from a ResultSet which did not exist in the appropriate query.

I've attached a small test case. Run "mvn install" and the test case will throw an exception. Rename the field Child.id to anything else and "mvn install" will succeed.

The pom in the test case references 3.3.2.GA and Envers 1.2.0.GA-hibernate-3.3, but I've tried with 3.5.0.Beta-2 and got exactly the same result.

To save opening the tarball if you don't want to run it, the entity classes look like this:

Parent.java

Child.java

Environment

None

Status

Assignee

Chris Cranford

Reporter

Simon MacMullen

Fix versions

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure