package uk.ac.cam.cstibhotel.otcanalyser.database;

import java.sql.PreparedStatement;
import java.sql.SQLException;

public class BoolSQLField extends SQLField {

	private final boolean fieldValue;

	public BoolSQLField(boolean fieldValue) {
		this.fieldValue = fieldValue;
	}
	
	@Override
	public String getType() {
		return "BOOLEAN";
	}

	@Override
	public void addToPreparedStatement(PreparedStatement p) throws SQLException {
		p.setBoolean(index, fieldValue);
	}
	
}

@@ -109,16 +109,39 @@
 ception;
+%0Aimport java.sql.Types;
 %0A%0Apublic
@@ -195,17 +195,17 @@
 e final 
-b
+B
 oolean f
@@ -237,17 +237,17 @@
 QLField(
-b
+B
 oolean f
@@ -448,16 +448,86 @@
 ption %7B%0A
+%09%09if (fieldValue == null)%0A%09%09%09p.setNull(index, Types.BOOLEAN);%0A%09%09else%0A%09
 %09%09p.setB

make BoolSQLField tristate