public void insert(Insert query) throws IOException, Error, ClassNotFoundException {
		Hashtable<String, Table> tables = null;
		ArrayList<Value> valueList = null;
		ArrayList< ArrayList<Value> > tupleList; 
		Table table;
		File tableFile = new File(databaseDefUrl);
		if(tableFile.exists()){
			tables = this.getTableDef();
		}else{
			throw new Error("INSERT: No database defined");  
		}
		if((table = tables.get(query.getTableName()) )!= null ){
			valueList = this.convertInsertValuesType(table, query.getValueList());
			boolean constraintCheck = this.evaluateConstraintsCond(table, valueList);

			if(!constraintCheck){
				throw new Error("INSERT: Constraints check violated");
			}
			File tupleFile = new File(query.getTableName() + ".db");
			if(tupleFile.exists()){
				tupleList = this.getTupleList(tupleFile);
			}else{
				tupleList = new ArrayList<ArrayList<Value>>();
			}

			if(tupleList != null && valueList != null){
				//Check primary key constraints
				boolean isNotViolatePrimary = this.checkPrimarys(table.getPrimaryList(), tupleList, valueList);

				//Needs to check length
				//!!!!!!!!!!!!!!!!!!

				//Check foreign constraints
				boolean isNotViolateForeign = this.checkForeignConstraints(tables, table, valueList);


				if(isNotViolatePrimary && isNotViolateForeign){
					tupleList.add(valueList);
				}else{
					throw new Error("INSERT: Primary key constraints violated");
				}
			}
			this.saveTupleList(tupleFile, tupleList);
			System.out.println("Tuple inserted successfully");
		}else{
			throw new Error("INSERT: No Table " + query.getTableName() + " Found");
		}


	}