use entity class for exception