Is it possible to define JPA mappings with annotations only and then programmatically save the mapping data to some orm.xml file?
There is a discussion in the team about whether to use annotations or XML, and I want to check if we can start with annotations simply by going to a later point without manually overwriting all the XML files.
There is a function request in the Eclipse Dali project ( bug 138622 ), but we do not support this. In the Juno release, we added support for converting global metadata (named queries, generators) from annotations to xml ( error 353149 ). As far as I know, there is no tool to convert all JPA annotation metadata to an orm.xml file.
Not sure if there is a tool.
At run time, if you use EclipseLink, you can use XMLEntityMappingsWriter to write JPA metadata to XML. This is an internal API, but it works.
Source: https://habr.com/ru/post/1442282/More articles:The difference between these two conditions? - javaFile upload to struts2 - javaModify the CSS file programmatically using C # - c #Forced adaptive grid Bootstrap does not collapse in phone mode - htmlJava returned type - javaPrevent an authorized user from editing data that does not belong to him - databaseAutoMapper Object Mapping - List Display - automapperCode Separation / Printing Format - Official Mentioned - javaHow to check if an input contains a valid .Net regular expression? - c #How can I open a drop-down list on the first touch, follow the link on the second - jQuery? - jqueryAll Articles