Custom Views Relationship with Custom Entity I have custom entity with just a base table and it is referenced with the node with its field field_a. Now I want to create the relationship between these two entities (node and my custom entity). I can get the result working but I am not getting the node fields listed in the views field section.

// Base table for custom entity is "clinical_trial_research_sites"

function clinical_trial_views_data_alter(&amp;$data) {
 $data['clinical_trial_research_sites']['node'] = array(
    'title' =&gt; t('Clinical Trial'),
    'help' =&gt; t('Field Reference Appear in Location Content type.'),
    // Information of the referenced table!!
    'relationship' =&gt; array(
      'handler' =&gt; 'views_handler_relationship',
      'label' =&gt; t('Location'),
      'base' =&gt; 'field_data_field_site_comp_code', // node field table name
      'base field' =&gt; 'field_site_comp_code_value', // field column name of node field
      'relationship field' =&gt; 'site_comp_code', // This is referencing field in my custom entity
    ),
  );
}


I can get the sql working , inner join working but views is not listing all the fields of the node as I want to display the some of the fields from the nodes too!!. I think I am missing some information to tell the views that realtionship is not only field table but with the node as a whole!!
I fixed it by copying some of the code from the entityreference. 
I have to use a different views handler for this relationship  and add other attributes to that relationship

function clinical_trial_views_data_alter(&amp;$data) {

  $data['clinical_trial_research']['clinical_trial_research_sites'] = array(
    'title' =&gt; t('Clinical Trial Research Sites'),
    'help' =&gt; t('Field Reference Appear in Clinical Trial Research Sites.'),
    'relationship' =&gt; array(
      'handler' =&gt; 'views_handler_relationship',
      'label' =&gt; t('Clinical Trial Research Sites'),
      'base' =&gt; 'clinical_trial_research_sites',
      'base field' =&gt; 'study_num',
      'relationship field' =&gt; 'study_num',
    ),
  );
  // The reference field in the node entity is not entity reference , its just a basic text field
  $data['clinical_trial_research_sites']['site_comp_code']['relationship'] = array(
    'handler' =&gt; 'views_handler_relationship_entity_reverse',
    'field_name' =&gt; 'field_site_comp_code',
    'field table' =&gt; 'field_data_field_site_comp_code',
    'field field' =&gt; "field_site_comp_code_value",
    'base' =&gt; 'node',
    'base field' =&gt; 'nid',
    'title' =&gt; t('Referencing entity'),
    'help' =&gt; t('Field Reference Appear in Location Content type.'),
    'title' =&gt; t('Location'),
  );
}