mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-04 08:49:22 +00:00
HHH-12440 - Fix audited associations that use mapped-by references to embeddable attributes.
This commit is contained in:
parent
09cd41e382
commit
101038fe48
@ -877,7 +877,7 @@ private String getMappedBy(Collection collectionValue) {
|
||||
}
|
||||
|
||||
private String getMappedBy(Table collectionTable, PersistentClass referencedClass) {
|
||||
return getMappedBy( referencedClass, new ValueHolder( collectionTable, propertyValue.getMappedByProperty() ) );
|
||||
return getMappedBy( referencedClass, new ValueHolder( collectionTable ) );
|
||||
}
|
||||
|
||||
private String getMappedBy(PersistentClass referencedClass, ValueHolder valueHolder) {
|
||||
@ -993,13 +993,6 @@ private String searchMappedByKey(PersistentClass referencedClass, Collection col
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getMappedByPropertyValue(ValueHolder valueHolder) {
|
||||
if ( valueHolder.getMappedByProperty() != null ) {
|
||||
return valueHolder.getMappedByProperty();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private PersistentClass getReferenceCollectionClass(Collection collectionValue) {
|
||||
PersistentClass referencedClass = null;
|
||||
if ( collectionValue.getElement() instanceof OneToMany ) {
|
||||
@ -1024,7 +1017,6 @@ private boolean isMappedByKey(Collection collectionValue, String mappedBy) {
|
||||
}
|
||||
|
||||
private class ValueHolder {
|
||||
private String mappedByProperty;
|
||||
private Collection collection;
|
||||
private Table table;
|
||||
|
||||
@ -1032,9 +1024,8 @@ public ValueHolder(Collection collection) {
|
||||
this.collection = collection;
|
||||
}
|
||||
|
||||
public ValueHolder(Table table, String mappedByProperty) {
|
||||
public ValueHolder(Table table) {
|
||||
this.table = table;
|
||||
this.mappedByProperty = mappedByProperty;
|
||||
}
|
||||
|
||||
public Collection getCollection() {
|
||||
@ -1044,10 +1035,6 @@ public Collection getCollection() {
|
||||
public Table getTable() {
|
||||
return table;
|
||||
}
|
||||
|
||||
public String getMappedByProperty() {
|
||||
return mappedByProperty;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user