Generics in Java are not used at runtime, because at java runtime you are an identifier field of type Object and therefore can be set to any value regardless of generics. However, this is a bad idea, since everything that assumes that the general contract will not work.
You can set the field by reflection as follows:
BeanDo beanDo = new BeanDo();
Method method = BeanDo.getClass().getMethod("setId", Object.class);
method.invoke(beanDo, "SomeRandomString");
, , BeanDo , id , . , , beanDo.getId(), cast, .
, , .