Skip to content

Incorrect audit table insert on tables with tree structure #18

@wojtek-abakus

Description

@wojtek-abakus

Hello.

I have a problem with envers when an audited table has a tree structure.
When I insert a row without any parent it inserts correctly to an audit table with revision type 0 (Added).
Then I try to insert a child row with an ID pointing to parent row (by creating an empty entity with only ID set, it works normallny with nHibernate).

The result is that Envers tries to insert an audit table row with with revision type 1 (Modified) that corresponds to the parent row with all the fields set to null...
It's very strange, but when I comment out the HasMany mapping it works ok.

I have made a sample project to show that behavior, it crashes because one of the fields is set to be not null.

EnversTest.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions