@Override
public void persist(final Object domainObject) {
final ObjectAdapter adapter = getAdapterManager().adapterFor(unwrapped(domainObject));
if(adapter == null) {
throw new PersistFailedException("Object not known to framework; instantiate using newTransientInstance(...) rather than simply new'ing up.");
}
if (adapter.isParented()) {
// TODO check aggregation is supported
return;
}
if (isPersistent(domainObject)) {
throw new PersistFailedException("Object already persistent; OID=" + adapter.getOid());
}
getObjectPersistor().makePersistent(adapter);
}