Skip to content

Commit ed70803

Browse files
committed
removed the alias
1 parent be30491 commit ed70803

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/SqlGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,13 +929,14 @@ private Column getSingleNonNullColumn() {
929929
// return getTable(path).column(columnInfo.name()).as(columnInfo.alias());
930930

931931
AggregatePath.ColumnInfos columnInfos = mappingContext.getAggregatePath(entity).getTableInfo().idColumnInfos();
932-
return columnInfos.any((ap, ci) -> sqlContext.getTable(columnInfos.fullPath(ap)).column(ci.name()).as(ci.alias()));
932+
return columnInfos.any((ap, ci) -> sqlContext.getTable(columnInfos.fullPath(ap)).column(ci.name()));
933933
}
934934

935935
private List<Column> getIdColumns() {
936936

937937
AggregatePath.ColumnInfos columnInfos = mappingContext.getAggregatePath(entity).getTableInfo().idColumnInfos();
938938

939+
// sqlcontext.getColumn (vs sqlContext.getTable
939940
return columnInfos
940941
.toColumnList((aggregatePath, columnInfo) -> sqlContext.getColumn(columnInfos.fullPath(aggregatePath)));
941942
}

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/SqlParametersFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ <T> SqlIdentifierParameterSource forInsert(T instance, Class<T> domainType, Iden
8686
PersistentPropertyPathAccessor<T> propertyPathAccessor = persistentEntity.getPropertyPathAccessor(instance);
8787

8888
AggregatePath.ColumnInfos columnInfos = context.getAggregatePath(persistentEntity).getTableInfo().idColumnInfos();
89+
90+
// fullPath: because we use the result with a PropertyPathAccessor
8991
columnInfos.forEach((ap, __) -> {
9092
Object idValue = propertyPathAccessor.getProperty(columnInfos.fullPath(ap).getRequiredPersistentPropertyPath());
9193
RelationalPersistentProperty idProperty = ap.getRequiredLeafProperty();

0 commit comments

Comments
 (0)