/* (non-Javadoc)
* @see org.hibernate.tool.hbm2x.ant.ConfigurationTask#doConfiguration(org.hibernate.cfg.Configuration)
*/
protected void doConfiguration(Configuration configuration) {
JDBCMetaDataConfiguration jmdc = (JDBCMetaDataConfiguration) configuration;
super.doConfiguration(jmdc);
jmdc.setPreferBasicCompositeIds(preferBasicCompositeIds);
DefaultReverseEngineeringStrategy defaultStrategy = new DefaultReverseEngineeringStrategy();
ReverseEngineeringStrategy strategy = defaultStrategy;
if(revengFiles!=null) {
OverrideRepository or = new OverrideRepository();
String[] fileNames = revengFiles.list();
for (int i = 0; i < fileNames.length; i++) {
or.addFile(new File(fileNames[i]) );
}
strategy = or.getReverseEngineeringStrategy(defaultStrategy);
}
if(reverseEngineeringStrategyClass!=null) {
strategy = loadreverseEngineeringStrategy(reverseEngineeringStrategyClass, strategy);
}
ReverseEngineeringSettings qqsettings =
new ReverseEngineeringSettings(strategy).setDefaultPackageName(packageName)
.setDetectManyToMany( detectManyToMany )
.setDetectOneToOne( detectOneToOne )
.setDetectOptimisticLock( detectOptimisticLock );
defaultStrategy.setSettings(qqsettings);
strategy.setSettings(qqsettings);
jmdc.setReverseEngineeringStrategy(strategy);
jmdc.readFromJDBC();
}