Package ch.epfl.lbd.applications.trdw.dimensions

Source Code of ch.epfl.lbd.applications.trdw.dimensions.SpaceDimension

package ch.epfl.lbd.applications.trdw.dimensions;

import ch.epfl.lbd.database.objects.RelationalTable;
import ch.epfl.lbd.database.olap.Hierarchy;
import ch.epfl.lbd.database.olap.Level;
import ch.epfl.lbd.database.olap.LevelProperty;
import ch.epfl.lbd.database.providers.mondrian.olap.MondrianDimension;
import ch.epfl.lbd.database.providers.mondrian.olap.MondrianHierarchy;
import ch.epfl.lbd.database.providers.mondrian.olap.MondrianLevel;
import ch.epfl.lbd.database.providers.mondrian.olap.MondrianLevelProperty;

public class SpaceDimension extends MondrianDimension {
 
  public static final long serialVersionUID = 0x98344342;
 
  public SpaceDimension(RelationalTable table){
    super("Space",null);
    Level environmentLvl = new MondrianLevel("Environment",table,"environment_name");
    LevelProperty envNameProp = new MondrianLevelProperty"Environment Name",
                                LevelProperty.TYPE_STRING,
                                table,
                                "environment_name");
    environmentLvl.addProperty(envNameProp);
    LevelProperty envGeomProp = new MondrianLevelProperty"geom",
                                LevelProperty.TYPE_GEOMETRY,
                                table,
                                "environment_geom");
    environmentLvl.addProperty(envGeomProp);
   
    Level regionLvl = new MondrianLevel("Region",table,"region_name");
    LevelProperty regNameProp = new MondrianLevelProperty"Region Name",
                                LevelProperty.TYPE_STRING,
                                table,
                                "region_name");
    regionLvl.addProperty(regNameProp);
    LevelProperty regGeomProp = new MondrianLevelProperty"geom",
                                LevelProperty.TYPE_GEOMETRY,
                                table,
                                "region_geom");
    regionLvl.addProperty(regGeomProp);
   
    Level areaLvl = new MondrianLevel("Area",table,"area_name");
    LevelProperty areaNameProp = new MondrianLevelProperty"Area Name",
                                LevelProperty.TYPE_STRING,
                                table,
                                "area_name");
    areaLvl.addProperty(areaNameProp);
    LevelProperty areaGeomProp = new MondrianLevelProperty"geom",
                                LevelProperty.TYPE_GEOMETRY,
                                table,
                                "area_geom");
    areaLvl.addProperty(areaGeomProp);
   
    Hierarchy spaceHier = new MondrianHierarchy("spaceHier",table);
   
    spaceHier.addLevel(environmentLvl);
    spaceHier.addLevel(regionLvl);
    spaceHier.addLevel(areaLvl);
   
    this.setHierarchy(spaceHier);
   
  }
}
TOP

Related Classes of ch.epfl.lbd.applications.trdw.dimensions.SpaceDimension

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.