public HQLCompletionInfoCollection(HibernateConnection con) {
    _mappedClassInfos = con.getMappedClassInfos();

    for (MappedClassInfo mappedClassInfo : _mappedClassInfos) {
      _mappedClassInfoByClassName.put(mappedClassInfo.getClassName(), mappedClassInfo);
      _mappedClassInfoBySimpleClassName.put(mappedClassInfo.getSimpleClassName(), mappedClassInfo);

      for (String attrName : mappedClassInfo.getAttributeNames()) {
        _attributeNames.put(attrName, attrName);
      }
    }

    _simpleInfos = new ArrayList<SimpleHQLCompletionInfo>();
    _simpleInfos.addAll(HQLKeywordInfo.createInfos());
    _simpleInfos.addAll(HQLFunctionInfo.createInfos());

    for (SimpleHQLCompletionInfo simpleInfo : _simpleInfos) {
      _simpleInfosByName.put(simpleInfo.getCompareString(), simpleInfo);
    }

    _hqlSyntaxHighlightTokenMatcher.addSQLTokenListener(
        new SQLTokenListener() {
          public void tableOrViewFound(String name) {
            onTableOrViewFound(name);
          }
        });

    for (MappedClassInfo mappedClassInfo : _mappedClassInfos) {
      mappedClassInfo.initAttributesWithClassInfo(this);
    }
  }