Closed rullyalves closed 5 years ago
there is discriminator support see here https://simpleflatmapper.org/0205-inheritance-discriminator.html
in that case
JdbcMapper<Person> mapper =
JdbcMapperFactory.newInstance()
.discriminator(Person.class,
"person_type",
ResultSet::getString,
builder ->
builder
.when("teacher", Teacher.class)
.when("child", Child.class)
)
.newMapper(Person.class);
@rullyalves closing the ticket as I believe it does answer the questions, if you have any issue don't hesitate to reopen
Is there any form of discrimination interface using Simple Flat Mapper?
For example :
public interface Person {
void someMethod ();
}
class Teacher implements Person {
@override void someMethod () { }
}
class Child implements Person {
@override void someMethod () {
}
}