Skip to content

Commit

Permalink
#3463 - Ignore queryBean.select(null) calls (#3464)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave authored Aug 27, 2024
1 parent 86c7de2 commit f896470
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,9 @@ public final Query<T> select(String columns) {

@Override
public final Query<T> select(FetchGroup<T> fetchGroup) {
this.detail = ((SpiFetchGroup<T>) fetchGroup).detail();
if (fetchGroup != null) {
this.detail = ((SpiFetchGroup<T>) fetchGroup).detail();
}
return this;
}

Expand Down
16 changes: 16 additions & 0 deletions ebean-querybean/src/test/java/org/querytest/QOrderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,22 @@ void fetchCache() {
.findList();
}

@Test
void viaNullFetchGraph() {
DB.getDefault();
LoggedSql.start();

FetchGroup<Order> fg = null;
new QOrder()
.select(fg)
.status.eq(Order.Status.NEW)
.findList();

final List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains("select /* QOrderTest.viaNullFetchGraph */ t0.id, ");
}

@Test
void viaFetchGraph() {

Expand Down

0 comments on commit f896470

Please sign in to comment.