I have entities with joined inheritance:
Supporter
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Js
Just another workaround using a RelProvider
:
@JsonTypeInfo
Create a RelProvider
for SupporterEntity
sub-classes
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
public class SupporterEntityRelProvider implements RelProvider {
@Override
public String getCollectionResourceRelFor(final Class> type) {
return "supporters";
}
@Override
public String getItemResourceRelFor(final Class> type) {
return "supporter";
}
@Override
public boolean supports(final Class> delimiter) {
return org.apache.commons.lang3.ClassUtils.isAssignable(delimiter, SupporterEntity.class);
}
}
See also: