@Override
	public void generate(String dbName, String fileName, List<ORASSNode> rootNodes, Map<String, List<String>> naryRels) throws MainException {
		// TODO Auto-generated method stub
		dbCache = DBAccess.getInstance();
		tables = new ArrayList<List<String>>();
		nodeTables = new ArrayList<String>();
		relationships = new ArrayList<NodeRelationship>();
		keyMaps = new HashMap<String, List<String>>();
		colMaps = new HashMap<String, List<String>>();
		criticalColMaps = new HashMap<String, List<ColumnDetail>>();
		tableDataIDs = new HashMap<String, List<TupleIDMap>>();
		tableKeyData= new HashMap<String, CachedRowSet>();
		tableData= new HashMap<String, CachedRowSet>();
		nRels = naryRels;
		//	needClosing = new HashMap<Integer, Boolean>();

		setupFile(dbName, fileName);

		printDB(dbName, fileName, rootNodes);

		writer.close();
	}