mwong
02/15/2018, 12:48 PM@Entity
@Inheritance(strategy = InheritanceType.JOINED)
abstract class Item(...)
@Entity
class SubItemA(...) : Item(...)
@Entity
class SubItemB(...) : Item(...)
This structure creates three tables, one with common attributes from the Item class and one for SubItemA and SubItemB
Then I can create a (Spring) repository where I can query for List<Item>
and get any instance, be it SubItemA or SubItemB
The issue I had with Exposed was that I could not find a way to query for the base class but retrieve any instance of a subclass