mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-12-01 15:37:14 +00:00
#1562 - Query cache use incorrect with RawExpression - incorrect bind hash
This commit is contained in:
1 parent
211f28eea3
commit
70e2b1c2ae
3 files changed
+86
-1
No files matched your search
@@ -45,4 +45,27 @@ public class RawExpressionTest extends BaseExpressionTest {
|
||||
assertThat(exp("a", 10, 20).isSameByBind(exp("a", 10))).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryBindHash_when_sameBindValues() {
|
||||
assert_queryBindHash_isSame(exp("a", 10), exp("a", 10));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryBindHash_when_diffBindValues() {
|
||||
assert_queryBindHash_isDifferent(exp("a", 10), exp("a", 20));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryBindHash_when_diffBindValues2() {
|
||||
assert_queryBindHash_isDifferent(exp("a", 10), exp("a", 10, 11));
|
||||
}
|
||||
|
||||
public void assert_queryBindHash_isDifferent(RawExpression exp0, RawExpression exp1) {
|
||||
assertThat(exp0.queryBindHash()).isNotEqualTo(exp1.queryBindHash());
|
||||
}
|
||||
|
||||
public void assert_queryBindHash_isSame(RawExpression exp0, RawExpression exp1) {
|
||||
assertThat(exp0.queryBindHash()).isEqualTo(exp1.queryBindHash());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user