Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<jdbcDriver libraryRef="JDBCLibrary"/>
<!-- TODO remove MODE=LEGACY once EclipseLink fixes bug #35022
where it tries to compare a boolean attribute to an integer -->
<properties.h2 URL="${env.DB_URL};MODE=LEGACY" user="dbuser1" password="dbpwd1"/>
<properties.h2 URL="${env.DB_URL}" user="dbuser1" password="dbpwd1"/>
</dataSource>

<library id="JDBCLibrary">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2646,4 +2646,10 @@ public void testStatefulResourceAccessor() throws Exception {
}
}

@Test
public void testBooleanRestriction() {
fractions.where(Restrict.all(_Fraction.name.contains("Four"),
_Fraction.reduced.isTrue()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,20 @@ public boolean isH2() {
public String getProcedureCallHeader() {
return "CALL ";
}

/**
* Help to generate SQL like WHERE (REDUCED = TRUE) instead of
* WHERE (REDUCED = 1), which is compatible with H2's strict type system
* @param bool
* @param writer
* @throws IOException
*/
@Override
protected void appendBoolean(Boolean bool, Writer writer) throws IOException {
if (bool) {
writer.write("TRUE");
} else {
writer.write("FALSE");
}
}
}