Now that I use EJB3.0 annotations embedded in my source codes, I do not have .hbm.xml files. How can I update database schema without providing .hbm.xml files?
In the past I was using Hibernate with .hbm.xml files generated by XDoclet. When I needed to update database schema, the following code worked fine since I listed mapping information i.e. .hbm.xml(s) in hibernate.cfg.xml.
Code:
public static void initialization()
{
System.out.println("initialization");
Configuration cfg = new Configuration();
cfg.configure("hibernate.cfg.xml");
SchemaUpdate schemaUpdate = new SchemaUpdate(cfg);
schemaUpdate.execute(true, true);
}
As I do not have .hbm.xml files any more (they were replaced with EJB3.0 annotations), this code does not work. Please help me understand how to update database schema without having hbm.xml files. I appreciate your help.