diff --git a/repository-ydb-v2/src/main/java/tech/ydb/yoj/repository/ydb/merge/ByEntityYqlQueriesMerger.java b/repository-ydb-v2/src/main/java/tech/ydb/yoj/repository/ydb/merge/ByEntityYqlQueriesMerger.java index b6d2bc2d..81ba4743 100644 --- a/repository-ydb-v2/src/main/java/tech/ydb/yoj/repository/ydb/merge/ByEntityYqlQueriesMerger.java +++ b/repository-ydb-v2/src/main/java/tech/ydb/yoj/repository/ydb/merge/ByEntityYqlQueriesMerger.java @@ -164,7 +164,7 @@ private MergingState doTransition(MergingState state, Statement.QueryType nextQu private static YdbRepository.Query convertInsertToUpsert(YdbRepository.Query query) { var type = getEntityClass(query); var schema = EntitySchema.of(type); - var tableDescriptor = TableDescriptor.from(schema); + var tableDescriptor = convertQueryToYqlStatement(query).getTableDescriptor(); var statement = new UpsertYqlStatement<>(tableDescriptor, schema); return new YdbRepository.Query<>(statement, query.getValues().get(0)); } @@ -173,7 +173,7 @@ private static YdbRepository.Query convertInsertToUpsert(YdbRepository.Query private static YdbRepository.Query convertInsertToDelete(YdbRepository.Query query) { var type = getEntityClass(query); var schema = EntitySchema.of(type); - var tableDescriptor = TableDescriptor.from(schema); + var tableDescriptor = convertQueryToYqlStatement(query).getTableDescriptor(); var statement = new DeleteByIdStatement<>(tableDescriptor, schema); return new YdbRepository.Query<>(statement, getEntityId(query)); }