I have a basic skeleton here and I am finding it really tough to map Polymorphic Queries with annotations. Provided that I have a location field in each item type (offence and defence) How would I go about bidirectionally mapping this query, or even unidirectionally for that matter?
I really appreciate any help, mixing all of this together for such an exotic mapping is really tough to figure out. The following is the basic structure which I've got (which i hope is right)
@Entity @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) interface item { }
@Entity @Table("Defence") class Defence implements Inventoryable, Wearable { .. }
@Entity @NamedQuery(name = "ClosetItems", query = 'Select * from Inventoryable where location = "INVENTORY"') class Inventory implements Location { .... Set<Inventoryable> getItems() { }
|