Skip to content
Permalink
Browse files

Resolve auto alias for subquery without joins (#896)

Co-authored-by: Mikalai Kisel <kisel.nikolay@gmail.com>
  • Loading branch information
nikolay-kisel and vgerton committed Mar 4, 2020
1 parent 64bd289 commit 7ff49330f3b20b7d2bedba6457b18134a7bdbef8
Showing with 2 additions and 1 deletion.
  1. +2 −1 requery/src/main/java/io/requery/sql/gen/DefaultOutput.java
@@ -94,7 +94,8 @@ public String toSql() {
aliases = inheritedAliases == null ? new Aliases() : inheritedAliases;
Set<Expression<?>> from = query.fromExpressions();
Set<?> joins = query.joinElements();
autoAlias = from.size() > 1 || (joins != null && joins.size() > 0);
autoAlias = inheritedAliases != null ||
from.size() > 1 || (joins != null && joins.size() > 0);
statementGenerator.write(this, query);
return qb.toString();
}

0 comments on commit 7ff4933

Please sign in to comment.
You can’t perform that action at this time.