if (view != null) {
for (String key : associationMap.keySet()) {
Association association = associationMap.get(key);
if (association != null) {
if (view.compare(association.getEnd1(), association.getEnd2())) {
JPAEdmAssociationEndView associationEnd = associationEndMap.get(association.getName());
if (associationEnd.getJoinColumnNames() != null
&& associationEnd.getJoinColumnReferenceColumnNames() != null
&& view.getJoinColumnNames() != null && view.getJoinColumnReferenceColumnNames() != null) {
if (Arrays.equals(view.getJoinColumnNames(), associationEnd.getJoinColumnNames())
&&
Arrays.equals(view.getJoinColumnReferenceColumnNames(), associationEnd
.getJoinColumnReferenceColumnNames())) {
currentAssociation = association;
return association;
}
}
if (associationEnd.getMappedByName() != null) {
if (associationEnd.getMappedByName().equals(view.getOwningPropertyName())) {
currentAssociation = association;
return association;
}
}
if (associationEnd.getOwningPropertyName() != null) {
if (associationEnd.getOwningPropertyName().equals(view.getMappedByName())) {
currentAssociation = association;
return association;
}
}
}