I am looking for a solution to save an XML file in a database using Hibernate.
The problem is that the structure of the XML file is different from Hibernate-beans.
I am trying to use JAXB to serialize XML content in Hibernate beans.
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;
}
Does anyone have an idea which JAXB annotations I could use to solve this problem?
Marcel
source
share