I am developing a java web application with Hibernate for database connectivity, before this application I was using Hibernate 4.3.x and uses the following code for automatic creation of database tables
public class TableCreator {
public static void main(String[] args) {
try {
Configuration cfg = new Configuration();
cfg.addAnnotatedClass(AdminMaster.class);
cfg.addAnnotatedClass(CorporateMaster.class);
cfg.addAnnotatedClass(Customer.class);
cfg.addAnnotatedClass(LoginMaster.class);
cfg.addAnnotatedClass(Notifications.class);
cfg.configure();
SchemaExport se = new SchemaExport(cfg);
se.create(true, true);
System.out.println("Table Created!!!");
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
Now when I try to use the same code with Hibernate 5.2 following lines are shown in red in Netbeans
SchemaExport se = new SchemaExport(cfg);
se.create(true, true);
and the error shown is :
Schemaexport Class in Schemaexport cannot be applied to given types;
required : no arguments
found :configuration
I totally don't know what to do now, please help me guys..