I'm new to Hibernate... but it looks like when I use the DOM4J EntityMode to persist data from an XML Document into my database table, it never makes it into the POJO!
My mapping xml uses both the "node" attribute (for mapping to XML) and "name" attribute (for mapping to my POJO property). But neither the fields nor the getter/setters in my POJO are being used! The only thing the POJO seems to be used for is when the mapping is loaded, for Hibernate to obtain type info for my properties.
So to summarize: it looks like Hibernate is doing XML --> DB, rather than XML --> POJO --> DB.
I would like a way to access the data in POJO form before it is persisted to the DB, to perform data translations, formatting, etc. Is there a way to do this? Otherwise I will have to use another framework (like JiBX, JAXB, etc.) to convert my XML to POJOs so I can change the data, then use Hibernate to persist the POJOs.
|