}
private static Map<String, Object> collectProperties(Relationship relationship, AssociationKey associationKey, AssociatedEntityKeyMetadata associatedEntityKeyMetadata) {
Map<String, Object> properties = new HashMap<String, Object>();
String[] rowKeyColumnNames = associationKey.getMetadata().getRowKeyColumnNames();
Node ownerNode = ownerNode( associationKey, relationship );
Node targetNode = relationship.getOtherNode( ownerNode );
// Index columns
for ( int i = 0; i < rowKeyColumnNames.length; i++ ) {
if ( relationship.hasProperty( rowKeyColumnNames[i] ) ) {
properties.put( rowKeyColumnNames[i], relationship.getProperty( rowKeyColumnNames[i] ) );
}
}
// Properties stored in the target side of the association
for ( String associationColumn : associatedEntityKeyMetadata.getAssociationKeyColumns() ) {
String targetColumnName = associatedEntityKeyMetadata.getCorrespondingEntityKeyColumn( associationColumn );
if ( targetNode.hasProperty( targetColumnName ) ) {
properties.put( associationColumn, targetNode.getProperty( targetColumnName ) );
}
}
// Property stored in the owner side of the association
for ( int i = 0; i < associationKey.getColumnNames().length; i++ ) {