Hello All
I am having trouble creating a mapping when the List type is an interface. It looks like I need to create an abstract class and use the discriminator column is this the case? I would rather not have to as the abstract class will just contain an abstract method and I would rather just keep the interface.
I have an interface lets call it Account
public interface Account {
public void doStuff();
}
Now I have two concrete implementors of Account OverSeasAccount and OverDrawnAccount
public class OverSeasAccount implements Account {
public void doStuff() {
//do overseas type stuff
}
}
AND
public class OverDrawnAccount implements Account {
public void doStuff() {
//do overDrawn type stuff
}
}
I have a class called Work with a List
private List<Account> accounts;
I am looking at discriminator fields but I seem to be only able do this for abstract classes. Is this the case? Any pointers appreciated. Can I use discriminators for interfaces?