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

Bug in .any().as() since 2.7.3 #258

Closed
marcelstoer opened this Issue Oct 23, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@marcelstoer

After upgrading to 2.8 from 2.7.1 one of our tests was flapping i.e. failing most of the time but not always.
Looking at the SQL run against the database we thought it odd or downright wrong. I went through the recent changes and tried older versions. The odd SQL was introduced with 2.7.3 and it may be a result of changes done for issue #217. The test never fails with 2.7.2.

[Entity model]

  • abstract Event with many subclasses
  • abstract Action with many subclasses
  • bi-directional one-to-many relationship from Event->Action

[Query]
Using Querydsl JPA to get all Events with Actions of a particular type
and certain properties.
QSpecificAction action =
QEvent.event.actions.any().as(QSpecificAction.class);
JPAQuery query = queryEreignis().where(
action.published.isTrue().and(
action.title.containsIgnoreCase(searchString).or(
action.message.containsIgnoreCase(searchString))));
List events= query.list(QEvent.event);

Side-question: is this really to way to go?

[SQL]
With Querydsl >= 2.7.3 we see joins over /all/ Action subclasses. Up to 2.7.2 there were only joins from Action to SpecificAction like so:
where
event0_.tenant = ?
and (
exists (
select
1
from
PUBLIC.action specificact1_
left outer join
PUBLIC.specific_action specificact1_1_
on specificact1_.id=specificact1_1_.id

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Oct 23, 2012

Member

The serializer now works in the old way for entity relations and uses the more verbose format for entity collections.

Member

timowest commented Oct 23, 2012

The serializer now works in the old way for entity relations and uses the more verbose format for entity collections.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Oct 30, 2012

Member

Released in 2.8.2

Member

timowest commented Oct 30, 2012

Released in 2.8.2

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