add constraints to domain class