Update Model.php

Refactoring the repeated code
Add method processCriteriaWithType() 
Update some annotation