//collect relationship
Set rels = bundle.getRelationships();
Iterator relIter = rels.iterator();
while (relIter.hasNext()) {
RelationshipDescriptor rel = (RelationshipDescriptor)relIter.next();
RelationRoleDescriptor source = rel.getSource();
RelationRoleDescriptor sink = rel.getSink();
//collect source RelationshipDescriptor
String sourceEjbName = source.getOwner().getName();
ArrayList sourceRels = (ArrayList)ejbRelMap.get(sourceEjbName);
if (sourceRels == null) {
sourceRels = new ArrayList();
ejbRelMap.put(sourceEjbName, sourceRels);
}
sourceRels.add(rel);
//collect source cmr field
String sourceCMRField = source.getCMRField();
if (sourceCMRField != null) {
addField(sourceEjbName, sourceCMRField);
}
//collect sink RelationshipDescriptor
String sinkEjbName = sink.getOwner().getName();
ArrayList sinkRels = (ArrayList)ejbRelMap.get(sinkEjbName);
if (sinkRels == null) {
sinkRels = new ArrayList();
ejbRelMap.put(sinkEjbName, sinkRels);
}
sinkRels.add(rel);
//collect sink cmr field
String sinkCMRField = sink.getCMRField();
if (sinkCMRField != null) {
addField(sinkEjbName, sinkCMRField);
}
}
}