public function materialize(array $data, $entity)
    {
        //use a entity proxy to delay loading the related entity
        if ($this->_cardinality == 1) {
            $config = array();
            $config['relationship'] = $this;
            $config['value'] = $entity;
            $config['property'] = $this->_child_key;
            $config['service_identifier'] = $this->getChildRepository()->getDescription()->getEntityIdentifier();

            return new AnDomainEntityProxy(new AnConfig($config));
        } else {
            return $this->getSet($entity);
        }
    }