public HibernateSessionFactoryBinding() {
super("hibernate-session-factory");
}
public Object parse(Element element, Parse parse, Parser parser) {
HibernateSessionFactoryDescriptor descriptor = new HibernateSessionFactoryDescriptor();
if (element.hasAttribute("configuration")) {
descriptor.setConfigurationName(element.getAttribute("configuration"));
// if hibernate session factory binding has sub elements, we assume that
// it is an inline configuration declaration
} else if (!XmlUtil.elements(element).isEmpty()) {
Descriptor configurationDescriptor = (Descriptor) super.parse(element, parse, parser);
descriptor.setConfigurationDescriptor(configurationDescriptor);
}
return descriptor;
}