Add support to @OrderColumn JPA2 annotation to work with @AuditMappedBy

Description

Hi guys,

I'm working on a project where we're using envers and since we're migrating from jboss 4.2.3 to jboss 6.0.0.Final (finally), I'm then upgrading the old envers to the new one.
Part of the migration I've changed all the @IndexColumn by the new JPA2 @OrderColumn and it seems that envers doesn't work with that new annotation (or I might do something wrong here )

Also, since we're now using the @OrderColumn the "position" column on the referenced entity has been removed as the hibernate documentation (and JPA2 specs) ask for it. Since it's been removed I'm getting the problem.

Here is the example mapping:

Every time I deploy this I'm getting the following error:

More details can be read there: http://community.jboss.org/message/589031

Thanks for looking at it

Cheers,
/Benoit

Environment

jboss 6.0.0.Final and hibernate 3.6.0.Final

Activity

Show:
Gail Badner
August 16, 2011, 12:12 AM

Adam, please assign as appropriate.
Thanks,
Gail

Steve Ebersole
October 27, 2015, 7:16 PM

This bug report does not indicate that the reported issue affects version 5.x. Versions prior to 5.x are no longer maintained. It would be a great help to the Hibernate team and community for someone to verify that the reported issue still affects version 5.x. If so, please add the 5.x version that you verified with to the list of affected-versions and attach the (preferably SSCCE) test case you used to do the verification to the report; from there the issues will be looked at during our triage meetings.

For details, see http://in.relation.to/2015/10/27/great-jira-cleanup-2015/

Steve Ebersole
October 28, 2015, 3:25 AM

As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.

Chris Cranford
July 29, 2016, 9:30 PM

@OrderColumn support already exists. As the forum thread states, Envers still requires that the positionMappedBy named property attribute be manually mapped on the referenced entity in order to avoid the mapping exception you describe.

I've added a new JIRA, to address the possibility of avoiding the need to add the additional property mapping.

Assignee

Chris Cranford

Reporter

benoit heinrich

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure