private RelationRoleDescriptor getRealRelationRoleDescriptor(
String ejbName, String cmrFieldName, boolean self) {
ArrayList rels = (ArrayList)ejbRelMap.get(ejbName);
for (int i = 0; i < rels.size(); i++) {
RelationshipDescriptor rel = (RelationshipDescriptor)rels.get(i);
RelationRoleDescriptor source = rel.getSource();
RelationRoleDescriptor sink = rel.getSink();
if (ejbName.equals(source.getOwner().getName()) &&
cmrFieldName.equals(source.getCMRField())) {
return (self) ? source : sink;
} else if (ejbName.equals(sink.getOwner().getName()) &&
cmrFieldName.equals(sink.getCMRField())) {