You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "pierre bouvret (JIRA)" <ji...@apache.org> on 2019/03/26 18:55:00 UTC

[jira] [Commented] (AVRO-1903) Java package/class bindings for specific records

    [ https://issues.apache.org/jira/browse/AVRO-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16802075#comment-16802075 ] 

pierre bouvret commented on AVRO-1903:
--------------------------------------

I don't know if this patch is the right way to handle the problem but generating java classes that will not compile is a real bug !

> Java package/class bindings for specific records
> ------------------------------------------------
>
>                 Key: AVRO-1903
>                 URL: https://issues.apache.org/jira/browse/AVRO-1903
>             Project: Apache Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.8.1
>            Reporter: Frederic Boucher
>            Priority: Major
>         Attachments: AVRO-1903.patch
>
>
> Naming convention of the Avro schemas we create are not always in line with the Java coding convention. The maven-plugin to generate specific record classes should provide a way to bind namespace or schema names to a custom Java package or class name.
> We have implemented a solution where we can add bindings into the maven-plugin configuration:
> One to one binding:
> <binding>
>     <from>com.namspace.order.state</from>
>     <to>com.package.Order</to>
> </binding>
> It will create a class "Order" into package "com.package" for schema "state" and namespace "com.namspace.order"
> Reg-exp based binding:
> <binding>
>     <from>com.namespace.order.([a-zA-Z]+)</from>
>     <to>com.package.order.Order$1</to>
> </binding>
> Bindings are matched in order, which means the most specific bindings have to be put before the generic ones.



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