I am looking for a solution to save a XML-File in a database using Hibernate.
The problem is, that the structure of the XML-file is different to the Hibernate-beans.
I'm trying to use JAXB to serialize the XML-content to the Hibernate beans.
Please imagine the following scenario: There is this xml file:
<root>
<general>
<property1/>
<property2/>
</general>
<details>
<detail1>
<detail2>
</root>
Now I want to save property1 and detail1 in one bean:
@Entity
@Table(name = "tablename")
class Bean(){
public String property;
public String detail;
//+ getters and setters ...
}
Has anyone an idea, which JAXB annotations I could use to solve that problem?