Remove external column name prefixing for embedded entities.

Original pull request #1604
See #1586
This commit is contained in:
Jens Schauder
2023-09-05 16:30:14 +02:00
parent d6d99571b1
commit f60044225f
8 changed files with 21 additions and 53 deletions

View File

@@ -413,7 +413,7 @@ public class QueryMapper {
Condition condition = null;
for (RelationalPersistentProperty nestedProperty : persistentEntity) {
SqlIdentifier sqlIdentifier = nestedProperty.getColumnName().transform(prefix::concat);
SqlIdentifier sqlIdentifier = nestedProperty.getColumnName();
Object mappedNestedValue = convertValue(embeddedAccessor.getProperty(nestedProperty),
nestedProperty.getTypeInformation());
SQLType sqlType = converter.getTargetSqlType(nestedProperty);
@@ -768,16 +768,6 @@ public class QueryMapper {
throw new IllegalStateException("Cannot obtain a single column name for embedded property");
}
if (this.property != null && this.path != null && this.path.getParentPath() != null) {
RelationalPersistentProperty owner = this.path.getParentPath().getLeafProperty();
if (owner != null && owner.isEmbedded()) {
return this.property.getColumnName()
.transform(it -> Objects.requireNonNull(owner.getEmbeddedPrefix()).concat(it));
}
}
return this.path == null || this.path.getLeafProperty() == null ? super.getMappedColumnName()
: this.path.getLeafProperty().getColumnName();
}