@Override public AttributeValue get(final String name) throws IOException { return this.data.iterate( this.table, new Conditions().withAttributes( this.attributes.only(this.data.keys(this.table)) ) ).iterator().next().get(name); }
@Override public AttributeValue get(final String name) throws IOException { return this.data.iterate( this.table, new Conditions().withAttributes( this.attributes.only(this.data.keys(this.table)) ) ).iterator().next().get(name); }
@Override public Map<String, AttributeValue> put( final Map<String, AttributeValueUpdate> attrs) throws IOException { final Map<String, AttributeValue> keys = new HashMap<String, AttributeValue>(0); for (final String attr : this.data.keys(this.table)) { keys.put(attr, this.attributes.get(attr)); } try { this.data.update( this.table, new Attributes(keys), new AttributeUpdates(attrs) ); } catch (final IOException ex) { throw new IllegalStateException(ex); } return Maps.transformValues( attrs, new Function<AttributeValueUpdate, AttributeValue>() { @Override public AttributeValue apply(final AttributeValueUpdate update) { return update.getValue(); } } ); }
@Override public Map<String, AttributeValue> put( final Map<String, AttributeValueUpdate> attrs) throws IOException { final Map<String, AttributeValue> keys = new HashMap<String, AttributeValue>(0); for (final String attr : this.data.keys(this.table)) { keys.put(attr, this.attributes.get(attr)); } try { this.data.update( this.table, new Attributes(keys), new AttributeUpdates(attrs) ); } catch (final IOException ex) { throw new IllegalStateException(ex); } return Maps.transformValues( attrs, new Function<AttributeValueUpdate, AttributeValue>() { @Override public AttributeValue apply(final AttributeValueUpdate update) { return update.getValue(); } } ); }
@Override public AttributeValue get(final String attr) throws IOException { final String attrib = String.format(Locale.ENGLISH, attr); AttributeValue value = this.attributes.get(attrib); if (value == null) { final AmazonDynamoDB aws = this.credentials.aws();
@Override public AttributeValue get(final String attr) throws IOException { final String attrib = String.format(Locale.ENGLISH, attr); AttributeValue value = this.attributes.get(attrib); if (value == null) { final AmazonDynamoDB aws = this.credentials.aws();