You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org> on 2018/12/30 04:32:00 UTC

[jira] [Updated] (AVRO-1568) Allow Java polymorphism in Avro for third-party code

     [ https://issues.apache.org/jira/browse/AVRO-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thiruvalluvan M. G. updated AVRO-1568:
--------------------------------------
    Component/s: java

> Allow Java polymorphism in Avro for third-party code
> ----------------------------------------------------
>
>                 Key: AVRO-1568
>                 URL: https://issues.apache.org/jira/browse/AVRO-1568
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.6
>            Reporter: Sachin Goyal
>            Priority: Major
>
> A large number of Java designs interacting with databases with Hibernate/Couchbase (perhaps, even otherwise) have Java polymorphism of the form:
> {code:java}
> class Base 
> {
>    Integer a = 5;
> }
> class Derived extends Base
> {
>     String b = "Foo";
> }
> class PolymorphicDO
> {
>    Base b = new Derived();
> }
> {code}
> Jackson handles this kind of field by using annotations such as:
> {code}
> @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class”)
> {code}
> If such a thing can be added to Avro, all those Java designs could become immediately usable with Avro. They would also become Hadoop compatible due to AvroSerde.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)