Queries, Validation and Commands implemented in Java