public PostgresSqlStructuredTable(Connection connection, StructuredTableSchema tableSchema) { this.connection = connection; this.tableSchema = tableSchema; this.fieldValidator = new FieldValidator(tableSchema); }
/** * @return the FieldType of INTEGER with the given name */ public static FieldType intType(String name) { return new FieldType(name, FieldType.Type.INTEGER); }
/** * @return the type of the field */ public FieldType.Type getFieldType() { return fieldType.getType(); }
private Range createArtifactScanRange(NamespaceId namespace) { Field<String> stringField = Fields.stringField(StoreDefinition.ArtifactStore.ARTIFACT_NAMESPACE_FIELD, namespace.getNamespace()); return Range.singleton(Collections.singleton(stringField)); }
private String combineWithEqualClause(String prefix, Collection<Field<?>> keys, String suffix) { StringJoiner joiner = new StringJoiner(" AND ", prefix, suffix + ";"); for (Field<?> key : keys) { joiner.add(key.getName() + "=?"); } return joiner.toString(); }
/** * Create a range with a begin and an end. * * @param begin the fields forming the beginning of the range * @param beginBound the match type for the begin fields * @param end the fields forming the end of the range * @param endBound the match type for the end fields * @return a range object */ public static Range create(Collection<Field<?>> begin, Bound beginBound, Collection<Field<?>> end, Bound endBound) { return new Range(begin, beginBound, end, endBound); }
/** * @return the field name */ public String getName() { return fieldType.getName(); }
private Range createAppClassRange(NamespaceId namespace) { return Range.singleton(Collections.singleton(Fields.stringField(StoreDefinition.ArtifactStore.NAMESPACE_FIELD, namespace.getNamespace()))); }
/** * @return the FieldType of DOUBLE with the given name */ public static FieldType doubleType(String name) { return new FieldType(name, FieldType.Type.DOUBLE); }
/** * Creates a range that only matches one element. This range will read all elements which is equal to the * given keys. * * @param singleton the fields forming the singleton range * @return a range object */ public static Range singleton(Collection<Field<?>> singleton) { return new Range(singleton, Bound.INCLUSIVE, singleton, Bound.INCLUSIVE); }
/** * @return the FieldType of FLOAT with the given name */ public static FieldType floatType(String name) { return new FieldType(name, FieldType.Type.FLOAT); }
/** * @return the FieldType of STRING with the given name */ public static FieldType stringType(String name) { return new FieldType(name, FieldType.Type.STRING); }
/** * @return the FieldType of BYTES with the given name */ public static FieldType bytesType(String name) { return new FieldType(name, FieldType.Type.BYTES); }
/** * @return the FieldType of LONG with the given name */ public static FieldType longType(String name) { return new FieldType(name, FieldType.Type.LONG); }