[prev in list] [next in list] [prev in thread] [next in thread]
List: avro-user
Subject: Re: Schema generation from POJO
From: Doug Cutting <cutting () apache ! org>
Date: 2013-08-21 19:38:30
Message-ID: CALEq1Z9htRTPCf2PT5-wPYkG_wyrGga4nwwOcpQxuL=56mcx8A () mail ! gmail ! com
[Download RAW message or body]
You can use Avro's reflect facilities:
http://avro.apache.org/docs/current/api/java/org/apache/avro/reflect/package-summary.html
In particular, you can use:
Schema s = ReflectData.get().getSchema(MyPojo.class);
or
DatumWriter<MyPojo> writer = new ReflectDatumWriter<MyPojo>(MyPojo.class);
or
DatumReader<MyPojo> reader = new ReflectDatumReader<MyPojo>(MyPojo.class);
etc.
Doug
On Wed, Aug 21, 2013 at 12:21 PM, Sathwik B P <sathwik@apache.org> wrote:
> Hi guys,
>
> Is there a way to generate the schema from existing pojos.
>
> regards,
> sathwik
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic