Change BindHash from interface to implementation, Delete unused server persist BindValues

This commit is contained in:
rbygrave
2021-08-11 12:43:58 +12:00
parent 11e8e3696f
commit fd2e542c0b
9 changed files with 28 additions and 210 deletions
@@ -4,7 +4,6 @@ import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import io.ebeaninternal.api.BindHash;
import io.ebeaninternal.server.querydefn.HashCodeBindHash;
public class RawExpressionTest extends BaseExpressionTest {
@@ -71,9 +70,8 @@ public class RawExpressionTest extends BaseExpressionTest {
}
private int getHash(RawExpression query) {
BindHash hash = new HashCodeBindHash();
BindHash hash = new BindHash();
query.queryBindHash(hash);
hash.finish();
return hash.hashCode();
}
}
@@ -1,18 +1,19 @@
package io.ebeaninternal.server.querydefn;
import io.ebeaninternal.api.BindHash;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class HashCodeBindHashTest {
public class BindHashTest {
@Test
public void update_with_null() {
HashCodeBindHash hash = new HashCodeBindHash();
BindHash hash = new BindHash();
hash.update(1).update(null).update("hello");
HashCodeBindHash hash2 = new HashCodeBindHash();
BindHash hash2 = new BindHash();
hash2.update(1).update(null).update("hello");
assertThat(hash).isEqualTo(hash2);
@@ -21,13 +22,13 @@ public class HashCodeBindHashTest {
@Test
public void notEqual() {
HashCodeBindHash hash = new HashCodeBindHash();
BindHash hash = new BindHash();
hash.update(1).update(null).update("hello");
HashCodeBindHash hash2 = new HashCodeBindHash();
BindHash hash2 = new BindHash();
hash2.update(1).update("hello");
HashCodeBindHash hash3 = new HashCodeBindHash();
BindHash hash3 = new BindHash();
hash2.update(1).update(null);
assertThat(hash).isNotEqualTo(hash2);
@@ -113,9 +113,8 @@ public class DefaultOrmQueryTest extends BaseTestCase {
}
private int getHash(DefaultOrmQuery<Order> query) {
BindHash hash = new HashCodeBindHash();
BindHash hash = new BindHash();
query.queryBindHash(hash);
hash.finish();
return hash.hashCode();
}
}