instanceOf places fqdn into resulting query #249

Closed
zanfolim opened this Issue Oct 12, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@zanfolim

While trying to restrict the query results by suclasses using instanceOf I got no results. I debugged the hibernate output and notice the query parameter for 'dtype' was replaced by the FQDN instead of the RDN used by hibernate on a single table per hierarchy strategy.

QueryDSL version 2.8
Hibernate version 4.1

I was able to circunvent the issue building the expression myself, as in:

ath baseClassification = Expressions.path(BaseClassification.class,
"baseClassification");
Path dtype = Expressions.path(String.class, baseClassification, "class");
Expression constant = Expressions.constant(classTarget.getSimpleName());
BooleanExpression predicate = Expressions.predicate(Ops.EQ, dtype, constant);

Although I suppose the following should do it if instanceof was working as expected:
QBaseClassification classification = QBaseClassification.classification;
BooleanExpression predicate = classification.instanceOf(classTarget);

Thanks for the great work - QueryDSL really rocks!

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Oct 19, 2012

Member

Released in 2.8.1

Member

timowest commented Oct 19, 2012

Released in 2.8.1

@timowest timowest closed this Oct 19, 2012

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