}
else if (element.getText().equals(elementTypes[RELATIONSHIP_ROLE])) {
if (isEmpty(textList.get(1).getText())) {
return false;
}
EjbRelationshipRole role = (EjbRelationshipRole)eObject;
if (role == null) {
role = (EjbRelationshipRole)getEFactory().create(EjbRelationshipRole.class);
relation = (EjbRelation)((EjbRelationSection)section).getSelectedObject();
relation.getEjbRelationshipRole().add(role);
}
role.setEjbRelationshipRoleName(textList.get(0).getText());
EjbRelationshipRole.RelationshipRoleSource source = role.getRelationshipRoleSource();
if (source == null) {
source = (EjbRelationshipRole.RelationshipRoleSource)getEFactory().create(EjbRelationshipRole.RelationshipRoleSource.class);
role.setRelationshipRoleSource(source);
}
source.setEjbName(textList.get(1).getText());
EjbRelationshipRole.CmrField cmrField = role.getCmrField();
if (cmrField == null) {
cmrField = (EjbRelationshipRole.CmrField)getEFactory().create(EjbRelationshipRole.CmrField.class);
role.setCmrField(cmrField);
}
cmrField.setCmrFieldName(textList.get(2).getText());
}
else if (element.getText().equals(elementTypes[CMR_FIELD_MAPPING])) {
if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(1).getText())) {
return false;
}
EjbRelationshipRole.RoleMapping.CmrFieldMapping fieldMapping =
(EjbRelationshipRole.RoleMapping.CmrFieldMapping)eObject;
if (fieldMapping == null) {
fieldMapping = (EjbRelationshipRole.RoleMapping.CmrFieldMapping)getEFactory().create(EjbRelationshipRole.RoleMapping.CmrFieldMapping.class);
EjbRelationshipRole role = (EjbRelationshipRole)((EjbRelationSection)section).getSelectedObject();
EjbRelationshipRole.RoleMapping roleMapping = role.getRoleMapping();
if (roleMapping == null) {
roleMapping = (EjbRelationshipRole.RoleMapping)getEFactory().create(EjbRelationshipRole.RoleMapping.class);
role.setRoleMapping(roleMapping);
}
role.getRoleMapping().getCmrFieldMapping().add(fieldMapping);
}
fieldMapping.setKeyColumn(textList.get(0).getText());
fieldMapping.setForeignKeyColumn(textList.get(1).getText());
}
return true;