If there is already an existing database , then we could use some reverse engineering tool to automatically generate java persistence entity classes.
You may find below 2 ways from internet :
1. hibernate*-maven-plugin
2. IDE based reverse engine tools
This post would show you how to do it programmatically.