}
// Convert the string value into the proper type.
if ( type instanceof StringRepresentableType ) {
StringRepresentableType nullableType = (StringRepresentableType) type;
value = nullableType.fromStringValue( stringValue );
}
else {
throw new QueryException( "Unsupported discriminator type " + type );
}
return new TypedValue( type, value );