#2774 Locally encrypted properties can be used in "in" queries

This commit is contained in:
Roland Praml
2022-10-27 14:38:41 +02:00
parent 4cc012b974
commit c5612d50fe
3 changed files with 57 additions and 27 deletions
@@ -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);
}
}