public ObjectReferenceMapping createMapping(final ObjectSpecification spec) {
return createMapping(spec.getShortIdentifier(), spec);
}
public ObjectReferenceMapping createMapping(final String columnName, final ObjectSpecification spec) {
ObjectReferenceMappingFactory factory = referenceMappings.get(spec);
if (factory != null) {
return factory.createReferenceMapping(columnName, spec);
} else if (spec.isEncodeable()) {
// TODO add generic encodeable mapping
throw new NotYetImplementedException();
} else {// if (true /* TODO test for reference */) {
factory = objectReferenceMappingfactory;
// add(spec, factory);
return factory.createReferenceMapping(columnName, spec); // TODO:
// here
// } else {
// throw new IsisException("No mapper for " + spec +
// " (no default mapper)");
}