Persisting 3rd party objects with JPA
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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? 回答1: Check this and this . In short: Create META-INF/orm.xml Follow (read) the .xsd You 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: <?xml version="1.0" encoding="UTF-8" ?> <entity-mappings xmlns="http:/