Support entity check constraints

These can be used to define constraints spanning all entity attributes
including arbitrarily nested ones.