Details
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
class Record { @Transient transient Object cachedData; @Column(UserMarshaller.class) UseObject value; @Column("key") UUID id; } Mappers.forClass(Record.class)
instead of like this
Mappers.of(Record.class) .map("id", "key") .map("value", (obj) -> Marshaller.marshal(obj), (row) -> Marshaller.unmarshal(row) );
Attachments
Issue Links
- is part of
-
IGNITE-15782 User POJO mapping.
- Open