New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to map multiple beans? #100

Closed
smiklosovic opened this Issue Jul 13, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@smiklosovic

smiklosovic commented Jul 13, 2016

Hi

I have two classes and one dto. I want to map both classes to that dto. How to do that? I know how to map one class to dto but I need to do kind of "aggregation" of classes into one dto object. Is that possible?

@slemesle

This comment has been minimized.

Show comment
Hide comment
@slemesle

slemesle Jul 15, 2016

Hi,

This is not supported by Selma for now. But you can define one mapping method per class to map on the targetted DTO.

We can for sure implement this kind of aggregation, but that won't be available soon.

slemesle commented Jul 15, 2016

Hi,

This is not supported by Selma for now. But you can define one mapping method per class to map on the targetted DTO.

We can for sure implement this kind of aggregation, but that won't be available soon.

@smiklosovic

This comment has been minimized.

Show comment
Hide comment
@smiklosovic

smiklosovic Jul 16, 2016

i first did mapping from the first source to the destination and after that second source updates the destination. With setting ignore missing flag to ALL because it would tell that source does not have target fields otherwise.

smiklosovic commented Jul 16, 2016

i first did mapping from the first source to the destination and after that second source updates the destination. With setting ignore missing flag to ALL because it would tell that source does not have target fields otherwise.

@CityIntense

This comment has been minimized.

Show comment
Hide comment
@CityIntense

CityIntense May 15, 2017

I have a class FooIn and an id that want to map to a class Out.

public class Out {

private FooOut foo;

private Long id;

}

I'd like to use a mapper as :

Out asOut(FooIn foo, Long id);

Doing so, I get this error :
setter for field id from destination bean Out has no getter in one of source beans !
I can use a class to wrap my id to make my mapper work, but it would be great if I could only use the Long id.

CityIntense commented May 15, 2017

I have a class FooIn and an id that want to map to a class Out.

public class Out {

private FooOut foo;

private Long id;

}

I'd like to use a mapper as :

Out asOut(FooIn foo, Long id);

Doing so, I get this error :
setter for field id from destination bean Out has no getter in one of source beans !
I can use a class to wrap my id to make my mapper work, but it would be great if I could only use the Long id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment