[
https://issues.apache.org/jira/browse/IGNITE-15787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrey Mashenkov updated IGNITE-15787:
--------------------------------------
Description:
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}
was:
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}
Mappers.for(Record.class)
{code}
instead of like this
{code:java}
Mappers.of(Record.class)
.map("field",
(obj) -> Marshaller.marshal(obj),
(row) -> Marshaller.unmarshal(row)
);
{code}
> Mapper builder annotation support
> ---------------------------------
>
> Key: IGNITE-15787
> URL: https://issues.apache.org/jira/browse/IGNITE-15787
> Project: Ignite
> Issue Type: Sub-task
> 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)