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
Labels
Milestone

Comments

@smiklosovic
Copy link

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

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

@smiklosovic 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.

@slemesle slemesle added this to the 1.0 Final milestone Aug 2, 2016
slemesle added a commit that referenced this issue Apr 17, 2017
…ing and interceptor
slemesle added a commit that referenced this issue Apr 23, 2017
slemesle added a commit that referenced this issue Apr 26, 2017
slemesle added a commit that referenced this issue Apr 26, 2017
@slemesle slemesle closed this Apr 27, 2017
@CityIntense
Copy link

@CityIntense 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.