elementBinder.setReturnedClassName( mapKeyType );
Ejb3Column[] elementColumns = mapKeyColumns;
if ( elementColumns == null || elementColumns.length == 0 ) {
elementColumns = new Ejb3Column[1];
Ejb3Column column = new Ejb3Column();
column.setImplicit( false );
column.setNullable( true );
column.setLength( Ejb3Column.DEFAULT_COLUMN_LENGTH );
column.setLogicalColumnName( Collection.DEFAULT_KEY_COLUMN_NAME );
//TODO create an EMPTY_JOINS collection
column.setJoins( new HashMap<String, Join>() );
column.setMappings( mappings );
column.bind();
elementColumns[0] = column;
}
//override the table
for (Ejb3Column column : elementColumns) {
column.setTable( mapValue.getCollectionTable() );
}
elementBinder.setColumns( elementColumns );
//do not call setType as it extract the type from @Type
//the algorithm generally does not apply for map key anyway
elementBinder.setKey(true);