Before using your model to for code generation you should perform validations first. See Performing Validations to learn how to do validations.