@SuppressWarnings("unchecked")
	private <X> List<X> selectSimple(X x, boolean distinct) {
		SQLStatement stat = getSelectStatement(distinct);
		appendSQL(stat, null, x);
		appendFromWhere(stat);
		ResultSet rs = stat.executeQuery();
		List<X> result = Utils.newArrayList();
		try {
			while (rs.next()) {
				X value;
				Object o = rs.getObject(1);
				// Convert CLOB and BLOB now because we close the resultset
				if (Clob.class.isAssignableFrom(o.getClass())) {
					value = (X) Utils.convert(o, String.class);
				} else if (Blob.class.isAssignableFrom(o.getClass())) {
					value = (X) Utils.convert(o, byte[].class);
				} else {
					value = (X) o;
				}
				result.add(value);
			}
		} catch (Exception e) {
			throw IciqlException.fromSQL(stat.getSQL(), e);
		} finally {
			JdbcUtils.closeSilently(rs, true);
		}
		return result;
	}