private List<Object> getAssociationRows(Association association, AssociationKey associationKey) {
List<Object> rows = new ArrayList<Object>( association.getKeys().size() );
for ( RowKey rowKey : association.getKeys() ) {
Tuple tuple = association.get( rowKey );
String[] columnsToPersist = associationKey.getMetadata().getColumnsWithoutKeyColumns( tuple.getColumnNames() );
// return value itself if there is only a single column to store
if ( columnsToPersist.length == 1 ) {
Object row = tuple.get( columnsToPersist[0] );
rows.add( row );
}
else {
Map<String, Object> row = new HashMap<String, Object>( columnsToPersist.length );
for ( String columnName : columnsToPersist ) {
row.put( columnName, tuple.get( columnName ) );
}
rows.add( row );
}
}