code refactoring rest-ejb-jpa