Views joining/relating a custom table entity to users through a field? Using Drupal 7 and Views 3 - I have created a custom entity and can view it fine through Views using EntityDefaultViewsController. The Table is a view shared to the drupal database and is constructed like:

Table A
------------
id_key
data


I have a drupal user field - field_tableA_data that contains the same data type/items in the Table A data field (they are not linked in any way - two separate systems load this data - in TableA the data is generated by another system and the User field is loaded by the LDAP module)

I want to make it so that I can make a "View" such that when viewing Table A Items I can also make a relationship to the User entities such that:
Table A > field_tableA_data > User 

Is this possible in code and if so how?

Here is some code I have tried and to no avail:

class TableAEntityViewsController extends EntityDefaultViewsController {

  /**
   * Edit or add extra fields to views_data().
   */
  public function views_data() {
    $data = parent::views_data();
    $data['tableA']['data']['relationship'] = array(
      'handler' =&gt; 'views_handler_relationship',
      'base' =&gt; 'field_data_field_tablea_data',
      'base field' =&gt; 'field_tablea_data_value',
      'title' =&gt; t('TableA Data'),
      'label' =&gt; t('TableA Data'),
    );
    return $data;
  }
}


and in the module (table A entity I have a hook):

function (module)_views_data_alter(&amp;$data) {
    $data['tableA']['table']['join'] = array(
    'field_data_field_tablea_data' =&gt; array(
      'left_field' =&gt; 'field_tableA_data_value',
      'field' =&gt; 'data',
    ),
    'user' =&gt; array(
      'left_field' =&gt; 'uid',
      'field' =&gt; 'field_data_tablea_data.entity_id',
    ),
  );
}


The best this gives me though is User:field_tableA data and no other fields from User - I'm trying to get uid and username.
I know this is not timely, but if someone else is looking for an answer:  

Assumptions:
- Using Entity API
- Joining to another entity where the entity id is a field in your entity's base table
- It's a one-to-one relationship


Add the views controller class to your entity info file
function my_entity_entity_info() {

$info['my_entity'] = array(
  'views controller class' => 'MyEntityViewsController',
  ...
 );


2 Extend EntityDefaultMetadataController

class MyEntityMetadataController extends EntityDefaultMetadataController {

  public function entityPropertyInfo() {

    $info = parent::entityPropertyInfo();

    // This exposes the fields as references to views. 
    $info['my_entity_base_table']['properties']['uid']['type'] = 'user'; 

   ....
  }
}