0

I am populating my hibernate bean in DAO layer with values based from my pojo from the controller and also adding some logic to it before saving hibernate object to the database. After saving, I want to use the same hibernate bean to also generate an XML with values populated. How can this be done?

  • 1
    can you provide code of your bean? – ivanenok Mar 18 '16 at 13:49
  • this URL will be helpful for you http://stackoverflow.com/questions/736343/what-is-the-best-way-to-convert-a-java-object-to-xml-with-open-source-apis – Ravi Mar 18 '16 at 15:40
  • Would you recommend this for regular pojo to xml or would it be okay to add annotations related to xml generation to the hibernate beans? I so have some java.sql.Blob datatypes in the hibernate beans as well. – roamingpink Mar 18 '16 at 17:38

1 Answers1

0

You will need to serialize your Java bean to XML. XStream is a very useful tool for such a case.

jeroen_de_schutter
  • 1,843
  • 1
  • 18
  • 21