Working with XML data

30 August 2008

Hibernate allows us to work with persistent XML data same as POJOs. A parsed XML tree is actually a representation of relational data at the object level, instead of POJOs.

Hibernate uses dom4j API for manipulating XML trees. We can write queries that retrieve dom4j trees from the database and then all modifications to the tree automatically are synchronized to the database.

One can take an XML document, parse it using dom4j, and write it to the database with any of Hibernate’s basic operations: persist(), saveOrUpdate(), merge(), delete(), replicate().

There are many applications of this feature like data import/export, externalization of entity data via JMS or SOAP and XSLT-based reporting. A single mapping can be used to map properties of a class and nodes of an XML document to the database. But if there is no class to map, it will be used to map just the XML.

del.icio.us:Working with XML data  digg:Working with XML data  spurl:Working with XML data  wists:Working with XML data  simpy:Working with XML data  newsvine:Working with XML data  blinklist:Working with XML data  furl:Working with XML data  reddit:Working with XML data  fark:Working with XML data  blogmarks:Working with XML data  Y!:Working with XML data  smarking:Working with XML data  magnolia:Working with XML data  segnalo:Working with XML data  gifttagging:Working with XML data

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Working with XML data

Leave a Reply