[QueryBeans] Fix for missing inherited properties when parent only has @DiscriminatorValue

A parent in the Inheritance hierarchy has @DiscriminatorValue but not the @Inheritance annotation. The bug means the inherited properties are not included on the generated query bean.

The fix is to the querybean-generator to pick up inherited properties for this case.
This commit is contained in:
Rob Bygrave
2023-02-28 23:02:19 +13:00
parent ac3ca8113d
commit 0bb2f104a4
9 changed files with 92 additions and 24 deletions
@@ -591,25 +591,7 @@ public class QCustomerTest {
.findList();
}
@Test
public void query_setInheritType() {
ACat cat = new ACat("C1");
cat.save();
ACat cat2 = new ACat("C2");
cat2.save();
ADog dog = new ADog("D1", "D878");
dog.save();
List<Animal> animals = new QAnimal()
.id.greaterOrEqualTo(1L)
.setInheritType(ACat.class)
.findList();
System.out.println(animals);
}
@Test
public void select_assocManyToOne() {