I know nothing about mybats and I am not sure if my suggestion will go against your desire of going "without creating multiple entityclasses", but you might want to take a look on Spring Data JPA Projections.