List<Property> units = deploymentValue.get("hibernate-persistence-unit").asPropertyList();
for(Property unit : units)
{
JPADeployment jpaDeployment = factory.jpaDeployment().as();
ModelNode unitValue = unit.getValue();
System.out.println(unitValue);
String tokenString = unit.getName();
String[] tokens = tokenString.split("#");
jpaDeployment.setDeploymentName(tokens[0]);
jpaDeployment.setPersistenceUnit(tokens[1]);
// https://issues.jboss.org/browse/AS7-5157
boolean enabled = unitValue.hasDefined("enabled") ? unitValue.get("enabled").asBoolean() : false;
jpaDeployment.setMetricEnabled(enabled);
jpaUnits.add(jpaDeployment);
}
}