我使用JPA标准API从数据库中获取记录。我有实体Record和字段dateTime,可以为null。Left Joins are used for optional fields, or fields inside of the optional fields. Join<Record, Agency> recordAgencyJoin = recordRoot.join(RecordTable.FIELD_AGENCY);
//
我的rails应用程序中有一个音频模型,它使用id和parent_audio_id字段来构建层次结构。一个Audio可以是另一个Audio的子音频,也可以有多个子Audio(我称之为派生)。我引用了this edge guide on self joins to construct the relationships,and this SO post to help troubleshoot使用下面的活动记录查询,我得到了一个数据集,其中父音频数据复制了N次,其中N等于该父记录的子记录的数量。在给定自加入