private function getEncryptedFieldMapping(array $fieldMapping)
    {
        switch($fieldMapping['type']) {
            case 'string':
                return new FieldMapping\StringFieldMapping($this, $fieldMapping);
            case 'text':
            case 'json_array':
            case 'simple_array':
            case 'array':
            case 'object':
                return new FieldMapping\TextFieldMapping($this, $fieldMapping);
            case 'date':
            case 'datetime':
            case 'time':
                return new FieldMapping\DateTimeFieldMapping($this, $fieldMapping);
            case 'boolean':
            case 'smallint':
            case 'integer':
            case 'bigint':
            case 'float':
                return new FieldMapping\PrimitiveFieldMapping($this, $fieldMapping);
            default:
                throw new EncryptionException('Field type '.$fieldMapping['type'].' not supported.');
        }
    }