Skip to content

Commit

Permalink
#3433 - Put test back from desc -> description as desc as a column na…
Browse files Browse the repository at this point in the history
…me isn't widely supported by other databases
  • Loading branch information
rbygrave committed Jul 8, 2024
1 parent 70cfc77 commit f279582
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class BSimpleWithGen {

private String name;

private String desc;
private String description;

@Transient
private Map<String, List<String>> someMap;
Expand Down Expand Up @@ -47,11 +47,11 @@ public void setSomeMap(Map<String, List<String>> someMap) {
this.someMap = someMap;
}

public String getDesc() {
return desc;
public String getDescription() {
return description;
}

public void setDesc(String desc) {
this.desc = desc;
public void setDescription(String description) {
this.description = description;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ void testMe() {

BSimpleWithGen b = new BSimpleWithGen("blah");
b.setSomeMap(map);
b.setDesc("hi");
b.setDescription("hi");
DB.save(b);

final BSimpleWithGen found = DB.find(BSimpleWithGen.class, b.getId());
assertThat(found.getName()).isEqualTo("blah");
assertThat(found.getSomeMap()).isNull();

Query<BSimpleWithGen> query = DB.find(BSimpleWithGen.class)
.where().startsWith("desc", "h")
.orderBy().desc("desc");
.where().startsWith("description", "h")
.orderBy().desc("description");

var list = query.findList();
assertThat(list).hasSize(1);
assertThat(query.getGeneratedSql()).contains("where t0.desc like");
assertThat(query.getGeneratedSql()).contains("order by t0.desc desc");
assertThat(query.getGeneratedSql()).contains("where t0.description like");
assertThat(query.getGeneratedSql()).contains("order by t0.description desc");

DB.delete(b);
}
Expand Down

0 comments on commit f279582

Please sign in to comment.