private void setupTables(ORASSNode parent) throws MainException{
		String tName = parent.getOriginalName();
		String newName = parent.getName();
		if(!checkTableExist(newName)){
			List<String> nameMapping = new ArrayList<String>();
			nameMapping.add(tName);
			nameMapping.add(newName);
			tables.add(nameMapping);
		}
		nodeTables.add(newName);

		//logger.info("new name: "+newName +"|| old name: "+tName);
		List<String> pks =dbCache.getPrimaryKeys(tName);
		keyMaps.put(newName, pks);
		List<ColumnDetail> criticalCols = new ArrayList<ColumnDetail>();
		List<ColumnDetail> colDetails = parent.getEntityAttributes();
		for(int i=0; i< colDetails.size(); i++){
			ColumnDetail col = colDetails.get(i);
			String colName = col.getName();
			if((pks.contains(colName) || col.isMultiValued()) && !criticalCols.contains(col)){
				criticalCols.add(col);
			}
		}
		criticalColMaps.put(newName, criticalCols);
		List<String> allCols = dbCache.getAllColumns(tName);
		colMaps.put(newName, allCols);

		List<ORASSNode> supertypes = parent.getSupertypeNode();
		for(int j=0; j<supertypes.size(); j++){
			logger.info("is-a");
			processSpecialRels(parent, supertypes.get(j));
		}
		ORASSNode regularEntity = parent.getNormalEntityNode();
		if(regularEntity!=null){
			logger.info("weak");
			processSpecialRels(parent,regularEntity);
		}
		/*for(int j=0; j<weakEntities.size(); j++){
			logger.info("ID/EX");
			processSpecialRels(parent, weakEntities.get(j));
		}*/

		List<ORASSNode> children = parent.getChildren();
		for(int i = 0; i<children.size(); i++){
			ORASSNode child = children.get(i);
			if(parent.hasRelation(child)){
				String relName = parent.getRelation(child);
				if(!checkTableExist(relName)){
					List<String> nameMapping = new ArrayList<String>();
					nameMapping.add(relName);
					nameMapping.add(relName);
					tables.add(nameMapping);
				}
				List<String> allRelCols = dbCache.getAllColumns(relName);
				colMaps.put(relName, allRelCols);
				CachedRowSet relFK = dbCache.getForeignKeys(relName);
				try{
					List<String> pkCols = new ArrayList<String>();
					List<String> relCols1 = new ArrayList<String>();
					List<String> relCols2 = new ArrayList<String>();
					List<String> cols2 = new ArrayList<String>();

					while(relFK.next()){
						String pkTable = relFK.getString("PKTABLE_NAME");
						if(pkTable.equals(parent.getOriginalName())){
							pkCols.add(relFK.getString("PKCOLUMN_NAME"));
							relCols1.add(relFK.getString("FKCOLUMN_NAME"));
						}
						if(pkTable.equals(child.getOriginalName())){
							cols2.add(relFK.getString("PKCOLUMN_NAME"));
							relCols2.add(relFK.getString("FKCOLUMN_NAME"));
						}
					}
					NodeRelationship rel = new NodeRelationship(relName, parent.getName(), relCols1, pkCols, relName, tName);
					NodeRelationship rel2 = new NodeRelationship(relName, child.getName(), relCols2, cols2, relName, child.getOriginalName());
					relationships.add(rel);
					relationships.add(rel2);
				}catch(SQLException ex){
					throw new MainException("Error in finding related columns from " + relName + " :" +ex.getMessage());
				}
			}else{
				processSpecialRels(parent, child);
			}

			setupTables(child);
		}

	}