/**
    * Create all entity EJBs in the uml model and put them in a hashmap
    *
    * @param entityEJBs list with all entity EJBs.
    * @param simpleModel the uml model.
    * @return HashMap with all UML Entity classes.
    */
private HashMap createEntityEJBs(ArrayList entityEJBs, SimpleModel simpleModel) {
    HashMap map = new HashMap();
    for (int i = 0; i < entityEJBs.size(); i++) {
        Entity e = (Entity) entityEJBs.get(i);
        String documentation = e.getDescription().toString();
        String name = e.getName().toString();
        String refName = e.getRefName();
        String tableName = e.getTableName();
        String displayName = e.getDisplayName().toString();
        String entityRootPackage = e.getRootPackage().toString();
        simpleModel.addSimpleUmlPackage(entityRootPackage);
        String isCompositeKey = e.getIsComposite();
        String isAssocation = e.getIsAssociationEntity();
        // "true" or "false"  
        // Use the refName to put all EntityEJBs in a HashMap.  
        // Add the standard definition for the URLS.  
        SimpleUmlClass umlClass = new SimpleUmlClass(name, SimpleModelElement.PUBLIC);
        // The e should be a UML Class.  
        // Use the stereoType:  
        simpleModel.setStereoType(JagUMLProfile.STEREOTYPE_CLASS_ENTITY, umlClass);
        simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_DOCUMENTATION, documentation, umlClass);
        simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_CLASS_TABLE_NAME, tableName, umlClass);
        if (!"".equals(displayName)) {
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_CLASS_DISPLAY_NAME, displayName, umlClass);
        }
        if ("true".equals(isCompositeKey)) {
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_CLASS_COMPOSITE_PRIMARY_KEY, e.getPrimaryKeyType().toString(), umlClass);
        }
        if ("true".equals(isAssocation)) {
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_CLASS_IS_ASSOCIATION, isAssocation, umlClass);
        }
        ArrayList fields = (ArrayList) e.getFields();
        for (int j = 0; j < fields.size(); j++) {
            Field field = (Field) fields.get(j);
            String fieldType = field.getType();
            String fieldName = field.getName().toString();
            SimpleUmlClass type = (SimpleUmlClass) typeMappings.get(fieldType);
            if (type == null) {
                log("Unknown type: " + type + " for field " + fieldType);
                type = (SimpleUmlClass) typeMappings.get(this.stringType);
            }
            SimpleAttribute theAttribute = new SimpleAttribute(fieldName, SimpleModelElement.PUBLIC, type);
            umlClass.addSimpleAttribute(theAttribute);
            String foreignKey = field.getForeignKey().toString();
            // "true" or "false" if the current field as a foreign key.  
            if (field.isPrimaryKey()) {
                simpleModel.setStereoType(JagUMLProfile.STEREOTYPE_ATTRIBUTE_PRIMARY_KEY, theAttribute);
            } else if (field.isNullable() == false) {
                simpleModel.setStereoType(JagUMLProfile.STEREOTYPE_ATTRIBUTE_REQUIRED, theAttribute);
            }
            if (field.isForeignKey()) {
                // Niet duidelijk of het plaatsen van 2 stereotypes mogelijk is....  
                String stereoTypeForeignKey = JagUMLProfile.STEREOTYPE_ATTRIBUTE_FOREIGN_KEY;
            }
            String jdbcType = field.getJdbcType().toString();
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_ATTRIBUTE_JDBC_TYPE, jdbcType, theAttribute);
            String sqlType = field.getSqlType().toString();
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_ATTRIBUTE_SQL_TYPE, sqlType, theAttribute);
            String columnName = field.getColumnName();
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_ATTRIBUTE_COLUMN_NAME, columnName, theAttribute);
            boolean autoGeneratedPrimarykey = field.getHasAutoGenPrimaryKey();
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_ATTRIBUTE_AUTO_PRIMARY_KEY, "" + autoGeneratedPrimarykey, theAttribute);
        }
        SimpleUmlPackage pk = simpleModel.addSimpleUmlPackage(entityRootPackage);
        pk.addSimpleClassifier(umlClass);
        map.put(refName, umlClass);
    }
    return map;
}

