* @author Tom Baeyens
*/
public class HibernateSessionBinding implements Binding {
public Object parse(Element element, Parse parse, Parser parser) {
HibernateSessionDescriptor descriptor = new HibernateSessionDescriptor();
if (element.hasAttribute("factory")) {
descriptor.setFactoryName(element.getAttribute("factory"));
}
String txText = XmlUtil.attribute(element, "tx");
Boolean tx = XmlUtil.booleanEquals(txText, null);
if (tx!=null) {
descriptor.setTx(tx);
}
if (element.hasAttribute("standard-transaction")) {
descriptor.setStandardTransactionName(element.getAttribute("standard-transaction"));
}
if (element.hasAttribute("connection")) {
descriptor.setConnectionName(element.getAttribute("connection"));
}
return descriptor;
}