mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Change BindHash from interface to implementation, Delete unused server persist BindValues
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
+7
-6
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user