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

Common ancestor for JPQL subqueries #323

Closed
TuomasKiviaho opened this Issue Jan 8, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@TuomasKiviaho
Contributor

TuomasKiviaho commented Jan 8, 2013

I anticipated that both JPA and Hibernate have common interface for subqueries like JPQLQuery is for queries but noticed this not to be the case when I got the following exception

private QueryFactory<? extends JPQLQuery, ? extends JPQLSubQuery> queryFactory;
JPQLSubQuery subQuery = queryFactory.subQuery().from( framework );

Caused by: java.lang.ClassCastException: com.mysema.query.jpa.impl.JPASubQuery cannot be cast to com.mysema.query.jpa.JPQLSubQuery

It seems that the JPQLSubQuery is merely a dummy implementation instead of being an interface which was my initial assumption. Would it be possible to convert it as such or make JPASubQuery and HibernateSubQuery extend it instead AbstractJPQLSubQuery if backwards compatibility is a concern in this case, because I'd like to continue using query factory without any knowledge of the underlying system and currently the only feasible solution is not to extract the sub query as a variable.

timowest added a commit that referenced this issue Jan 11, 2013

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 11, 2013

Member

Implemented as suggested.

Member

timowest commented Jan 11, 2013

Implemented as suggested.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 13, 2013

Member

Released in 3.0.0.BETA1

Member

timowest commented Jan 13, 2013

Released in 3.0.0.BETA1

@timowest timowest closed this Jan 13, 2013

@timowest timowest added this to the 3.0.0 milestone Apr 14, 2014

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