// Create the MdmHierarchyLevel and HierarchyLevelMap objects.
int i = 0;
for(Level level : levels){
MdmHierarchyLevel mdmHierLevel = null;
mdmHierLevel = mdmLevelHier.findOrCreateHierarchyLevel(mdmLevelHier.getPrimaryDimension().findOrCreateDimensionLevel(((OracleLevel)level).getUniqueID()));
//Set the MdmDimensionLevel for the MdmHierarchyLevel.
//mdmHierLevel.setDimensionLevel(dimLevelList.get(i));
HierarchyLevelMap hierLevelMap = mdmHierLevel.findOrCreateHierarchyLevelMap();
ColumnExpression keyColExp = (ColumnExpression)SyntaxObject.fromSyntax(level.getTableColumnId(),metadataProvider);
hierLevelMap.setKeyExpression(keyColExp);
hierLevelMap.setQuery(keyColExp.getQuery());
i++;