}
private static String relationshipType(RelatedToVia annotation, TypeInformation<?> typeInformation) {
if (!annotation.type().isEmpty()) return annotation.type();
final TypeInformation<?> relationshipEntityType = elementClass(annotation, typeInformation);
final RelationshipEntity relationshipEntity = relationshipEntityType.getType().getAnnotation(RelationshipEntity.class);
if (relationshipEntity==null) {
throw new MappingException(typeInformation.getType()+" is no RelationshipEntity");
}
if (relationshipEntity.type()==null || relationshipEntity.type().isEmpty()) {
throw new MappingException("Relationship entity must have a default type");
}
return relationshipEntity.type();
}