I got the solution using HibernateConfigurationExporter which is packed in the Hinbernate Tools 3.2 Beta 9. However, the exported file is lacked of information of Session Factory. What's wrong with it?
Here's my code:
Code:
Configuration config = OXMappingManager.getConfiguration();
HibernateConfigurationExporter exporter = new HibernateConfigurationExporter();
FileWriter writer = new FileWriter(new File("config-exported.xml"));
exporter.setConfiguration(config);
exporter.setOutput(writer);
exporter.start();
writer.close();
The result:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
</session-factory>
</hibernate-configuration>