Correctly handling query creation when one of the columns is of type Object (JSON)

If the entity has attributes of type JSON, the query  to insert or update it is invalid, this change should fix that.