protected HibernateConfigurationBinding(String tagName) {
super(tagName);
}
public Object parse(Element element, Parse parse, Parser parser) {
HibernateConfigurationDescriptor descriptor = new HibernateConfigurationDescriptor();
String configurationClassName = null;
if ( element.hasAttribute("annotations")
&& element.getAttribute("annotations").equalsIgnoreCase("enabled")
) {
// don't replace the string with the reflective classname as that will
// introduce a hard dependency on the hibernate annotations library
configurationClassName = "org.hibernate.cfg.AnnotationConfiguration";
} else {
configurationClassName = Configuration.class.getName();
}
descriptor.setClassName(configurationClassName);
parseConfiguration(element, parse, descriptor, parser);
return descriptor;
}