// Niet duidelijk of het plaatsen van 2 stereotypes mogelijk is....  
/**
    * Create all entity EJBs in the uml model and put them in a hashmap
    *
    * @param entityEJBs list with all entity EJBs.
    * @param simpleModel the uml model.
    * @return HashMap with all UML Entity classes.
    */
private HashMap createEntityEJBs(ArrayList entityEJBs, SimpleModel simpleModel) {
    HashMap map = new HashMap();
    for (int i = 0; i < entityEJBs.size(); i++) {
        Entity e = (Entity) entityEJBs.get(i);
        String documentation = e.getDescription().toString();
        String name = e.getName().toString();
        String refName = e.getRefName();
        String tableName = e.getTableName();
        String displayName = e.getDisplayName().toString();
        String entityRootPackage = e.getRootPackage().toString();
        simpleModel.addSimpleUmlPackage(entityRootPackage);
        String isCompositeKey = e.getIsComposite();
        String isAssocation = e.getIsAssociationEntity();
        // "true" or "false"  
        // Use the refName to put all EntityEJBs in a HashMap.  
        // Add the standard definition for the URLS.  
        SimpleUmlClass umlClass = new SimpleUmlClass(name, SimpleModelElement.PUBLIC);
        // The e should be a UML Class.  
        // Use the stereoType:  
        simpleModel.setStereoType(JagUMLProfile.STEREOTYPE_CLASS_ENTITY, umlClass);
        simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_DOCUMENTATION, documentation, umlClass);
        simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_CLASS_TABLE_NAME, tableName, umlClass);
        if (!"".equals(displayName)) {
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_CLASS_DISPLAY_NAME, displayName, umlClass);
        }
        if ("true".equals(isCompositeKey)) {
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_CLASS_COMPOSITE_PRIMARY_KEY, e.getPrimaryKeyType().toString(), umlClass);
        }
        if ("true".equals(isAssocation)) {
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_CLASS_IS_ASSOCIATION, isAssocation, umlClass);
        }
        ArrayList fields = (ArrayList) e.getFields();
        for (int j = 0; j < fields.size(); j++) {
            Field field = (Field) fields.get(j);
            String fieldType = field.getType();
            String fieldName = field.getName().toString();
            SimpleUmlClass type = (SimpleUmlClass) typeMappings.get(fieldType);
            if (type == null) {
                log("Unknown type: " + type + " for field " + fieldType);
                type = (SimpleUmlClass) typeMappings.get(this.stringType);
            }
            SimpleAttribute theAttribute = new SimpleAttribute(fieldName, SimpleModelElement.PUBLIC, type);
            umlClass.addSimpleAttribute(theAttribute);
            String foreignKey = field.getForeignKey().toString();
            // "true" or "false" if the current field as a foreign key.  
            if (field.isPrimaryKey()) {
                simpleModel.setStereoType(JagUMLProfile.STEREOTYPE_ATTRIBUTE_PRIMARY_KEY, theAttribute);
            } else if (field.isNullable() == false) {
                simpleModel.setStereoType(JagUMLProfile.STEREOTYPE_ATTRIBUTE_REQUIRED, theAttribute);
            }
            if (field.isForeignKey()) {
                // Niet duidelijk<SUF>
                String stereoTypeForeignKey = JagUMLProfile.STEREOTYPE_ATTRIBUTE_FOREIGN_KEY;
            }
            String jdbcType = field.getJdbcType().toString();
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_ATTRIBUTE_JDBC_TYPE, jdbcType, theAttribute);
            String sqlType = field.getSqlType().toString();
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_ATTRIBUTE_SQL_TYPE, sqlType, theAttribute);
            String columnName = field.getColumnName();
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_ATTRIBUTE_COLUMN_NAME, columnName, theAttribute);
            boolean autoGeneratedPrimarykey = field.getHasAutoGenPrimaryKey();
            simpleModel.addTaggedValue(JagUMLProfile.TAGGED_VALUE_ATTRIBUTE_AUTO_PRIMARY_KEY, "" + autoGeneratedPrimarykey, theAttribute);
        }
        SimpleUmlPackage pk = simpleModel.addSimpleUmlPackage(entityRootPackage);
        pk.addSimpleClassifier(umlClass);
        map.put(refName, umlClass);
    }
    return map;
}
