mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1562 - Query cache use incorrect with RawExpression - incorrect bind hash
This commit is contained in:
@@ -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