configuration.getProperties().put(AvailableSettings.JTA_PLATFORM, JBossAppServerJtaPlatform.class);
configuration.setProperty(Environment.HBM2DDL_AUTO, "create-drop");
configuration.setProperty(Environment.DATASOURCE, "java:jboss/datasources/ExampleDS");
// fetch the properties
Properties properties = new Properties();
configuration = configuration.configure("hibernate.cfg.xml");
properties.putAll(configuration.getProperties());
Environment.verifyProperties(properties);
ConfigurationHelper.resolvePlaceHolders(properties);
// build the serviceregistry