Skip to content

Commit 93edc84

Browse files
committed
Add a test that hits the new branch of code
1 parent d918c51 commit 93edc84

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ebean-core/src/main/java/io/ebeaninternal/api/BindValuesKey.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public BindValuesKey(SpiEbeanServer server) {
2525
*/
2626
public BindValuesKey add(Object value) {
2727
if (value instanceof EntityBean) {
28-
// Only interested in id to keep the memory footprint low
28+
// only interested in id to keep the memory footprint low
2929
Object id = server.beanId(value);
3030
if (id != null) {
3131
value = id;
@@ -45,5 +45,4 @@ public int hashCode() {
4545
return values.hashCode();
4646
}
4747

48-
4948
}

ebean-test/src/test/java/org/tests/model/memleak/TestQueryCacheHoldsBean.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,15 @@ void testQueryCacheHoldsBean() {
2323
.findOne();
2424
}
2525
}
26+
27+
@Test
28+
void queryCacheHoldsBean() {
29+
var query = DB.find(MemleakParent.class)
30+
.where().eq("id", 989898)
31+
.eq("child", DB.reference(MemleakChild.class, 4534535))
32+
.setUseQueryCache(true);
33+
34+
query.findOne();
35+
query.findOne();
36+
}
2637
}

0 commit comments

Comments
 (0)