if (newEntity == null)
return newEntity;
Class entityClass = newEntity.getClass();
String className = newEntity.getClass().getName();
EntityState state = newEntity.__caucho_getEntityState();
Object pk = newEntity.__caucho_getPrimaryKey();
if (log.isLoggable(Level.FINER))
log.finer(L.l("{0}[{1}] amber merge state='{2}'",
entityClass.getSimpleName(), pk, state));
if (state.isDeleting()) {
// removed entity instance
throw new IllegalArgumentException(L.l("{0}: merge operation cannot be applied to a removed entity instance",
entityClass));
}