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

Yury Gerzhedovich updated IGNITE-15787:
---------------------------------------
        Parent:     (was: IGNITE-15782)
    Issue Type: Improvement  (was: Sub-task)

> Add annotation support to POJO Mappers.
> ---------------------------------------
>
>                 Key: IGNITE-15787
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15787
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Andrey Mashenkov
>            Priority: Major
>              Labels: ignite-3
>
> Let's introduce annotations for mapper builder.
> Suggested annotations:
> * Transient - that makes mapper ignore the marked field. Field data will not 
> be saved into a table.
> * Column(String) - maps field to a field of the given name.
> * Column(Class) - maps field to a field of given name using converter class.
> This will allow users to create mapper like this
> {code:java}
> class Record {
>     @Transient
>     transient Object cachedData;
>    @Column(UserMarshaller.class)
>     UseObject value;
>     @Column("key")
>     UUID id;
> }
> Mappers.forClass(Record.class)
> {code}
>  instead of like this
> {code:java}
>  Mappers.of(Record.class)
>     .map("id", "key")
>     .map("value", 
>         (obj) -> Marshaller.marshal(obj), 
>         (row) -> Marshaller.unmarshal(row)
>     );
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to