At first my app was going to access a MySQL database, but everything changed and now it must read from a XML file, it will only read from it.
The basic idea is:
1. Admin App persist to MySQL.
2. Admin App generates a MySQL xml dump (mysqldump tool).
3. App send the xml to client.
4. Client query the xml.
Maybe there are more clever ways to architecture this, but right now this is not the point.
Is there any Hibernate like XML – Relational to do this, how could I achieve this?
Ended using XStream to create my xml(instead of using the MySQL dump) and also to deserialize it. Worked like a charm.
The steps I followed.
Created a Bean to serve as my root node, this bean hold lists of all the other beans.
Did an xstream.toXML(myRootBean) and write it to a xml file.
At the other end, read the file and did an xstream.fromXML() casting it to myRootBean.
Then just access the lists, like myRootBean.getPotatoList()
Important to notice that you must set the alias for each class before toXML and fromXML.
xstream.alias(“potatos”, List.class);
xstream.alias(“potato”, Potato.class);