@Override public XJoinChain withName(String value) { setName(value); return this; }
public XJoinChain withPaths(XJoinPaths value) { setPaths(value); return this; }
/** * Create an instance of {@link XJoinChain } * */ public XJoinChain createXJoinChain() { return new XJoinChain(); }
/** * Create XJoinChain from cube join chain */ public static XJoinChain getXJoinChainFromJoinChain(JoinChain jc) { XJoinChain xjc = XCF.createXJoinChain(); xjc.setName(jc.getName()); xjc.setDescription(jc.getDescription()); xjc.setDisplayString(jc.getDisplayString()); xjc.setDestTable(jc.getDestTable()); xjc.setPaths(new XJoinPaths()); for (JoinChain.Path path : jc.getPaths()) { xjc.getPaths().getPath().add(xJoinPathFromJoinPath(path)); } return xjc; }
xd5.getValues().add("3"); XJoinChain xj1 = new XJoinChain(); xj1.setName("chain1"); xj1.setDescription("first chain"); xj1.setDisplayString("Chain-1"); xj1.setPaths(new XJoinPaths()); XJoinPath path1 = cubeObjectFactory.createXJoinPath(); path1.setEdges(new XJoinEdges()); edge1.setTo(link2); path1.getEdges().getEdge().add(edge1); xj1.getPaths().getPath().add(path1); dimension.getJoinChains().getJoinChain().add(xj1); dimension.getAttributes().getDimAttribute().add(xd3);
private void testJoinChains(LensDimensionCommands command) { XJoinChains chains = new XJoinChains(); XJoinChain chain1 = new XJoinChain(); chain1.setPaths(new XJoinPaths()); XJoinPath path = new XJoinPath(); path.setEdges(new XJoinEdges()); XJoinEdge edge1 = new XJoinEdge(); XTableReference ref1 = new XTableReference(); ref1.setTable("test_dim"); ref1.setColumn("d2id"); XTableReference ref2 = new XTableReference(); ref2.setTable("test_detail"); ref2.setColumn("id"); edge1.setFrom(ref1); edge1.setTo(ref2); path.getEdges().getEdge().add(edge1); chain1.setName("dim2chain"); chain1.getPaths().getPath().add(path); chain1.setDestTable("test_detail"); chains.getJoinChain().add(chain1); assertEquals(command.showJoinChains("test_dim"), new XJoinChainTable(chains).toString()); }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { super.appendFields(locator, buffer, strategy); { XJoinPaths thePaths; thePaths = this.getPaths(); strategy.appendField(locator, this, "paths", buffer, thePaths); } { String theDestTable; theDestTable = this.getDestTable(); strategy.appendField(locator, this, "destTable", buffer, theDestTable); } return buffer; }
/** * Create cube's JoinChain from JAXB counterpart * * @param xj * @return {@link JoinChain} */ public static JoinChain joinChainFromXJoinChain(XJoinChain xj) { JoinChain jc = new JoinChain(xj.getName(), xj.getDisplayString(), xj.getDescription()); for (int i = 0; i < xj.getPaths().getPath().size(); i++) { XJoinPath xchain = xj.getPaths().getPath().get(i); List<TableReference> chain = new ArrayList<TableReference>(xchain.getEdges().getEdge().size() * 2); for (XJoinEdge xRef : xchain.getEdges().getEdge()) { chain.add(new TableReference(xRef.getFrom().getTable(), xRef.getFrom().getColumn(), xRef.getFrom().isMapsToMany())); chain.add(new TableReference(xRef.getTo().getTable(), xRef.getTo().getColumn(), xRef.getTo().isMapsToMany())); } jc.addPath(chain); } return jc; }
assertEquals(testDim.getExpressions().getExpression().size(), 1); assertEquals(testDim.getJoinChains().getJoinChain().size(), 1); assertEquals(testDim.getJoinChains().getJoinChain().get(0).getPaths().getPath().size(), 1); assertEquals( testDim.getJoinChains().getJoinChain().get(0).getPaths().getPath().get(0).getEdges().getEdge().size(), 1); assertEquals(testDim.getJoinChains().getJoinChain().get(0).getDescription(), "first chain"); assertEquals(testDim.getJoinChains().getJoinChain().get(0).getDisplayString(), "Chain-1");
Map<String, XJoinChain> chains = new HashMap<>(); for (XJoinChain xjc : actual.getJoinChains().getJoinChain()) { chains.put(xjc.getName(), xjc); assertEquals(chains.get("chain1").getDestTable(), "testdim"); assertEquals(chains.get("dim2chain").getDestTable(), "testdim2"); boolean chainValidated = false; for (XDimAttribute attr : actual.getDimAttributes().getDimAttribute()) {
public XJoinChain withDestTable(String value) { setDestTable(value); return this; }
@Override public XJoinChain withDisplayString(String value) { setDisplayString(value); return this; }
@Override public XJoinChain withDescription(String value) { setDescription(value); return this; }
/** * Create XJoinChain from cube join chain */ public static XJoinChain getXJoinChainFromJoinChain(JoinChain jc) { XJoinChain xjc = XCF.createXJoinChain(); xjc.setName(jc.getName()); xjc.setDescription(jc.getDescription()); xjc.setDisplayString(jc.getDisplayString()); xjc.setDestTable(jc.getDestTable()); xjc.setPaths(new XJoinPaths()); for (JoinChain.Path path : jc.getPaths()) { xjc.getPaths().getPath().add(xJoinPathFromJoinPath(path)); } return xjc; }
cube.getMeasures().getMeasure().add(xm2); XJoinChain xj1 = new XJoinChain(); xj1.setName("chain1"); xj1.setDescription("first chain"); xj1.setDisplayString("Chain-1"); xj1.setPaths(new XJoinPaths()); XJoinPath path1 = cubeObjectFactory.createXJoinPath(); path1.setEdges(new XJoinEdges()); edge1.setTo(link2); path1.getEdges().getEdge().add(edge1); xj1.getPaths().getPath().add(path1); cube.getJoinChains().getJoinChain().add(xj1); XJoinChain xj2 = new XJoinChain(); xj2.setName("dim2chain"); xj2.setDescription("testdim2 chain"); xj2.setDisplayString("Chain-2"); xj2.setPaths(new XJoinPaths()); XJoinPath path = cubeObjectFactory.createXJoinPath(); path.setEdges(new XJoinEdges()); edge2.setTo(link4); path.getEdges().getEdge().add(edge2); xj2.getPaths().getPath().add(path); cube.getJoinChains().getJoinChain().add(xj2);
private void testJoinChains(LensCubeCommands command) { String joinChains = command.showJoinChains("sample_cube"); XJoinChains chains = new XJoinChains(); XJoinChain chain1 = new XJoinChain(); chain1.setPaths(new XJoinPaths()); XJoinPath path = new XJoinPath(); path.setEdges(new XJoinEdges()); edge1.setTo(ref2); path.getEdges().getEdge().add(edge1); chain1.setName("testdetailchain"); chain1.getPaths().getPath().add(path); chain1.setDestTable("test_detail"); XJoinChain chain2 = new XJoinChain(); chain2.setPaths(new XJoinPaths()); XJoinPath path2 = new XJoinPath(); path2.setEdges(new XJoinEdges()); edge2.setTo(ref4); path2.getEdges().getEdge().add(edge2); chain2.setName("testdimchain"); chain2.getPaths().getPath().add(path2); chain2.setDestTable("test_dim"); chains.getJoinChain().add(chain2); chains.getJoinChain().add(chain1);
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { super.appendFields(locator, buffer, strategy); { XJoinPaths thePaths; thePaths = this.getPaths(); strategy.appendField(locator, this, "paths", buffer, thePaths); } { String theDestTable; theDestTable = this.getDestTable(); strategy.appendField(locator, this, "destTable", buffer, theDestTable); } return buffer; }
/** * Create cube's JoinChain from JAXB counterpart * * @param xj * @return {@link JoinChain} */ public static JoinChain joinChainFromXJoinChain(XJoinChain xj) { JoinChain jc = new JoinChain(xj.getName(), xj.getDisplayString(), xj.getDescription()); for (int i = 0; i < xj.getPaths().getPath().size(); i++) { XJoinPath xchain = xj.getPaths().getPath().get(i); List<TableReference> chain = new ArrayList<TableReference>(xchain.getEdges().getEdge().size() * 2); for (XJoinEdge xRef : xchain.getEdges().getEdge()) { chain.add(new TableReference(xRef.getFrom().getTable(), xRef.getFrom().getColumn(), xRef.getFrom().isMapsToMany())); chain.add(new TableReference(xRef.getTo().getTable(), xRef.getTo().getColumn(), xRef.getTo().isMapsToMany())); } jc.addPath(chain); } return jc; }
public XJoinChain withDestTable(String value) { setDestTable(value); return this; }
@Override public XJoinChain withDisplayString(String value) { setDisplayString(value); return this; }