public XJoinEdges withEdge(XJoinEdge... values) { if (values!= null) { for (XJoinEdge value: values) { getEdge().add(value); } } return this; }
public XJoinEdges withEdge(XJoinEdge... values) { if (values!= null) { for (XJoinEdge value: values) { getEdge().add(value); } } return this; }
public XJoinEdges withEdge(Collection<XJoinEdge> values) { if (values!= null) { getEdge().addAll(values); } return this; }
public XJoinEdges withEdge(Collection<XJoinEdge> values) { if (values!= null) { getEdge().addAll(values); } return this; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { List<XJoinEdge> theEdge; theEdge = (((this.edge!= null)&&(!this.edge.isEmpty()))?this.getEdge():null); strategy.appendField(locator, this, "edge", buffer, theEdge); } return buffer; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { List<XJoinEdge> theEdge; theEdge = (((this.edge!= null)&&(!this.edge.isEmpty()))?this.getEdge():null); strategy.appendField(locator, this, "edge", buffer, theEdge); } return buffer; }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List<XJoinEdge> theEdge; theEdge = (((this.edge!= null)&&(!this.edge.isEmpty()))?this.getEdge():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "edge", theEdge), currentHashCode, theEdge); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List<XJoinEdge> theEdge; theEdge = (((this.edge!= null)&&(!this.edge.isEmpty()))?this.getEdge():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "edge", theEdge), currentHashCode, theEdge); } return currentHashCode; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof XJoinEdges)) { return false; } if (this == object) { return true; } final XJoinEdges that = ((XJoinEdges) object); { List<XJoinEdge> lhsEdge; lhsEdge = (((this.edge!= null)&&(!this.edge.isEmpty()))?this.getEdge():null); List<XJoinEdge> rhsEdge; rhsEdge = (((that.edge!= null)&&(!that.edge.isEmpty()))?that.getEdge():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "edge", lhsEdge), LocatorUtils.property(thatLocator, "edge", rhsEdge), lhsEdge, rhsEdge)) { return false; } } return true; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof XJoinEdges)) { return false; } if (this == object) { return true; } final XJoinEdges that = ((XJoinEdges) object); { List<XJoinEdge> lhsEdge; lhsEdge = (((this.edge!= null)&&(!this.edge.isEmpty()))?this.getEdge():null); List<XJoinEdge> rhsEdge; rhsEdge = (((that.edge!= null)&&(!that.edge.isEmpty()))?that.getEdge():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "edge", lhsEdge), LocatorUtils.property(thatLocator, "edge", rhsEdge), lhsEdge, rhsEdge)) { return false; } } return true; }
/** * 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; }
/** * 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 static XJoinPath xJoinPathFromJoinPath(JoinChain.Path path) { XJoinPath xjp = XCF.createXJoinPath(); xjp.setEdges(new XJoinEdges()); for (JoinChain.Edge edge : path.getLinks()) { XJoinEdge xje = XCF.createXJoinEdge(); xje.setFrom(xTabReferenceFromTabReference(edge.getFrom())); xje.setTo(xTabReferenceFromTabReference(edge.getTo())); xjp.getEdges().getEdge().add(xje); } return xjp; }
public static XJoinPath xJoinPathFromJoinPath(JoinChain.Path path) { XJoinPath xjp = XCF.createXJoinPath(); xjp.setEdges(new XJoinEdges()); for (JoinChain.Edge edge : path.getLinks()) { XJoinEdge xje = XCF.createXJoinEdge(); xje.setFrom(xTabReferenceFromTabReference(edge.getFrom())); xje.setTo(xTabReferenceFromTabReference(edge.getTo())); xjp.getEdges().getEdge().add(xje); } return xjp; }
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");
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()); }
edge1.setFrom(ref1); edge1.setTo(ref2); path.getEdges().getEdge().add(edge1); chain1.setName("testdetailchain"); chain1.getPaths().getPath().add(path); edge2.setFrom(ref3); edge2.setTo(ref4); path2.getEdges().getEdge().add(edge2); chain2.setName("testdimchain"); chain2.getPaths().getPath().add(path2);
edge1.setFrom(link1); edge1.setTo(link2); path1.getEdges().getEdge().add(edge1); xj1.getPaths().getPath().add(path1); dimension.getJoinChains().getJoinChain().add(xj1);
edge1.setFrom(link1); edge1.setTo(link2); path1.getEdges().getEdge().add(edge1); xj1.getPaths().getPath().add(path1); cube.getJoinChains().getJoinChain().add(xj1); XJoinPath path = cubeObjectFactory.createXJoinPath(); path.setEdges(new XJoinEdges()); path.getEdges().getEdge().add(edge1); XJoinEdge edge2 = cubeObjectFactory.createXJoinEdge(); XTableReference link3 = new XTableReference(); edge2.setFrom(link3); edge2.setTo(link4); path.getEdges().getEdge().add(edge2); xj2.getPaths().getPath().add(path); cube.getJoinChains().getJoinChain().add(xj2);