java - Hibernate Inheritance: Load all entities but no subclasses -
given 2 classes
@entity @table(name = "a") @inheritance(strategy = inheritancetype.table_per_class) public class a{ ... }
and
@entity @table(name = "b") public class b extends a{ ... }
when calling
sessionfactory sessionfactory = ...; session session = sessionfactory.opensession(); session.createcriteria(a.class).list()
i receive instances of and b.
how query instances of (no subclasses of a)?
Comments
Post a Comment