public CQL3Type prepare(String keyspace, Types udts) throws InvalidRequestException { if (name.hasKeyspace()) { // The provided keyspace is the one of the current statement this is part of. If it's different from the keyspace of // the UTName, we reject since we want to limit user types to their own keyspace (see #6643) if (!keyspace.equals(name.getKeyspace())) throw new InvalidRequestException(String.format("Statement on keyspace %s cannot refer to a user type in keyspace %s; " + "user types can only be used in the keyspace they are defined in", keyspace, name.getKeyspace())); } else { name.setKeyspace(keyspace); } UserType type = udts.getNullable(name.getUserTypeName()); if (type == null) throw new InvalidRequestException("Unknown type " + name); if (frozen) type = type.freeze(); return new UserDefined(name.toString(), type); }
public CQL3Type prepare(String keyspace, Types udts) throws InvalidRequestException { if (name.hasKeyspace()) { // The provided keyspace is the one of the current statement this is part of. If it's different from the keyspace of // the UTName, we reject since we want to limit user types to their own keyspace (see #6643) if (!keyspace.equals(name.getKeyspace())) throw new InvalidRequestException(String.format("Statement on keyspace %s cannot refer to a user type in keyspace %s; " + "user types can only be used in the keyspace they are defined in", keyspace, name.getKeyspace())); } else { name.setKeyspace(keyspace); } UserType type = udts.getNullable(name.getUserTypeName()); if (type == null) throw new InvalidRequestException("Unknown type " + name); if (frozen) type = type.freeze(); return new UserDefined(name.toString(), type); }
@Override public CQL3Type prepare(KeyspaceMetadata ksm, Types udts) throws InvalidRequestException { if (name.hasKeyspace()) { // The provided keyspace is the one of the current statement this is part of. If it's different from the keyspace of // the UTName, we reject since we want to limit user types to their own keyspace (see #6643) if (!ksm.name.equals(name.getKeyspace())) throw new InvalidRequestException(String.format("Statement on keyspace %s cannot refer to a user type in keyspace %s; " + "user types can only be used in the keyspace they are defined in", ksm.name, name.getKeyspace())); } else { name.setKeyspace(ksm.name); } UserType type = udts.getNullable(name.getUserTypeName()); if (type == null) throw new InvalidRequestException("Unknown type " + name); if (frozen) type = type.freeze(); return new UserDefined(name.toString(), type); }
public CQL3Type prepare(String keyspace, Types udts) throws InvalidRequestException { if (name.hasKeyspace()) { // The provided keyspace is the one of the current statement this is part of. If it's different from the keyspace of // the UTName, we reject since we want to limit user types to their own keyspace (see #6643) if (!keyspace.equals(name.getKeyspace())) throw new InvalidRequestException(String.format("Statement on keyspace %s cannot refer to a user type in keyspace %s; " + "user types can only be used in the keyspace they are defined in", keyspace, name.getKeyspace())); } else { name.setKeyspace(keyspace); } UserType type = udts.getNullable(name.getUserTypeName()); if (type == null) throw new InvalidRequestException("Unknown type " + name); if (frozen) type = type.freeze(); return new UserDefined(name.toString(), type); }
public CQL3Type prepare(String keyspace) throws InvalidRequestException { if (name.hasKeyspace()) { // The provided keyspace is the one of the current statement this is part of. If it's different from the keyspace of // the UTName, we reject since we want to limit user types to their own keyspace (see #6643) if (!keyspace.equals(name.getKeyspace())) throw new InvalidRequestException(String.format("Statement on keyspace %s cannot refer to a user type in keyspace %s; " + "user types can only be used in the keyspace they are defined in", keyspace, name.getKeyspace())); } else { name.setKeyspace(keyspace); } KSMetaData ksm = Schema.instance.getKSMetaData(name.getKeyspace()); if (ksm == null) throw new InvalidRequestException("Unknown keyspace " + name.getKeyspace()); UserType type = ksm.userTypes.getType(name.getUserTypeName()); if (type == null) throw new InvalidRequestException("Unknown type " + name); if (!frozen) throw new InvalidRequestException("Non-frozen User-Defined types are not supported, please use frozen<>"); return new UserDefined(name.toString(), type); }
public static UserDefined create(UserType type) { return new UserDefined(UTF8Type.instance.compose(type.name), type); }
public static UserDefined create(UserType type) { return new UserDefined(UTF8Type.instance.compose(type.name), type); }
public static UserDefined create(UserType type) { return new UserDefined(UTF8Type.instance.compose(type.name), type); }
public static UserDefined create(UserType type) { return new UserDefined(UTF8Type.instance.compose(type.name), type); }
public static UserDefined create(UserType type) { return new UserDefined(UTF8Type.instance.compose(type.name), type); }