public function materialize(array $data, $entity)
    {
        $key = $this->getColumn()->key();
        $value = null;
        if ($this->isMaterializable($data)) {
            if (!is_null($data[$key])) {
                if ($this->isScalar()) {
                    $value = $data[$key];
                    settype($value, $this->getType());
                } else {
                    $value = AnDomainAttribute::getInstance($this->getType());
                    $value->unserialize($data[$key]);
                }
            }
        } else {
            throw new AnDomainExceptionMapping($this->getName().' Mapping Failed');
        }

        return $value;
    }