@Override public Builder add(String key, ScalarValue value) { Preconditions.checkArgument(expectedType.getAttribute(key) != null); return super.add(key, value); } }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (getClass() != obj.getClass()) { return false; } final SubDocType other = (SubDocType) obj; if (other.hash != this.hash) { return false; } if (other.attributes.size() != this.attributes.size()) { return false; } for (SubDocAttribute thisAtt : this.attributes.values()) { SubDocAttribute otherAtt = other.getAttribute(thisAtt.getKey()); if (!otherAtt.equalsWithSameKey(thisAtt)) { return false; } } return true; }
@Override public Builder add(SubDocAttribute att, ScalarValue value) { String key = att.getKey(); Preconditions.checkArgument(att.equals(expectedType.getAttribute(key))); return super.add(att, value); }
@Override TriValuedResult<ScalarType> finalStep(DocStructure structure, AttributeReference.ObjectKey key, AbstractResolver.Argument arg) { SubDocAttribute attribute = structure.getType().getAttribute(key .getKey()); if (attribute == null) { return TriValuedResult.NULL; } return TriValuedResult.createValue(attribute.getType()); }
String attName = getAttributeName(columnName); if (attName != null) { //it is an attribute SubDocAttribute attribute = subDocType.getAttribute(attName);
SubDocAttribute attribute = lastDocStructure .getType() .getAttribute( objKey.getKey() );
public SubDocument getSubDoc() { SubDocType subDocType = table.getSubDocType(); SubDocument.Builder builder = SubDocument.Builder.withKnownType(subDocType); for (Field<? extends ScalarValue<? extends Serializable>> field : table.getSubDocFields()) { String attName = SubDocHelper.toAttributeName(field.getName()); SubDocAttribute att = subDocType.getAttribute(attName); builder.add(att, getValue(field)); } builder.setDocumentId(getValue(table.getDidColumn())); Integer index = getValue(table.getIndexColumn()); if (index == null) { index = 0; } builder.setIndex(index); return builder.build(); }