SongNested { String songTitle Artist artist = { String artistName }}
SongFlattened { String songTitle, String artistName}@Mapping(source="artist.artistName", target="artistName")
public SongFlattened toFlat(SongNested nested);public abstract SongNested toNestedSong(SongFlattened);
public abstract ArtistNested toNextedArtist(SongFlattened);
public SongNested toNested(SongFlattened flat) {
SongNested nested = toNestedSong(flat);
}public abstract SongNested toNestedSong(SongFlattened);
public abstract ArtistNested toNextedArtist(SongFlattened);
public SongNested toNested(SongFlattened flat) {
SongNested nested = toNestedSong(flat);
if (nested != null) {
nested.setArtist(toArtistNested(flat);
}
return nested;
}
@Mapping(sourceIsCurrentSource=true, target="artist")
public SongNested toNestedSong(SongFlattened song)
public ArtistNested toNextedArtist(SongFlattened);
@Mapping(target="artist", expression="java(toNestedAddress(song))")public SongNested toNestedSong(SongFlattened song)@Mapping(target="artist", expression="java(toNestedArtist(song))")public SongNested toNestedSong(SongFlattened song)
public ArtistNested toNestedArtist(SongFlattened);