Skip to content
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
Closed

How to map multiple beans? #100

smiklosovic opened this issue Jul 13, 2016 · 3 comments
Milestone

Comments

@smiklosovic
Copy link

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
Copy link

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
Copy link
Author

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
Copy link

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.

slemesle added a commit that referenced this issue Jun 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants