Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Following code won't compile as eq() (as well as in()) method require List<Paintings> or other Property<> in this case, but everything else down the stack will correctly translate and execute this query and return correct result (I've checked this by simply allowing Object as argument in eq())
Painting painting = ObjectSelect.query(Painting.class).selectFirst(context); Artist artist = ObjectSelect.query(Artist.class) .where(Artist.PAINTING_ARRAY.eq(painting)) .selectFirst(context);
Generated SQL:
SELECT DISTINCT t0.ARTIST_NAME, t0.DATE_OF_BIRTH, t0.ARTIST_ID FROM ARTIST t0 JOIN PAINTING t1 ON (t0.ARTIST_ID = t1.ARTIST_ID) WHERE t1.PAINTING_ID = ? LIMIT 1 OFFSET 0 [bind: 1->PAINTING_ID:1]
Workaround can be parsing expression from string:
.where(ExpressionFactory.exp("paintingArray = $p", painting))
Attachments
Issue Links
- requires
-
CAY-2467 New type-aware Property API
- Closed