Hi,
Does anyone know how I can avoid an exception for the following code:
-------------------------------------------------------------------
public class EntityWrapper<T>
{
T obj;
}
public class Entity
{
Integer a = 1;
String b = "Foo";
}
EntityWrapper<Entity> en = new EntityWrapper<Entity>();
en.obj = new Entity();
ReflectData.getSchema(en.getClass());
-------------------------------------------------------------------
And the exception is:
org.apache.avro.AvroTypeException: Unknown type: T
at org.apache.avro.specific.SpecificData.createSchema(SpecificData.java:260)
at org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:542)
at
org.apache.avro.reflect.ReflectData.createFieldSchema(ReflectData.java:645)
at
org.apache.avro.reflect.ReflectData$AllowNull.createFieldSchema(ReflectData.java:78)
at org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:500)
at org.apache.avro.specific.SpecificData.getSchema(SpecificData.java:194)
Thx - Sachin