mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1849 - JoinColumn not found when using @Encrypted(dbEncryption = true) and findCount
This commit is contained in:
@@ -10,6 +10,7 @@ import io.ebeaninternal.api.SpiEbeanServer;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.EBasicEncrypt;
|
||||
import org.tests.model.basic.EBasicEncryptRelate;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.List;
|
||||
@@ -34,6 +35,26 @@ public class TestEncrypt extends BaseTestCase {
|
||||
assertThat(loggedSql.get(0)).contains("; --bind(****,Rob%)");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform(Platform.H2) // only run this on H2 - PGCrypto not happy on CI server
|
||||
public void testQueryJoin() {
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
DB.find(EBasicEncryptRelate.class)
|
||||
.where().eq("other.description", "foo")
|
||||
.findList();
|
||||
|
||||
DB.find(EBasicEncryptRelate.class)
|
||||
.where().eq("other.description", "foo")
|
||||
.findCount();
|
||||
|
||||
List<String> loggedSql = LoggedSqlCollector.stop();
|
||||
assertThat(loggedSql).hasSize(2);
|
||||
assertThat(loggedSql.get(0)).contains("left join e_basicenc t1 on t1.id = t0.other_id");
|
||||
assertThat(loggedSql.get(1)).contains("left join e_basicenc t1 on t1.id = t0.other_id");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform(Platform.H2)
|
||||
public void test() {
|
||||
|
||||
Reference in New Issue
Block a user