}
@Override
public Object getStrategy(Discriminator disc, boolean adapt) {
Object strat = super.getStrategy(disc, adapt);
ClassMapping cls = disc.getClassMapping();
if (strat != null || cls.getJoinablePCSuperclassMapping() != null
|| disc.getMappingInfo().getValue() != null)
return strat;
// don't use a column-based discriminator approach unless user has set
// a column explicitly or is using flat inheritance explicitly
if (!disc.getMappingInfo().getColumns().isEmpty())
return new ValueMapDiscriminatorStrategy();
ClassMapping base = cls;
while (base.getMappingInfo().getHierarchyStrategy() == null
&& base.getPCSuperclassMapping() != null)
base = base.getPCSuperclassMapping();
strat = base.getMappingInfo().getHierarchyStrategy();
if (FlatClassStrategy.ALIAS.equals(strat))
return new ValueMapDiscriminatorStrategy();
if (VerticalClassStrategy.ALIAS.equals(strat)
&& dict.joinSyntax != JoinSyntaxes.SYNTAX_TRADITIONAL)
return new SubclassJoinDiscriminatorStrategy();