@Override public Frame where(final String name, final String value) { return this.where(name, Conditions.equalTo(value)); }
/** * With this condition. * @param name Attribute name * @param value The condition * @return New map of conditions * @since 0.18 */ public Conditions with(final String name, final Object value) { return new Conditions( this.conds.with( name, Conditions.equalTo(value) ) ); }
/** * Public ctor. * @param map Map of them */ public Conditions(final Map<String, Condition> map) { this.conds = Conditions.array(map); }
final StringBuilder sql = new StringBuilder("SELECT * FROM ") .append(H2Data.encodeTableName(table)); if (!conds.isEmpty()) { sql.append(" WHERE "); Joiner.on(H2Data.AND).appendTo( sql, Iterables.transform(conds.keySet(), H2Data.WHERE) ); for (final Condition cond : conds.values()) { if (cond.getAttributeValueList().size() != 1) { throw new UnsupportedOperationException(
@Override public boolean has(final String name) throws IOException { return this.data.iterate( this.table, new Conditions().withAttributes( this.attributes.only(this.data.keys(this.table)) ) ).iterator().next().containsKey(name.toLowerCase(Locale.ENGLISH)); }
/** * Public ctor. * @param dta Data * @param table Table */ MkFrame(final MkData dta, final String table) { this(dta, table, new Conditions()); }
@Override public Frame where(final String attr, final Condition condition) { return new AwsFrame( this.credentials, this.tbl, this.name, this.conditions.with(attr, condition), this.valve ); }
final StringBuilder sql = new StringBuilder("SELECT * FROM ") .append(H2Data.encodeTableName(table)); if (!conds.isEmpty()) { sql.append(" WHERE "); Joiner.on(H2Data.AND).appendTo( sql, Iterables.transform(conds.keySet(), H2Data.WHERE) ); for (final Condition cond : conds.values()) { if (cond.getAttributeValueList().size() != 1) { throw new UnsupportedOperationException(
@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); }
/** * Public ctor. * @param dta Data * @param table Table */ MkFrame(final MkData dta, final String table) { this(dta, table, new Conditions()); }
@Override public Frame where(final Map<String, Condition> conds) { return new AwsFrame( this.credentials, this.tbl, this.name, this.conditions.with(conds), this.valve ); }
@Override public Frame where(final String attr, final String value) { return this.where(attr, Conditions.equalTo(value)); }
/** * With this condition. * @param name Attribute name * @param value The condition * @return New map of conditions * @since 0.18 */ public Conditions with(final String name, final Object value) { return new Conditions( this.conds.with( name, Conditions.equalTo(value) ) ); }
@Override public boolean has(final String name) throws IOException { return this.data.iterate( this.table, new Conditions().withAttributes( this.attributes.only(this.data.keys(this.table)) ) ).iterator().next().containsKey(name.toLowerCase(Locale.ENGLISH)); }
/** * Public ctor. * @param creds Credentials * @param table Table * @param label Table name */ AwsFrame(final Credentials creds, final AwsTable table, final String label) { this(creds, table, label, new Conditions(), new ScanValve()); }
@Override public Frame where(final String attr, final Condition condition) { return new AwsFrame( this.credentials, this.tbl, this.name, this.conditions.with(attr, condition), this.valve ); }
/** * Public ctor. * @param map Map of them */ public Conditions(final Map<String, Condition> map) { this.conds = Conditions.array(map); }
@Override public Frame where(final String name, final String value) { return this.where(name, Conditions.equalTo(value)); }
/** * With these conditions. * @param map The conditions * @return New map of conditions */ public Conditions withAttributes(final Map<String, AttributeValue> map) { final ConcurrentMap<String, Condition> cnds = new ConcurrentHashMap<String, Condition>(map.size()); for (final Map.Entry<String, AttributeValue> entry : map.entrySet()) { cnds.put( entry.getKey(), Conditions.equalTo(entry.getValue()) ); } return new Conditions(this.conds.with(cnds)); }
@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); }