mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#2774 Locally encrypted properties can be used in "in" queries
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package org.tests.basic.encrypt;
|
||||
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.SqlRow;
|
||||
import io.ebean.xtest.ForPlatform;
|
||||
import io.ebean.xtest.IgnorePlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.dbplatform.DbEncrypt;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.xtest.ForPlatform;
|
||||
import io.ebean.xtest.IgnorePlatform;
|
||||
import io.ebeaninternal.api.SpiEbeanServer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.EBasicEncrypt;
|
||||
@@ -149,6 +149,11 @@ public class TestEncrypt extends BaseTestCase {
|
||||
|
||||
assertEquals(1, list.size());
|
||||
|
||||
list = DB.find(EBasicEncrypt.class).where()
|
||||
.in("description", "moddesc").findList();
|
||||
|
||||
assertEquals(1, list.size());
|
||||
|
||||
list = DB.find(EBasicEncrypt.class).where().startsWith("description", "modde").findList();
|
||||
|
||||
assertEquals(1, list.size());
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.tests.basic.encrypt;
|
||||
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.EBasicEncryptClient;
|
||||
|
||||
@@ -50,6 +50,16 @@ public class TestEncryptClientSide extends BaseTestCase {
|
||||
assertThat(found).isNotNull();
|
||||
assertThat(found.getDescription()).isEqualTo("goodbye");
|
||||
|
||||
found = DB.find(EBasicEncryptClient.class)
|
||||
.where()
|
||||
.in("description", "goodbye")
|
||||
.in("status", EBasicEncryptClient.Status.TWO)
|
||||
.in("dob", today)
|
||||
.findOne();
|
||||
assertThat(found).isNotNull();
|
||||
assertThat(found.getDescription()).isEqualTo("goodbye");
|
||||
|
||||
|
||||
DB.delete(found);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user