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

Project the results to a specific class #35

Open
doctore opened this issue Mar 29, 2014 · 2 comments
Open

Project the results to a specific class #35

doctore opened this issue Mar 29, 2014 · 2 comments

Comments

@doctore
Copy link

doctore commented Mar 29, 2014

Hi.

Congratulations for your work, with your solution I need to write less code than other alternatives like Querydsl, besides do not generate intermediate classes.

However I miss some features like fetch joins or being able to project the results to a specific class. Something like this:

Entity entity = from(Entity.class);
SubEntity subEntity = innerJoin(entity.getSubEntity());

List[MixEntityDTO] listDTOs = select (create (MixEntityDTO.class, entity.getCode(), subEntity.getCode()).list (entityManager);

PD. I put [ ] in listDTOs definition because the simbols: less and major causes the code in between these characters not see.

Thanks in advance.

@xjodoin
Copy link
Owner

xjodoin commented Mar 31, 2014

Thanks for the feedback.
It will be easy to add fetch join I think the better way to do it is like that SubEntity subEntity = fetch(innerJoin(entity.getSubEntity()));

And to create new objects I will check how I can do it I will try to keep the type safety " new MixEntityDTO(entity.getCode(), subEntity.getCode()) "

@doctore
Copy link
Author

doctore commented May 19, 2014

Hi xjodoin

fetch perhaps could be an extra parameter in "join functions". On the other hand, I prefer your solution when projecting the results to a particular class.

I'll be awaiting the new version to be able to integrate it into my projects.

Thanks and good work.

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