public function getEntity()
    {

        // primary key only
        $references = $this->getReferences();

        // debug // print_r( $references->map(function($e){ return $e->get('fullyQualifiedName');}) );
        foreach( $references as $reference ) {

            // only manage references where the reference column is the primary key
            if( $reference->isPrimaryKey() ) {
                return array(
                    'entity' => 'normality',
                    'normality' => $reference->getRelation()->getEntityName(),
                );
            }

        }

        // datatypes we understand and have defined objects for
        // have a helper method in Entity::staticHelper
        switch( $this->getType()->name ) {

            case 'StockState':

                return array (
                    'entity' => 'StockState',
                );

            case 'hstore':

                return array(
                    'entity' => 'Hstore',
                );

            case 'json':

                return array(
                    'entity' => 'Json',
                );

            case 'inet':

                return array(
                    'entity' => 'Inet',
                );

            case 'timestamp':

                return array(
                    'entity' => 'DateTime',
                );

            case 'tsrange':

                return array(
                    'entity' => 'DateRange',
                );

            case 'oid':

                return array(
                    'entity' => 'PgLargeObject',
                );

        }

        return array();

    }