#2692 - [querybean generation] Compile error, incorrect generation with nested inner class/record @Embeddable and @IdClass

This commit is contained in:
Rob Bygrave
2022-05-16 18:48:42 +12:00
parent b7d6374370
commit 9dea51b7a0
13 changed files with 316 additions and 68 deletions
@@ -0,0 +1,30 @@
package org.querytest;
import io.ebean.DB;
import org.example.domain.MyInner;
import org.example.domain.query.QMyInner;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class MyInnerTest {
@Test
void insert_and_find() {
MyInner myInner = new MyInner()
.id(42).one("one").description("foo");
DB.save(myInner);
MyInner found = DB.find(MyInner.class, new MyInner.ID(42, "one"));
assertThat(found).isNotNull();
MyInner found2 = new QMyInner()
.id.eq(42)
.one.eq("one")
.findOne();
assertThat(found2).isNotNull();
}
}