* @author Tom Baeyens
*/
public class HibernateSessionFactoryBinding extends HibernateConfigurationBinding {
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)!=null) {
Descriptor configurationDescriptor = (Descriptor) super.parse(element, parse, parser);
descriptor.setConfigurationDescriptor(configurationDescriptor);
}
return descriptor;
}