if ((value != null) && (Beans.isInstanceOf(value, IDomainObject.class))) { IDomainObject o = po.readByOID(value.getClass(), ((IDomainObject) value)
final Class valueClass; if (value instanceof Proxy) { valueClass = ProxyHelper.getRealClass(value); } else { valueClass = value.getClass(); }  IDomainObject o = po.readByOID(valueClass, ((IDomainObject) value)
    private void fillAssociatedObjects(IDomainObject newDomainObject, IPersistentObject po,            IDomainObject objectToEdit) throws FenixServiceException {        try {            Map propertiesMap = PropertyUtils.describe(objectToEdit);            Iterator iterator = propertiesMap.entrySet().iterator();            while (iterator.hasNext()) {                Map.Entry entry = (Map.Entry) iterator.next();                Object value = entry.getValue();                if ((value != null) && (Beans.isInstanceOf(value, IDomainObject.class))) {                    IDomainObject o = po.readByOID(value.getClass(), ((IDomainObject) value)                            .getIdInternal(), false);                    PropertyUtils.setProperty(newDomainObject, entry.getKey().toString(), o);                }            }        } catch (Exception e) {            throw new FenixServiceException(e.getMessage());        }    }