String id = getId(context, element);
if (StringUtils.isEmpty(id)){
throw new ComponentDefinitionException("'id' attribute is missing for environment definition.");
}
MapMetadataImpl envParamMetadata = context.createMetadata(MapMetadataImpl.class);
envParamMetadata.setKeyType(String.class.getName());
envParamMetadata.setValueType(Object.class.getName());
checkAndSetReference(context, element, envParamMetadata, ELEMENT_ENTITY_MANAGER_FACTORY, EnvironmentName.ENTITY_MANAGER_FACTORY, ATTRIBUTE_REF);
checkAndSetReference(context, element, envParamMetadata, ELEMENT_TRANSACTION_MANAGER, EnvironmentName.TRANSACTION_MANAGER, ATTRIBUTE_REF);
checkAndSetReference(context, element, envParamMetadata, ELEMENT_GLOBALS, EnvironmentName.GLOBALS, ATTRIBUTE_REF);
checkAndSetReference(context, element, envParamMetadata, ELEMENT_DATE_FORMATS, EnvironmentName.DATE_FORMATS, ATTRIBUTE_REF);