Support null values in the query build

JAVA-105 #fixes