factored constraint handling into common mechanism for all datatables