int counter = 0;
// gather list of generated cmr fields by examining source and sink
while (iterator.hasNext())
{
RelationshipDescriptor relationship =
(RelationshipDescriptor)iterator.next();
if (relationship.getSource().getCMRField() == null)
generatedRels.add(relationship);
if (relationship.getSink().getCMRField() == null)
generatedRels.add(relationship);
}
// now update the maps to contain this info
iterator = generatedRels.iterator();
while (iterator.hasNext())
{
RelationshipDescriptor relationship =
(RelationshipDescriptor)iterator.next();
RelationRoleDescriptor source = relationship.getSource();
String sourceEjbName = source.getOwner().getName();
String sourceCMRField = source.getCMRField();
boolean sourceIsNull = (sourceCMRField == null);
RelationRoleDescriptor sink = relationship.getSink();
String sinkEjbName = sink.getOwner().getName();
String ejbName = (sourceIsNull ? sourceEjbName : sinkEjbName);
String otherEjbName =
(sourceIsNull ? sinkEjbName : sourceEjbName);
List ejbField = Arrays.asList(new String[]{otherEjbName,