public static Dimension dimensionFromXDimension(XDimension dimension) throws LensException { Set<CubeDimAttribute> dims = new LinkedHashSet<CubeDimAttribute>(); for (XDimAttribute xd : dimension.getAttributes().getDimAttribute()) { dims.add(hiveDimAttrFromXDimAttr(xd)); } Set<ExprColumn> expressions = new LinkedHashSet<ExprColumn>(); if (dimension.getExpressions() != null && !dimension.getExpressions().getExpression().isEmpty()) { for (XExprColumn xe : dimension.getExpressions().getExpression()) { expressions.add(hiveExprColumnFromXExprColumn(xe)); } } Set<JoinChain> joinchains = new LinkedHashSet<JoinChain>(); if (dimension.getJoinChains() != null && !dimension.getJoinChains().getJoinChain().isEmpty()) { for (XJoinChain xj : dimension.getJoinChains().getJoinChain()) { joinchains.add(joinChainFromXJoinChain(xj)); } } Map<String, String> properties = mapFromXProperties(dimension.getProperties()); return new Dimension(dimension.getName(), dims, expressions, joinchains, properties, 0L); }
public static Dimension dimensionFromXDimension(XDimension dimension) throws LensException { Set<CubeDimAttribute> dims = new LinkedHashSet<CubeDimAttribute>(); for (XDimAttribute xd : dimension.getAttributes().getDimAttribute()) { dims.add(hiveDimAttrFromXDimAttr(xd)); } Set<ExprColumn> expressions = new LinkedHashSet<ExprColumn>(); if (dimension.getExpressions() != null && !dimension.getExpressions().getExpression().isEmpty()) { for (XExprColumn xe : dimension.getExpressions().getExpression()) { expressions.add(hiveExprColumnFromXExprColumn(xe)); } } Set<JoinChain> joinchains = new LinkedHashSet<JoinChain>(); if (dimension.getJoinChains() != null && !dimension.getJoinChains().getJoinChain().isEmpty()) { for (XJoinChain xj : dimension.getJoinChains().getJoinChain()) { joinchains.add(joinChainFromXJoinChain(xj)); } } Map<String, String> properties = mapFromXProperties(dimension.getProperties()); return new Dimension(dimension.getName(), dims, expressions, joinchains, properties, 0L); }
public static XDimension xdimensionFromDimension(Dimension dimension) { XDimension xd = XCF.createXDimension(); xd.setName(dimension.getName()); xd.setAttributes(new XDimAttributes()); xd.setExpressions(new XExpressions()); xd.setJoinChains(new XJoinChains()); xd.setProperties(new XProperties()); xd.getProperties().getProperty().addAll(xPropertiesFromMap(((AbstractCubeTable) dimension).getProperties())); for (CubeDimAttribute cd : dimension.getAttributes()) { xd.getAttributes().getDimAttribute().add(xDimAttrFromHiveDimAttr(cd, dimension)); } for (ExprColumn ec : dimension.getExpressions()) { xd.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec)); } for (JoinChain jc : dimension.getJoinChains()) { xd.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc)); } return xd; }
public static XDimension xdimensionFromDimension(Dimension dimension) { XDimension xd = XCF.createXDimension(); xd.setName(dimension.getName()); xd.setAttributes(new XDimAttributes()); xd.setExpressions(new XExpressions()); xd.setJoinChains(new XJoinChains()); xd.setProperties(new XProperties()); xd.getProperties().getProperty().addAll(xPropertiesFromMap(((AbstractCubeTable) dimension).getProperties())); for (CubeDimAttribute cd : dimension.getAttributes()) { xd.getAttributes().getDimAttribute().add(xDimAttrFromHiveDimAttr(cd, dimension)); } for (ExprColumn ec : dimension.getExpressions()) { xd.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec)); } for (JoinChain jc : dimension.getJoinChains()) { xd.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc)); } return xd; }
.get(XDimension.class); assertEquals(testDim.getName(), "testdim"); assertTrue(testDim.getProperties().getProperty().size() >= 1); assertTrue(JAXBUtils.mapFromXProperties(testDim.getProperties()).containsKey("dimension.foo")); assertEquals(JAXBUtils.mapFromXProperties(testDim.getProperties()).get("dimension.foo"), "dim.bar"); assertEquals(testDim.getAttributes().getDimAttribute().size(), 5); assertEquals(testDim.getExpressions().getExpression().size(), 1); prop.setName("dim.prop2.name"); prop.setValue("dim.prop2.value"); testDim.getProperties().getProperty().add(prop); XDimension.class); assertEquals(altered.getName(), "testdim"); assertTrue(altered.getProperties().getProperty().size() >= 2); assertTrue(JAXBUtils.mapFromXProperties(altered.getProperties()).containsKey("dim.prop2.name")); assertEquals(JAXBUtils.mapFromXProperties(altered.getProperties()).get("dim.prop2.name"), "dim.prop2.value"); assertTrue(JAXBUtils.mapFromXProperties(altered.getProperties()).containsKey("dimension.foo")); assertEquals(JAXBUtils.mapFromXProperties(altered.getProperties()).get("dimension.foo"), "dim.bar"); assertEquals(testDim.getAttributes().getDimAttribute().size(), 5);
theProperties = this.getProperties(); strategy.appendField(locator, this, "properties", buffer, theProperties);
theProperties = this.getProperties(); strategy.appendField(locator, this, "properties", buffer, theProperties);
xp1.setName("dimension.foo"); xp1.setValue("dim.bar"); dimension.getProperties().getProperty().add(xp1); return dimension;
lhsProperties = this.getProperties(); XProperties rhsProperties; rhsProperties = that.getProperties(); if (!strategy.equals(LocatorUtils.property(thisLocator, "properties", lhsProperties), LocatorUtils.property(thatLocator, "properties", rhsProperties), lhsProperties, rhsProperties)) { return false;
theProperties = this.getProperties(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "properties", theProperties), currentHashCode, theProperties);
theProperties = this.getProperties(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "properties", theProperties), currentHashCode, theProperties);
lhsProperties = this.getProperties(); XProperties rhsProperties; rhsProperties = that.getProperties(); if (!strategy.equals(LocatorUtils.property(thisLocator, "properties", lhsProperties), LocatorUtils.property(thatLocator, "properties", rhsProperties), lhsProperties, rhsProperties)) { return false;