I have an entity class which is persisted to a database via JPA and I have a Utility class which does the persisting and reading for me.
Now I’m asking myself if that is really the way to go. Wouldn’t it be clearer, if the data class would have methods for reading and writing to the database?
Yes. You need to look at DAO pattern
The standard practice should consist following layers:
Model – Holds your POJO , simply mapped classes
DAO – Interface driven classes which provides CRUD for these POJO’s
Service – Use DAO to interact with DB and perform business stuff here