String name = fieldNames.get(i).toString(); // JPA name,
/** * Creates a {@code FieldIdentifier} from a quoted identifier string. */ public static FieldIdentifier forQuoted(String text) { return new FieldIdentifier(convert(text)); }
public boolean isCompatibleWith(RawUpdate other) { if (other instanceof SetField) return !((SetField) other).field.equals(field); else return !(other instanceof SetValue); } }
UserType prepare(String keyspace, Types types) { List<FieldIdentifier> preparedFieldNames = fieldNames.stream() .map(t -> FieldIdentifier.forInternalString(t)) .collect(toList()); List<AbstractType<?>> preparedFieldTypes = fieldTypes.stream() .map(t -> t.prepareInternal(keyspace, types).getType()) .collect(toList()); return new UserType(keyspace, bytes(name), preparedFieldNames, preparedFieldTypes, true); }
id = FieldIdentifier.forUnquoted((t!=null?t.getText():null)); id = FieldIdentifier.forQuoted((t!=null?t.getText():null)); state._fsp--; id = FieldIdentifier.forUnquoted(k);
/** * Creates a {@code FieldIdentifier} from an internal string. */ public static FieldIdentifier forInternalString(String text) { // If we store a field internally, we consider it as quoted, i.e. we preserve // whatever case the text has. return forQuoted(text); }
public static UserType getInstance(TypeParser parser) throws ConfigurationException, SyntaxException { Pair<Pair<String, ByteBuffer>, List<Pair<ByteBuffer, AbstractType>>> params = parser.getUserTypeParameters(); String keyspace = params.left.left; ByteBuffer name = params.left.right; List<FieldIdentifier> columnNames = new ArrayList<>(params.right.size()); List<AbstractType<?>> columnTypes = new ArrayList<>(params.right.size()); for (Pair<ByteBuffer, AbstractType> p : params.right) { columnNames.add(new FieldIdentifier(p.left)); columnTypes.add(p.right); } return new UserType(keyspace, name, columnNames, columnTypes, true); }
UserType prepare(String keyspace, Types types) { List<FieldIdentifier> preparedFieldNames = fieldNames.stream() .map(t -> FieldIdentifier.forInternalString(t)) .collect(toList()); List<AbstractType<?>> preparedFieldTypes = fieldTypes.stream() .map(t -> t.prepareInternal(keyspace, types).getType()) .collect(toList()); return new UserType(keyspace, bytes(name), preparedFieldNames, preparedFieldTypes, true); }
id = FieldIdentifier.forUnquoted((t!=null?t.getText():null)); id = FieldIdentifier.forQuoted((t!=null?t.getText():null)); state._fsp--; id = FieldIdentifier.forUnquoted(k);
/** * Creates a {@code FieldIdentifier} from an internal string. */ public static FieldIdentifier forInternalString(String text) { // If we store a field internally, we consider it as quoted, i.e. we preserve // whatever case the text has. return forQuoted(text); }
public static UserType getInstance(TypeParser parser) throws ConfigurationException, SyntaxException { Pair<Pair<String, ByteBuffer>, List<Pair<ByteBuffer, AbstractType>>> params = parser.getUserTypeParameters(); String keyspace = params.left.left; ByteBuffer name = params.left.right; List<FieldIdentifier> columnNames = new ArrayList<>(params.right.size()); List<AbstractType<?>> columnTypes = new ArrayList<>(params.right.size()); for (Pair<ByteBuffer, AbstractType> p : params.right) { columnNames.add(new FieldIdentifier(p.left)); columnTypes.add(p.right); } return new UserType(keyspace, name, columnNames, columnTypes, true); }
/** * Creates a {@code FieldIdentifier} from a quoted identifier string. */ public static FieldIdentifier forQuoted(String text) { return new FieldIdentifier(convert(text)); }
public UserType(String keyspace, ByteBuffer name, List<FieldIdentifier> fieldNames, List<AbstractType<?>> fieldTypes, boolean isMultiCell) { super(fieldTypes, false); assert fieldNames.size() == fieldTypes.size(); this.keyspace = keyspace; this.name = name; this.fieldNames = fieldNames; this.stringFieldNames = new ArrayList<>(fieldNames.size()); this.isMultiCell = isMultiCell; for (FieldIdentifier fieldName : fieldNames) stringFieldNames.add(fieldName.toString()); }
UserType prepare(KeyspaceMetadata ksm, Types types) { List<FieldIdentifier> preparedFieldNames = fieldNames.stream() .map(t -> FieldIdentifier.forInternalString(t)) .collect(toList()); List<AbstractType<?>> preparedFieldTypes = fieldTypes.stream() .map(t -> t.prepareInternal(ksm, types).getType()) .collect(toList()); return new UserType(ksm.name, bytes(name), preparedFieldNames, preparedFieldTypes, true); }
id = FieldIdentifier.forUnquoted((t!=null?t.getText():null)); id = FieldIdentifier.forQuoted((t!=null?t.getText():null)); state._fsp--; id = FieldIdentifier.forUnquoted(k);
public boolean isCompatibleWith(RawUpdate other) { if (other instanceof SetField) return !((SetField) other).field.equals(field); else return !(other instanceof SetValue); } }
/** * Creates a {@code FieldIdentifier} from an internal string. */ public static FieldIdentifier forInternalString(String text) { // If we store a field internally, we consider it as quoted, i.e. we preserve // whatever case the text has. return forQuoted(text); }
public static UserType getInstance(TypeParser parser) throws ConfigurationException, SyntaxException { Pair<Pair<String, ByteBuffer>, List<Pair<ByteBuffer, AbstractType>>> params = parser.getUserTypeParameters(); String keyspace = params.left.left; ByteBuffer name = params.left.right; List<FieldIdentifier> columnNames = new ArrayList<>(params.right.size()); List<AbstractType<?>> columnTypes = new ArrayList<>(params.right.size()); for (Pair<ByteBuffer, AbstractType> p : params.right) { columnNames.add(new FieldIdentifier(p.left)); columnTypes.add(p.right); } return new UserType(keyspace, name, columnNames, columnTypes, true); }
/** * Creates a {@code FieldIdentifier} from a quoted identifier string. */ public static FieldIdentifier forQuoted(String text) { return new FieldIdentifier(convert(text)); }
public UserType(String keyspace, ByteBuffer name, List<FieldIdentifier> fieldNames, List<AbstractType<?>> fieldTypes, boolean isMultiCell) { super(fieldTypes, false); assert fieldNames.size() == fieldTypes.size(); this.keyspace = keyspace; this.name = name; this.fieldNames = fieldNames; this.stringFieldNames = new ArrayList<>(fieldNames.size()); this.isMultiCell = isMultiCell; LinkedHashMap<String , TypeSerializer<?>> fieldSerializers = new LinkedHashMap<>(fieldTypes.size()); for (int i = 0, m = fieldNames.size(); i < m; i++) { String stringFieldName = fieldNames.get(i).toString(); stringFieldNames.add(stringFieldName); fieldSerializers.put(stringFieldName, fieldTypes.get(i).getSerializer()); } this.serializer = new UserTypeSerializer(fieldSerializers); }