Derby fail mutiple conditions, postgres and mysql does not