// Path: src/main/java/pl/edu/pjwstk/kaldi/service/database/Database.java
// public static class Pair {
// 
// 	public String key;
// 	public String value;
// 	public boolean not;
// 	public boolean quoted;
// 
// 	public Pair(String key, String value) {
// 		this.key = key;
// 		this.value = value;
// 		this.not = false;
// 		this.quoted = true;
// 	}
// 
// 	public Pair(String key, String value, boolean not) {
// 		this.key = key;
// 		this.value = value;
// 		this.not = not;
// 		this.quoted = true;
// 	}
// 
// 	public Pair(String key, String value, boolean not, boolean quoted) {
// 		this.key = key;
// 		this.value = value;
// 		this.not = not;
// 		this.quoted = quoted;
// 	}
// }


import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.DateFormat;
import pl.edu.pjwstk.kaldi.service.database.Database.Pair;
	public static void changePID(Task task, int pid) throws RuntimeException {
		try {
			Database.updateInt("Task", "pid", pid, "_id", task._id);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}

	public static void setHash(Task task, String hash) throws RuntimeException {
		try {
			Database.update("Task", "hash", hash, "_id", task._id);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}

	}

	public static void setCopy(Task task, int copy) throws RuntimeException {
		try {
			Database.updateInt("Task", "copyid", copy, "_id", task._id);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}

	}

	public static Task getByHash(String hash) throws RuntimeException {
		try {

			String options = Database
// Path: src/main/java/pl/edu/pjwstk/kaldi/service/database/Database.java
// public static class Pair {
// 
// 	public String key;
// 	public String value;
// 	public boolean not;
// 	public boolean quoted;
// 
// 	public Pair(String key, String value) {
// 		this.key = key;
// 		this.value = value;
// 		this.not = false;
// 		this.quoted = true;
// 	}
// 
// 	public Pair(String key, String value, boolean not) {
// 		this.key = key;
// 		this.value = value;
// 		this.not = not;
// 		this.quoted = true;
// 	}
// 
// 	public Pair(String key, String value, boolean not, boolean quoted) {
// 		this.key = key;
// 		this.value = value;
// 		this.not = not;
// 		this.quoted = quoted;
// 	}
// }


// Path: src/main/java/pl/edu/pjwstk/kaldi/service/database/dbTasks.java
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.DateFormat;
import pl.edu.pjwstk.kaldi.service.database.Database.Pair;

	public static void changePID(Task task, int pid) throws RuntimeException {
		try {
			Database.updateInt("Task", "pid", pid, "_id", task._id);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}

	public static void setHash(Task task, String hash) throws RuntimeException {
		try {
			Database.update("Task", "hash", hash, "_id", task._id);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}

	}

	public static void setCopy(Task task, int copy) throws RuntimeException {
		try {
			Database.updateInt("Task", "copyid", copy, "_id", task._id);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}

	}

	public static Task getByHash(String hash) throws RuntimeException {
		try {

			String options = Database
					.whereAnd(new Pair[] { new Pair("status", "copyof", true),