Persist third party classes to database



We are using DFP API in our project. Since this is a third party library, we don’t have access to its classes. In turn we cannot annotate those classes with @Entity for persistence.

Correct me if I’m wrong, we have to use XML mapping such as orm.xml in such situations right?
But, some times the objects are so big that its very time consuming to map each variable and the object (Please refer the previous link).

In such situations, how can I configure XML to consider all fields in that class for mapping or do I need to map each fields?

Thank you.

How to request Hibernate organisation for more documentation on JPA XML mapping

If the entity property name matches the database column name, you don’t need to provide an explicit mapping.

You need to provide that Date/Time/Timestamp, version, identifier columns and associations as well.