I have the following property in the hibenrate entity class:
@MapKeyJoinColumn(name = "language_code") @LazyCollection(LazyCollectionOption.EXTRA) @ElementCollection(fetch = FetchType.LAZY) @CollectionTable(name = "text_translations", joinColumns = @JoinColumn(name = "text_id")) private Map<Language, String> translations = new HashMap<>();
Now I want to query this object and filter the contents of the map by the user's language (i.e. by the map key). I want to join my request:
StringPath titleTran = new StringPath("title_tran"); from(entity). .leftJoin(entity.translations, titleTran).fetch().where(?mapKey?.eq(userLanguage));
What I need? mapKey? on the language path of the titleTran path. Is this possible in QueryDsl?
source share