if you need to get an id or print a toString contains all the fields of an object, use reflection entity on a entity class of JPA and be happy.