public TypeMetadataSet<RelationTypeMetadata<RelationMetadata>> getRelationTypes(Set<EntityDiscriminator> sourceDiscriminators, RelationDiscriminator discriminator, Set<EntityDiscriminator> targetDiscriminators) {
TypeMetadataSet<RelationTypeMetadata<RelationMetadata>> types = new TypeMetadataSet<>();
Set<RelationMapping<EntityDiscriminator, RelationMetadata, RelationDiscriminator>> relations = relationMappings.get(discriminator);
if (relations == null) {
throw new CdoException("Cannot resolve relation from discriminator '" + discriminator + "'");
}
for (RelationMapping<EntityDiscriminator, RelationMetadata, RelationDiscriminator> relation : relations) {
EntityDiscriminator source = relation.getSource();
EntityDiscriminator target = relation.getTarget();
if (sourceDiscriminators.contains(source) && targetDiscriminators.contains(target)) {