Új hozzászólás Aktív témák

  • togvau

    senior tag

    SELECT i.targetuser.id,i.id, i.targetuser.userProperties , i.interactiontime FROM Interaction i INNER JOIN Interaction it ON i.owneruser = it.targetuser WHERE i.owneruser.id = ?1 AND i.targetuser =it.owneruser

    Interaction entity User entitykre mutat, a userhez meg tartozik userproperties entity, 1-1 kapcsolatban.
    Itt a fenti kimenet kellene, csak 1 queryvel (mert ez 2-t eredményez, 1x ez a query, majd anyiszor userproperties query, ahány sor az eredmény.

    Ezt hogy lehetne 1 querybe rakni konkrétan? @Transactional nem használ, ha join fetchelni akarom a userpropertiest, mindig sír, hogy a parent object nincs a select listben, akkor is ha ott van (pl nem csak targetuser.id hanem targetuser).

Új hozzászólás Aktív témák