In my current project I am using a 3rd party library which has no JPA annotations.
How can I persist objects from that library using JPA and external mappings?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check this and this. In short:
META-INF/orm.xml.xsdYou don’t have to manually map each column – only some specifics (i.e. collections and the id) are required. All fields are assumed to be columns (if the class is mapped). If there are no collections, something like this suffices:
Note that when specifying
<package>you don’t need fully-qualified names.In case you want a file named differently than
orm.xml, in yourpersistence.xmlspecify it via: