We're updating the issue view to help you get more done. 

Envers: when creating the revchanges and revinfo tables the property default_schema is ignored

Description

When using Hibernate Envers the property `org.hibernate.envers.default_schema` correctly works when deciding the entity schemas.

But when the tables REVCHANGES and REVINFO are being created this property is ignored and the tables are created in the default schema.

For example (this code is in kotlin, for brevity), this works:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 package ... import org.hibernate.annotations.Fetch import org.hibernate.annotations.FetchMode import java.util.HashSet import org.hibernate.envers.ModifiedEntityNames import javax.persistence.JoinColumn import javax.persistence.JoinTable import javax.persistence.ElementCollection import org.hibernate.envers.DefaultRevisionEntity import org.hibernate.envers.RevisionEntity import javax.persistence.Column import javax.persistence.Entity import javax.persistence.FetchType import javax.persistence.Table /** * */ @Entity @Table(name = "revision", schema = "audit") @RevisionEntity class RevisionEntity : DefaultRevisionEntity() { /** * */ @ElementCollection(fetch = FetchType.EAGER) @JoinTable(name = "entity_class_name_revision", schema = "audit", joinColumns = [JoinColumn(name = "revision_id")]) @Column(name = "entity_class_name") @Fetch(FetchMode.JOIN) @ModifiedEntityNames private var modifiedEntityNames: Set<String>? = HashSet() }

but this not:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 package ... import org.hibernate.annotations.Fetch import org.hibernate.annotations.FetchMode import java.util.HashSet import org.hibernate.envers.ModifiedEntityNames import javax.persistence.JoinColumn import javax.persistence.JoinTable import javax.persistence.ElementCollection import org.hibernate.envers.DefaultRevisionEntity import org.hibernate.envers.RevisionEntity import javax.persistence.Column import javax.persistence.Entity import javax.persistence.FetchType import javax.persistence.Table /** * */ @Entity @Table(name = "revision") @RevisionEntity class RevisionEntity : DefaultRevisionEntity() { /** * */ @ElementCollection(fetch = FetchType.EAGER) @JoinTable(name = "entity_class_name_revision", schema = "audit", joinColumns = [JoinColumn(name = "revision_id")]) @Column(name = "entity_class_name") @Fetch(FetchMode.JOIN) @ModifiedEntityNames private var modifiedEntityNames: Set<String>? = HashSet() }

In this last case the tables are created in the default schema, instead of "audit" schema.
Where the hibernate property is `set to org.hibernate.envers.default_schema = "audit"`.

Environment

None

Status

Assignee

Chris Cranford

Reporter

Danilo Araújo Silva

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major