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