* will behave as though it were an object newly-created by the
* client.
*/
id = state.getIdFactory().allocateSyntheticId(proxyType, ++syntheticId);
} else {
Splittable flatValue = state.flatten(domainId);
id = state.getIdFactory().getId(proxyType, flatValue.getPayload(), 0);
}
} else if (domainId != null) {
// Mark an ephemeral id as having been persisted
Splittable flatValue = state.flatten(domainId);
id.setServerId(flatValue.getPayload());
}
} else if (isEntityProxy) {
// Already have the id, just pull the current version
domainVersion = service.getVersion(domainEntity);
} else {
// The version of a value object is always null
domainVersion = null;
}
@SuppressWarnings("unchecked")
AutoBean<T> bean = (AutoBean<T>) state.getBeanForPayload(id, domainEntity);
bean.setTag(Constants.IN_RESPONSE, true);
if (domainVersion != null) {
Splittable flatVersion = state.flatten(domainVersion);
bean.setTag(Constants.VERSION_PROPERTY_B64, SimpleRequestProcessor.toBase64(flatVersion
.getPayload()));
}
T clientObject = bean.as();
return makeResolution(key, clientObject);