We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Test public void findSingleAttribute() { EBasicSoftDelete bean = new EBasicSoftDelete(); bean.setName("findSingleAttribute"); DB.save(bean); LoggedSqlCollector.start(); final String name0 = DB.find(EBasicSoftDelete.class) .select("name") .where().eq("name", "findSingleAttribute") .findSingleAttribute(); List<String> sql0 = LoggedSqlCollector.current(); assertThat(sql0.get(0)).contains("where t0.name = ? and t0.deleted ="); assertThat(name0).isEqualTo("findSingleAttribute"); // now soft delete the bean DB.delete(bean); List<String> sqlUpdate = LoggedSqlCollector.current(); assertThat(sqlUpdate.get(0)).contains("update ebasic_sdchild set"); // use setIncludeSoftDeletes final String name1 = DB.find(EBasicSoftDelete.class) .select("name") .where().eq("name", "findSingleAttribute") .setIncludeSoftDeletes() .findSingleAttribute(); List<String> sql1 = LoggedSqlCollector.current(); assertThat(sql1.get(0)).doesNotContain(" and t0.deleted ="); assertThat(name1).isEqualTo("findSingleAttribute"); // not using setIncludeSoftDeletes, so don't find it final String name2 = DB.find(EBasicSoftDelete.class) .select("name") .where().eq("name", "findSingleAttribute") .findSingleAttribute(); List<String> sql2 = LoggedSqlCollector.stop(); assertThat(sql2.get(0)).contains(" and t0.deleted ="); assertThat(name2).isNull(); }
The text was updated successfully, but these errors were encountered:
#2269 - findSingleAttributeList does not filter soft-deleted record
492bb98
Thanks for logging the issue @spinachomes
Sorry, something went wrong.
rbygrave
No branches or pull requests
The text was updated successfully, but these errors were encountered: