   addClasses: (metaModel) ->
     for element in @graph.getElements()
 
-      metaModel[@graph.getName element] =
+      metaModel.push
         mType: Constants.CLASS
         name: @graph.getName element
         abstract: @graph.isAbstract element


  # Builds the metaModel JSON object and returns it.
  createMetaModel: () ->
    metaModel = {}

    @addClasses metaModel
    @addReferences metaModel

  addEnums: (metaModel) ->
    for thisMEnum in mEnum.getMEnums()

      metaModel.push
        mType: Constants.ENUM
        name: thisMEnum.name
        type: thisMEnum.type
