throws IllegalManagedObjectNameException, IllegalArgumentException {
validateRelationDefinition(r);
// Empty names are not allowed.
if (name.trim().length() == 0) {
throw new IllegalManagedObjectNameException(name);
}
// If the relation uses a naming property definition then it must
// be a valid value.
PropertyDefinition<?> pd = r.getNamingPropertyDefinition();
if (pd != null) {
try {
pd.decodeValue(name);
} catch (IllegalPropertyValueStringException e) {
throw new IllegalManagedObjectNameException(name, pd);
}
}
ManagedObjectPath<CC, ? extends S> childPath = path.child(r, d, name);
return createNewManagedObject(d, childPath, pd, name, exceptions);