static private HashSet<GroupSymbol> findKeyPreserved(Set<GroupSymbol> keyPreservingGroups, Set<GroupSymbol> pk, HashMap<List<GroupSymbol>, List<HashSet<Object>>> crits, boolean left, QueryMetadataInterface metadata, Set<GroupSymbol> otherGroups) throws TeiidComponentException, QueryMetadataException { HashSet<GroupSymbol> result = new HashSet<GroupSymbol>(); for (GroupSymbol gs : pk) { for (Map.Entry<List<GroupSymbol>, List<HashSet<Object>>> entry : crits.entrySet()) { if (!entry.getKey().get(left?0:1).equals(gs) || !otherGroups.contains(entry.getKey().get(left?1:0))) { continue; } if (RuleRaiseAccess.matchesForeignKey(metadata, entry.getValue().get(left?0:1), entry.getValue().get(left?1:0), gs, false, true)) { keyPreservingGroups.add(gs); result.add(entry.getKey().get(left?1:0)); } } } return result; }
static private HashSet<GroupSymbol> findKeyPreserved(Set<GroupSymbol> keyPreservingGroups, Set<GroupSymbol> pk, HashMap<List<GroupSymbol>, List<HashSet<Object>>> crits, boolean left, QueryMetadataInterface metadata, Set<GroupSymbol> otherGroups) throws TeiidComponentException, QueryMetadataException { HashSet<GroupSymbol> result = new HashSet<GroupSymbol>(); for (GroupSymbol gs : pk) { for (Map.Entry<List<GroupSymbol>, List<HashSet<Object>>> entry : crits.entrySet()) { if (!entry.getKey().get(left?0:1).equals(gs) || !otherGroups.contains(entry.getKey().get(left?1:0))) { continue; } if (RuleRaiseAccess.matchesForeignKey(metadata, entry.getValue().get(left?0:1), entry.getValue().get(left?1:0), gs, false, true)) { keyPreservingGroups.add(gs); result.add(entry.getKey().get(left?1:0)); } } } return result; }
static private HashSet<GroupSymbol> findKeyPreserved(Set<GroupSymbol> keyPreservingGroups, Set<GroupSymbol> pk, HashMap<List<GroupSymbol>, List<HashSet<Object>>> crits, boolean left, QueryMetadataInterface metadata, Set<GroupSymbol> otherGroups) throws TeiidComponentException, QueryMetadataException { HashSet<GroupSymbol> result = new HashSet<GroupSymbol>(); for (GroupSymbol gs : pk) { for (Map.Entry<List<GroupSymbol>, List<HashSet<Object>>> entry : crits.entrySet()) { if (!entry.getKey().get(left?0:1).equals(gs) || !otherGroups.contains(entry.getKey().get(left?1:0))) { continue; } if (RuleRaiseAccess.matchesForeignKey(metadata, entry.getValue().get(left?0:1), entry.getValue().get(left?1:0), gs, false, true)) { keyPreservingGroups.add(gs); result.add(entry.getKey().get(left?1:0)); } } } return result; }
public boolean equals(Object obj) { // Quick same object test if(this == obj) { return true; } // Quick fail tests if(!(obj instanceof StoredProcedure)) { return false; } StoredProcedure other = (StoredProcedure)obj; return sameOptionAndHint(other) && this.getGroup().equals(other.getGroup()) && this.mapOfParameters.equals(other.mapOfParameters) && this.pushedInQuery == other.pushedInQuery; }
public boolean equals(Object obj) { // Quick same object test if(this == obj) { return true; } // Quick fail tests if(!(obj instanceof StoredProcedure)) { return false; } StoredProcedure other = (StoredProcedure)obj; return sameOptionAndHint(other) && this.getGroup().equals(other.getGroup()) && this.mapOfParameters.equals(other.mapOfParameters) && this.pushedInQuery == other.pushedInQuery; }
public boolean equals(Object obj) { // Quick same object test if(this == obj) { return true; } // Quick fail tests if(!(obj instanceof StoredProcedure)) { return false; } StoredProcedure other = (StoredProcedure)obj; return sameOptionAndHint(other) && this.getGroup().equals(other.getGroup()) && this.mapOfParameters.equals(other.mapOfParameters) && this.pushedInQuery == other.pushedInQuery; }
@Override public boolean equals(Object obj) { if (this.groupSymbol == null) { return super.equals(obj); } if (obj == this) { return true; } if (!(obj instanceof ElementSymbol)) { return false; } ElementSymbol other = (ElementSymbol)obj; if (other.groupSymbol == null) { return super.equals(obj); } return this.groupSymbol.equals(other.groupSymbol) && this.getShortName().equals(other.getShortName()); }
@Override public boolean equals(Object obj) { if (this.groupSymbol == null) { return super.equals(obj); } if (obj == this) { return true; } if (!(obj instanceof ElementSymbol)) { return false; } ElementSymbol other = (ElementSymbol)obj; if (other.groupSymbol == null) { return super.equals(obj); } return this.groupSymbol.equals(other.groupSymbol) && this.getShortName().equals(other.getShortName()); }
@Override public boolean equals(Object obj) { if (this.groupSymbol == null) { return super.equals(obj); } if (obj == this) { return true; } if (!(obj instanceof ElementSymbol)) { return false; } ElementSymbol other = (ElementSymbol)obj; if (other.groupSymbol == null) { return super.equals(obj); } return this.groupSymbol.equals(other.groupSymbol) && this.getShortName().equals(other.getShortName()); }
public void visit(GroupSymbol obj) { if (obj.equals(clone) && obj.getMetadataID() == group.getMetadataID()) { obj.setName(obj.getDefinition()); obj.setDefinition(null); } } });
public void visit(GroupSymbol obj) { if (obj.equals(clone) && obj.getMetadataID() == group.getMetadataID()) { obj.setName(obj.getDefinition()); obj.setDefinition(null); } } });
public void visit(GroupSymbol obj) { if (obj.equals(clone) && obj.getMetadataID() == group.getMetadataID()) { obj.setName(obj.getDefinition()); obj.setDefinition(null); } } });
private GroupSymbol getQueryGroup(Query query) throws TeiidComponentException { GroupSymbol group; From from = query.getFrom(); List groups = from.getGroups(); if(groups.size() != 1) { throw new TeiidComponentException("Cannot build fake tuple source for command: " + query); //$NON-NLS-1$ } group = (GroupSymbol) groups.get(0); Iterator projSymbols = query.getSelect().getProjectedSymbols().iterator(); while (projSymbols.hasNext()) { Object symbol = projSymbols.next(); if (symbol instanceof ElementSymbol){ ElementSymbol elementSymbol = (ElementSymbol)symbol; GroupSymbol g = elementSymbol.getGroupSymbol(); if (!g.equals(group)){ throw new TeiidComponentException("Illegal symbol " + elementSymbol + " in SELECT of command: " + query); //$NON-NLS-1$ //$NON-NLS-2$ } if (elementSymbol.getMetadataID() == null){ throw new TeiidComponentException("Illegal null metadata ID in ElementSymbol " + elementSymbol + " in SELECT of command: " + query); //$NON-NLS-1$ //$NON-NLS-2$ } else if (elementSymbol.getMetadataID() instanceof TempMetadataID){ throw new TeiidComponentException("Illegal TempMetadataID in ElementSymbol " + elementSymbol + " in SELECT of command: " + query); //$NON-NLS-1$ //$NON-NLS-2$ } } } return group; }
if (!updatable) { this.updateInfo.deleteTarget = info; } else if (!info.getGroup().equals(this.updateInfo.deleteTarget.getGroup())){
if (!updatable) { this.updateInfo.deleteTarget = info; } else if (!info.getGroup().equals(this.updateInfo.deleteTarget.getGroup())){
if (!updatable) { this.updateInfo.deleteTarget = info; } else if (!info.getGroup().equals(this.updateInfo.deleteTarget.getGroup())){
if (virtualGroup.equals(elementSymbol.getGroupSymbol())) { unrelated = true;
if (virtualGroup.equals(elementSymbol.getGroupSymbol())) { unrelated = true;
if (virtualGroup.equals(elementSymbol.getGroupSymbol())) { unrelated = true;
@Test public void testClone5() { ElementSymbol e1 = sampleElement1(); ElementSymbol copy = e1.clone(); helpEquals(e1, copy, true); // Change original, clone shouldn't change String originalName = e1.getName(); assertTrue("Cloned value changed but should not have: ", copy.getName().equals(originalName)); //$NON-NLS-1$ GroupSymbol originalGroup = e1.getGroupSymbol(); e1.setGroupSymbol(new GroupSymbol("b")); //$NON-NLS-1$ assertTrue("Cloned value changed but should not have: ", copy.getGroupSymbol().equals(originalGroup)); //$NON-NLS-1$ boolean fullyQualified = e1.getDisplayFullyQualified(); e1.setDisplayFullyQualified(!fullyQualified); assertTrue("Cloned value changed but should not have: ", copy.getDisplayFullyQualified() == fullyQualified); //$NON-NLS-1$ }