// create a dummy entity location by adding a dummy key predicate
// look for a Container name if available
String referencedEntityName = referencedEntity.toString();
final int containerSeparator = referencedEntityName.lastIndexOf('.');
final EdmEntityContainer entityContainer;
if (containerSeparator != -1) {
final String containerName = referencedEntityName.substring(0, containerSeparator);
referencedEntityName = referencedEntityName.substring(containerSeparator + 1);
entityContainer = edm.getEntityContainer(containerName);
if (entityContainer == null) {
throw new IllegalArgumentException("EDM does not have entity container " + containerName);
}
} else {
entityContainer = edm.getDefaultEntityContainer();
if (entityContainer == null) {
throw new IllegalArgumentException("EDM does not have a default entity container"
+ ", use a fully qualified entity set name");
}
}
final EdmEntitySet entitySet = entityContainer.getEntitySet(referencedEntityName);
final List<EdmProperty> keyProperties = entitySet.getEntityType().getKeyProperties();
if (keyProperties.size() == 1) {
referencedEntity.append("('dummy')");
} else {