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

Add more examples #14

Open
remmeier opened this issue May 25, 2018 · 7 comments
Open

Add more examples #14

remmeier opened this issue May 25, 2018 · 7 comments

Comments

@remmeier
Copy link
Contributor

remmeier commented May 25, 2018

  • decoration of repository
  • Entity <-> DTO mapping with map struct, mapping of QuerySpec, separate basic and advanced example
  • JPA relationship example
@cgendreau
Copy link

I think an example of mapping QuerySpecs when we are doing the DTO mapping with MapStruct would be very useful.

@cgendreau
Copy link

I just found mapstruct/mapstruct#702 (comment)

@remmeier
Copy link
Contributor Author

sounds good to me. You already have something running? or still in immediate need of an example?

@remmeier
Copy link
Contributor Author

unfortuatenly nothing automatic as of yet. But there is a QuerySpecMutator class that can help getting the job done.

@cgendreau
Copy link

I should be able to provide something using QuerySpecMutator . Thanks for the hint.

I have to admit I'm having hard time with the last point (JPA relationship example). I will try to explain what I'm trying to do.

DTO -> Crnk Repository -> MapStruct -> Entity -> DAO (and the other way around for the response).

I can manage it with a regular repository but for the relationships I'm not sure how to approach it. I'm currently trying with ManyRelationshipRepositoryBase but I would like to avoid loading the related-dto and attached them to the source DTO (when setting a relation). If possible I would prefer to keep the ids and let the DAO setting the relationships without loading the related entities. I guess I could simply add the ID list to my DTO but I was wondering if it was the best way to achieve that. I hope it makes sense. Thanks!

@cgendreau
Copy link

I'm making some progress. The only major missing part is QuerySpec translation. Where can I find the QuerySpecMutator class?

@remmeier
Copy link
Contributor Author

remmeier commented Oct 30, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants