Usually one entity from repository can be mapped to several DTOs, or one DTO can be composed from several entities, so we tend to expose DTOs, not entities. Another thing is that when JPA is usued, usually entities are managed beans, it's seldom a good idea to expose them to web layer directly.