[FLINK-1032] Rework support for POJO types in the Java API