}
else if (element.getText().equals(elementTypes[RELATIONSHIP_ROLE])) {
if (isEmpty(textList.get(1).getText())) {
return false;
}
EjbRelationshipRoleType role = (EjbRelationshipRoleType)eObject;
if (role == null) {
role = (EjbRelationshipRoleType)getEFactory().create(EjbRelationshipRoleType.class);
relation = (EjbRelationType)((EjbRelationSection)section).getSelectedObject();
relation.getEjbRelationshipRole().add(role);
}
role.setEjbRelationshipRoleName(textList.get(0).getText());
EjbRelationshipRoleType.RelationshipRoleSource source = role.getRelationshipRoleSource();
if (source == null) {
source = (EjbRelationshipRoleType.RelationshipRoleSource)getEFactory().create(EjbRelationshipRoleType.RelationshipRoleSource.class);
role.setRelationshipRoleSource(source);
}
source.setEjbName(textList.get(1).getText());
EjbRelationshipRoleType.CmrField cmrField = role.getCmrField();
if (cmrField == null) {
cmrField = (EjbRelationshipRoleType.CmrField)getEFactory().create(EjbRelationshipRoleType.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;
}
EjbRelationshipRoleType.RoleMapping.CmrFieldMapping fieldMapping =
(EjbRelationshipRoleType.RoleMapping.CmrFieldMapping)eObject;
if (fieldMapping == null) {
fieldMapping = (EjbRelationshipRoleType.RoleMapping.CmrFieldMapping)getEFactory().create(EjbRelationshipRoleType.RoleMapping.CmrFieldMapping.class);
EjbRelationshipRoleType role = (EjbRelationshipRoleType)((EjbRelationSection)section).getSelectedObject();
EjbRelationshipRoleType.RoleMapping roleMapping = role.getRoleMapping();
if (roleMapping == null) {
roleMapping = (EjbRelationshipRoleType.RoleMapping)getEFactory().create(EjbRelationshipRoleType.RoleMapping.class);
role.setRoleMapping(roleMapping);
}
role.getRoleMapping().getCmrFieldMapping().add(fieldMapping);
}
fieldMapping.setKeyColumn(textList.get(0).getText());
fieldMapping.setForeignKeyColumn(textList.get(1).getText());
}
return true;